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

Stack should hide GHCRTS environment variable #3444

Closed
mgsloan opened this Issue Sep 20, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@mgsloan
Collaborator

mgsloan commented Sep 20, 2017

This stackoverflow question brings up a case of trying to run stack runghc with GHCRTS set, in an attempt to get RTS arguments passed to the user's program. Passing in -N fails because ghc-pkg isn't built with -threading. I don't think it makes sense to pass the GHCRTS environment variable through to every haskell program stack invokes, it is too blunt of a hammer. Instead, users can use things like --haddock-arguments, --ghc-options, etc.

Unfortunately it looks like there is no "proper" way to pass RTS options through runghc - see this other stackoverflow question

I think it makes sense to only pass GHCRTS through for the programs run via stack exec / stack runghc / stack runhaskell / stack script / stack ghci / stack repl / stack eval.

Note that there's no avoiding stack itself also getting these RTS arguments. In the case of ghc, the RTS arguments will be used by stack, ghc, and the program that gets run. So, this is indeed quite a hack. Would be good to get this fixed in ghc itself.

One thing that occurs to me is that it might be good to have a STACK_GHCRTS var, to allow specifying GHCRTS without. Alternatively, maybe this should just be a commandline options. Thoughts?

@mgsloan mgsloan added this to the P2: Should milestone Sep 20, 2017

mgsloan added a commit that referenced this issue Sep 20, 2017

mgsloan added a commit that referenced this issue Sep 20, 2017

Drop GHCRTS envvar unless user is asking for execution #3444
Also, there is another small behavior change here, which is
that when ghcjs-boot is run, UTF8 locale environment variables
get set.  I hope this only fixes things, rather than breaking
anything!

snoyberg added a commit that referenced this issue Nov 27, 2017

Merge pull request #3445 from commercialhaskell/drop-ghcrts-env-var
Drop GHCRTS envvar unless user is asking for execution #3444
@snoyberg

This comment has been minimized.

Contributor

snoyberg commented Nov 27, 2017

Addressed by #3445

@snoyberg snoyberg closed this Nov 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment