Skip to content

Move GHC.RTS.Flags out of base. #289

Closed
@doyougnu

Description

@doyougnu

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:

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:

  1. create compat functions and types in base. This is MR!13428 and is implemented, waiting on review.
  2. move the flags to ghc-experimental and expose them through ghc-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.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedApproved by CLC votebase-4.22Implemented in base-4.22 (GHC 9.14)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions