Allow passing RTS options to GHC in stack.yaml#5568
Allow passing RTS options to GHC in stack.yaml#5568snoyberg merged 4 commits intocommercialhaskell:masterfrom
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.
I'm not sure how important this is in this case, but this has quadratic performance. I'd recommend instead collecting a list of Texts 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.
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.
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
stackbuilds successfully when passing RTS options to GHC.Fixes #5180