-
Notifications
You must be signed in to change notification settings - Fork 237
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
Boot packages missing from Hackage cannot be used. #524
Comments
Now that Cabal-3.0.1.0 is on Hackage, one must go back to |
@TravisWhitaker As this is not finally resolved upstream (hackage), are you ok with closing this? |
I suppose it depends on what the behavior of haskell.nix should be. Is it desirable to run plans that include boot packages that aren't on hackage? I think it'd be useful to handle this, since this issue of boot package releases missing from hackage has occurred the past several GHC releases, and is likely to continue in the future. |
There is validation support in ghc’s build machinery to ensure packages are on hackage. The cabal issue recently was due to hackage not supporting cabal3 packages. Of course this should have been fixed prior to releasing ghc, but, ohh well... Thus I hope the risk of having ghc ship with packages not on hackage going forward is minimal. /cc @bgamari |
That's sadly already proved to not be true in haskell-infra/hackage-trustees#240 for GHC 8.10 and previous releases as catalogued there and I fear it'll be the same in the future. I think haskell.nix is going to be uniquely negatively affected here by boot packages not being on hackage quickly. I really don't understand the situation and you might take away from that thread as I did there isn't much transparency or interest in an exposition of the core issue so that others may be able to help. I sense there is an internal consensus of "this problem can't be helped so our time is more useful fixing other things than describing something that can't be fixed or automated". So can't say whether that's good or bad, reasonable or unreasonable, only there's not much transparency and it seems very difficult to learn enough alone to contribute meaningfully. I've personally been running into issues from the linked issue for a while know, so sorry for some venting. My main point was haskell.nix might want to consider delayed boot packages a reality for hard to discover reasons and act accordingly given recent and past history. |
TL;DR: How can haskell.nix correctly handle plans that depend on boot packages that haven't been uploaded to Hackage? One solution is to always copy the in-use GHC's boot packages from the global package database into the build package database, as is already done for non-reinstallable boot packages.
Packages depending on GHC boot packages that have not been uploaded to Hackage cannot be built with haskell.nix. By "boot packages," I mean precisely what the GHC docs say; the code in this project seems to play it fast-and-loose with the term "boot package", which has caused me hours of confusion. There is some existing machinery in haskell.nix (specifically this stuff) that does the right thing for a seemingly-arbitrary subset of boot packages like
base
andbytestring
, but fails for packages likeCabal
.I've uploaded a test package here that demonstrates this issue by depending on
base-4.13.0.0
andCabal-3.0.1.0
, boot packages that are not on Hackage. Attempting to build this package yields this:By examining the plan, we can see the issue:
Inside
/nix/store/9bzvw2f7fya8pcf9mn8r27i18iyn6wdb-troll-plan-to-nix-pkgs/default.nix
we find:This plan has some strange things in it. We depend on packages like
rts-1.0
,Cabal-3.0.1.0
,base-4.13.0.0
, andghc-boot-th-8.8.3
that are not on Hackage at all. However, we only get a complaint when depending onCabal
. My hunch is that this slips by becauseCabal
is somehow treated differently than the non-reinstallable boot packages.excludeBootPackages
is where the first part of this filtering occurs. In this case it will exclude from the plan everything inghc-boot-pkgs.ghc883
, which is:This is a strange subset of boot packages.
ghc
andbytestring
are reinstallable boot packages, so it's not clear why they should be excluded; while some wired-in packages likeghc-prim
andtemplate-haskell
are missing.In the case of the
troll
test package,excludeBootPackages
explains why we don't try and fail to downloadbase-4.13.0.0
from Hackage, but what about the others? There's code here that stripsconfig.bootPkgs
from the plan, which comes from here. This gets rid ofrts
andghc-boot-th
, leavingCabal
as the only remaining missing package.The component-driver also has a list of non-reinstallable boot packages, which haskell.nix knows to copy from the global package database. If I set
config.reinstallableLibGhc = false
(so thatCabal
is included inconfig.nonReinstallablePkgs
) and appendconfig.nonReinstallablePkgs
toconfig.bootPkgs
, then I'm successfully able to build thetroll
package.I think the right way for haskell.nix to handle all boot packages is this: always copy all potentially-non-reinstallable boot packages from the global package database. If a plan contains a Hackage reference to a newer version of a reinstallable boot package and we trust that the plan is consistent, then I think it should be fine for those multiple boot package versions to sit in the same package database. Always copying these packages will also fix #481, since we won't care if the Stackage snapshot contains the boot packages anymore.
@angerman @hamishmack curious to hear your thoughts. Is this line of reasoning correct? Are there better ways of addressing this?
The text was updated successfully, but these errors were encountered: