Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow runtime override via environment var (GHC_HOME?) #27

Open
bitc opened this issue Nov 16, 2021 · 0 comments
Open

Allow runtime override via environment var (GHC_HOME?) #27

bitc opened this issue Nov 16, 2021 · 0 comments

Comments

@bitc
Copy link

bitc commented Nov 16, 2021

The problem with this library is that it bakes the absolute path of the GHC installation into the compiled binary, but then if the binary is copied to another computer, the GHC installation might be in a different path and the binary won't work.

I propose that this library should transparently read from an environment variable called GHC_HOME first, if it exists then use that, otherwise fallback to the compiled-in path.

Other languages have a similar environment variable, for example: JAVA_HOME and PYTHONHOME.

The current workaround is to simply write the code yourself to read from GHC_HOME environment var and then fallback to ghc-paths, but having the code in this library would help to standardize my proposed GHC_HOME environment variable throughout the Haskell ecosystem.

Btw, if you are going to ask your users to set a GHC_HOME environment variable, then why use this library at all in the first place? Well, during development and for running unit tests it is convenient to not have to set any configuration, so using ghc-paths is good, but then it would be nice if the same binary would also transparently and automatically be portable via an environment variable setting.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant