It's not possible to specify multiple `-with-rtsopts` flags
Motivation
Currently -with-rtsopts
can only be specified once, repeat uses will clobber each other. The result of this is that it's cumbersome to, for example, conditionally specify/add RTS flags in cabal files (for example, adding additional compile time RTS options for profiling builds).
Proposal
There are two possible ways to fix this issue:
- Simply change
-with-rtsopts
to concatenate all the options from each flag - Add a new flags
-add-rtsopt
or something along those lines which concatenates all its invocations together. This approach has several options:- Extend the the last preceding
-with-rtsopts
with the new added options. (Confusing if a later-with-rtsopts
clobbers this) - Make
-with-rtsopts
and-add-rtsopt
mutually exclusive - Extend the final
-with-rtsopts
with these new options
- Extend the the last preceding
Options 1 has the benefit of not adding a new flag and working as many people (anecdotally) already expect the flag to work, but could theoretically break existing uses of -with-rtsopts
. Option 2.1 I think is to confusing to really consider. Option 2.2 is unambiguous, but also not very convenient. Option 2.3 plays nicely with (possible) existing uses of -with-rtsopts
clobbering behaviour without making the behaviour of -add-rtsopt
unnecessarily confusing.
Personally I tend towards options 1 or 2.3, but I don't have a very strong opinion on the bikeshed colour. It would be useful for people to chime in which option makes the most sense.
It's unclear if anyone is even using/relying the current behaviour of -with-rtsopts
, so I'll create a comment for each option and people can thumbs up/down each option to poll opinion on the bikeshed colour.