Description
What
Presently, we expose GHC.RTS.Flags
in base. This proposal proposes to move them out of base
and into ghc-internal
or some other similar package. We can decide where would be best in the comments.
Why
It is non-obvious that have GHC.RTS.Flags
in base creates downstream issues, but in practice this is the case and we end up creating more work for the CLC, for GHC developers, increase coupling of base to GHC versions. There are several CLC proposals which were only created because these flags are exposed in base, and as far as I can tell there isn't much debate in any of the proposals:
- Add --optimistic-linking to GHC RTS Flags exposed in base. #288: adds a RTS linker flag, which becomes exposed in base, and therefore requires a CLC proposal
- Minor tweaks to GHC RTS flags exposed via base #263: created in response to @dcoutts work on the RTS IO managers. This modified the RTS flags in response to the new manager thereby requiring a CLC proposal.
- Add new RTS options introduced by eras profiling to GHC.RTS.Flags #254: added new RTS flags for profiling modes
- Expose
--no-automatic-time-samples
inGHC.RTS.Flags
API #243: similar to Add new RTS options introduced by eras profiling to GHC.RTS.Flags #254
Which begs the question: Is there a meaningful debate to be had for RTS flag changes like this? And should that debate occur in base with the CLC. So far these seem to have been relatively uncontroversial.
Implementation
I will implement and this should miss the 9.12 fork. I'm unsure if ghc-internal
is the best home for these flags. I'll bring this up in the next GHC call. But I think it is the best place we have right now.
The plan is given by this comment. To be succinct we:
- create compat functions and types in base. This is MR!13428 and is implemented, waiting on review.
- move the flags to
ghc-experimental
and expose them throughghc-experimental
. This is where consumers should expect to use these flags moving forward. This is MR!13343, it still needs work but should be trivial I just won't have time until this Friday. - Begin deprecating by adding warnings to the compat functions and types from (1). Not yet done.
Impact
As Duncan writes in #263:
The GHC RTS flags are currently exposed via base in GHC.RTS.Flags. The types there reflect 1:1 the GHC RTS CLI flags. Thus these types are obviously tightly coupled to GHC and the GHC version.
This is exactly right, and so decoupling these flags is a meaningful step towards the ghc-base split.