clean up bootstrap JSON generation#11637
Conversation
The primary entrypoint is now `make bootstrap-jsons`, which is now documented and called out in `bootstrap/README.md`. It automatically tries to obtain ghc versions from first `ghcup`, falls back to Nix if `nix-shell` is found, and if all else fails warns the user to install the appropriate ghcs. The Nix script can still be used directly, but now obtains the list of ghc versions from the `Makefile`.
|
I tested both the ghcup and Nix paths locally. |
I gave the manual QA a run, with Then again with I added some diagnostics, if that helps? $ git diff
diff --git a/Makefile b/Makefile
index cd5d0d20d..74473dfed 100644
--- a/Makefile
+++ b/Makefile
@@ -270,6 +270,9 @@ BOOT_NIX := $(shell nix-shell --version 2>/dev/null)
CABALCONF := $(shell if test -f $$HOME/.config/cabal/config; then echo CABAL_CONFIG=$$HOME/.config/cabal/config; fi)
bootstrap-json-%: phony
+ $(info INFO: ghcup --version is '$(BOOT_GHCUP)')
+ $(info INFO: nix-shell --version is '$(BOOT_NIX)')
+ $(info INFO: cabal config is '$(CABALCONF)') |
|
Here's what I have installed: |
|
The second one is just nobody ever bumping the permitted Temporarily setting your default ghc to 9.10 or earlier will get around it. |
|
General question for cabal devs: maybe the |
Yes that works. |
|
Another general question: various PRs might bump revisions in cabal files, but we only normally regenerate the JSONs before releases. Should PRs perhaps regenerate them as part of CI? And does this suggest that bootstrapping happens so rarely that it's all pretty much a waste of time? |
Yeah, I think it would reduce the friction.
Bootstrapping is used to build |
The primary entrypoint is now
make bootstrap-jsons, which is now documented and called out inbootstrap/README.md. It automatically tries to obtain ghc versions from firstghcup, falls back to Nix ifnix-shellis found, and if all else fails warns the user to install the appropriate ghcs. The Nix script can still be used directly, but now obtains the list of ghc versions from theMakefile.Manual QA:
make bootstrap-jsonswithghcupin$PATHmake bootstrap-jsonswith noghcup(renaming it is fine) but with Nix (this may take several hours due to the existing Nix setup usingghc.nixinstead of nixpkgs)make bootstrap-jsonswith neither, verifying it warns that you need to install each veriioned GHC manuallyTemplate B: This PR does not modify behaviour or interface
E.g. the PR only touches documentation or tests, does refactorings, etc.
Include the following checklist in your PR:
Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).