hpack
hpack copied to clipboard
Add support for rts-options
This PR addresses https://github.com/sol/hpack/issues/237 by adding explicit support for rts-options.
A note on semantics: When -with-rtsopts are specified multiple times then ghc only takes the last occurrence into account. For that reason, when a user wants to add additional rts options within a conditional s/he currently has to reiterate any outer rts options within the conditional, e.g.:
executable:
ghc-options: '"--with-rtsopts -s"'
when:
condition: flag(with-threading)
ghc-options: '"--with-rtsopts -s -N"'
I implemented rts-options so that they are combined in the same way as most other things we support. The following gives the same result as above:
executable:
rts-options: -s
when:
condition: flag(with-threading)
rts-options: -N
The tests show how this is mapped to .cabal: https://github.com/sol/hpack/pull/434/files#diff-c65aea3074dd2715b0aba52f9aaa1c5fa81b2ca89099c80150b41c33128a5262R1439-R1464
@snoyberg @quasicomputational @tfausak any thoughts?
Nice!
The tests only show rts-options taking a string. Does it also allow for lists like ghc-options does (IIRC)?
I hope you will consider merging this. It would be a nice addition to hpack.
@istathar at the moment I don't have free cycles for this. If you want to help move this forward, this are the things we need:
- [ ] double check that it works as expected and optionally do some bikeshedding on the quoting
- [ ] update the read me
- [ ] add an entry to the change log
As a separate PR:
- [ ] bump the minor version
@sol happy to help with your checklist. I'll see if I can do that this week.