ndmitchell / hoogle

Haskell API search engine
http://hoogle.haskell.org/
Other
753 stars 137 forks source link

Command flag for overriding data directory in servers #228

Closed JonCoens closed 6 years ago

JonCoens commented 7 years ago

Building a binary that contains a hoogle server has hard-coded paths embedded in the binary. When deploying this binary to other machines, the full paths generated from Paths_hoogle may not exist. This provides a command line override for the location of the local resources.

JonCoens commented 7 years ago

appveyor failure looks unrelated to this change

ndmitchell commented 6 years ago

Thanks for the PR!

At the moment I currently change the data directory using the hoogle_datadir environment variable, which is something Cabal creates automatically if you are using data directory stuff. As an example see https://github.com/ndmitchell/hoogle/blob/master/misc/Upgrade.hs#L48. However, it's not very discoverable, so I'm definitely not averse to having a flag - and as usual the only real question is naming...

ndmitchell commented 6 years ago

For info, the Appveyor failure appears to be a ghc-pkg bug that is fixed in GHC 8.2, so will stop happening after Stack LTS upgrades to that GHC.

JonCoens commented 6 years ago

Our build environment for using Hoogle-as-a-service is outside Cabal, so unfortunately that env var won't work easily for us. For what it's worth, I've patched this locally for us and it's working swimmingly.

ndmitchell commented 6 years ago

Thanks - merged! Would a release be useful?

JonCoens commented 6 years ago

We’re going on just fine as I’ve patched locally, so no rush on our part. Thanks for the offer, though. On Sun, Nov 26, 2017 at 13:33 Neil Mitchell notifications@github.com wrote:

Thanks - merged! Would a release be useful?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ndmitchell/hoogle/pull/228#issuecomment-347040122, or mute the thread https://github.com/notifications/unsubscribe-auth/AArmrUbojkT4KgAnpeX88Ud_61TgLMN9ks5s6dkOgaJpZM4Qk6oW .

ndmitchell commented 6 years ago

I released 5.0.14 anyway, since it's handy to have and I probably won't make a release for a little while otherwise.