hpack icon indicating copy to clipboard operation
hpack copied to clipboard

Add support for rts-options

Open sol opened this issue 4 years ago • 4 comments
trafficstars

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?

sol avatar Feb 18 '21 12:02 sol

Nice!

The tests only show rts-options taking a string. Does it also allow for lists like ghc-options does (IIRC)?

tfausak avatar Feb 18 '21 12:02 tfausak

I hope you will consider merging this. It would be a nice addition to hpack.

istathar avatar Feb 15 '23 07:02 istathar

@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 avatar Feb 16 '23 13:02 sol

@sol happy to help with your checklist. I'll see if I can do that this week.

istathar avatar Feb 20 '23 22:02 istathar