-
Notifications
You must be signed in to change notification settings - Fork 841
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 passing RTS options to GHC in stack.yaml #5568
Allow passing RTS options to GHC in stack.yaml #5568
Conversation
it seems like the integration tests on Mac are broken for an unrelated reason - failing to execute GHC for permissions? |
src/Stack/Types/Build.hs
Outdated
(other, rest) = | ||
takeRtsArgs xs | ||
in | ||
(T.unpack x ++ " " ++ other, rest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how important this is in this case, but this has quadratic performance. I'd recommend instead collecting a list of Text
s and then combining with T.unwords
. In fact, I think then you'd be able to use break (== "-RTS")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip! I've provided a much nicer looking implementation, and it even made me aware of the case where a user does not provide a -RTS
in the argument list.
I decided to splice a -RTS
on the end of the collected RTS args regardless. This matches the syntax you might use in a CLI invocation - ghc --version +RTS -N -A128m
. As far as I know, this shouldn't cause any problems - any string without an -RTS
would completely fail without this, and any string with non-RTS arguments after a +RTS
would fail in either case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Note: Documentation fixes for https://docs.haskellstack.org/en/stable/ should target the "stable" branch, not master.
Please include the following checklist in your PR:
I added an integration test that ensures
stack
builds successfully when passing RTS options to GHC.Fixes #5180