Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wiredInPackages is out of date and depends on GHC version #40

Open
chreekat opened this issue Apr 25, 2024 · 6 comments
Open

wiredInPackages is out of date and depends on GHC version #40

chreekat opened this issue Apr 25, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@chreekat
Copy link
Member

chreekat commented Apr 25, 2024

GHC's wired-in packages are currently

https://gitlab.haskell.org/ghc/ghc/-/blob/master/compiler/GHC/Unit/Types.hs#L635-643

wiredInUnitIds =
   [ primUnitId
   , bignumUnitId
   , ghcInternalUnitId
   , baseUnitId
   , rtsUnitId
   , thUnitId
   , experimentalUnitId
   ]

curator and stack both have different lists.

Curator:

https://github.com/commercialhaskell/curator/blob/master/src/Curator/Snapshot.hs#L565-L580

wiredInGhcPackages =
    Set.fromList
        [ "ghc-prim"
        , "integer-gmp"
        , "integer-simple"
        , "base"
        , "rts"
        , "template-haskell"
        , "dph-seq"
        , "dph-par"
        , "ghc"
        , "interactive"
        ]

Stack: commercialhaskell/stack#6558

I have no idea what effect this has on Stack or Stackage snapshots.

@bergmark
Copy link
Member

I don't know why stack needs the list, seems odd if it wouldn't tie it to GHC versions.

For curator, I think:

a ghc-wired package missing in curator means we may upgrade it and that can break snapshots - but perhaps that would also break the creation of the snapshots since we build with stack. If it's missing in ghc it means that we won't upgrade them in snapshots even if we have to - so that's less of an issue.

I'm not sure what actual issues it may cause... we should keep it up-to-date

@chreekat
Copy link
Member Author

Yeah looks like you wouldn't be able to specify such a package in a snapshot:

        let isWiredIn pn _ = pn `Set.member` wiredInGhcPackages
            (wiredIn, packages) =
              Map.partitionWithKey isWiredIn (Pantry.snapshotPackages snapshot)
        if not (Map.null wiredIn)
        then do
          let errMsg = "GHC wired-in package can not be overriden"
          pure $ Map.map (const [OtherError errMsg]) wiredIn

src/Curator/Snapshot:192

@mpilgrem
Copy link
Member

As wired-in packages are GHC boot packages, I think they should not be included directly in snapshots. I've done some spring cleaning on Stack's list.

@mpilgrem
Copy link
Member

@bergmark, Stack will not create a project with the same name as a wired-in package. For example:

❯ stack new rts

Error: [S-5682]
       Stack declined to create a new directory for project rts, as
       package rts is 'wired-in' to a version of GHC. That can cause
       build errors.

       The names blocked by Stack are: base, dph-par, dph-seq, ghc,
       ghc-bignum, ghc-prim, integer-gmp, integer-simple, interactive,
       rts and template-haskell.

@chreekat
Copy link
Member Author

Sort of related haskell/cabal#9669

@chreekat chreekat added the bug Something isn't working label Apr 29, 2024
@TeofilC
Copy link

TeofilC commented Sep 28, 2024

See also: haskell/cabal#10087

GHC-9.12 is likely to not wire-in template-haskell and base.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants