3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/ghc
Rebecca Turner 17d63282b2 haskell.compiler: allow overriding source with hadrian
Hadrian (the GHC build tool) is built separately from GHC. This means
that if `haskell.compiler.ghc961` is overridden to add patches, those
patches will _only_ be applied to the GHC portion of the build, and not
the Hadrian build. For example, backporting this patch to GHC 9.6.1
failed because the changes to `hadrian/` files were not reflected in the
Nix build:

5ed77deb1b

By lifting `src` and `hadrian` from variables defined in the function
body to parameters with default values, the `hadrian/` files can be
overridden using the `haskell.compiler.ghc961.override` function. For
example:

   self.haskell.compiler.ghc961.override {
     # The GHC 9.6 builder in nixpkgs first builds hadrian with the
     # source tree provided here and then uses the built hadrian to
     # build the rest of GHC. We need to make sure our patches get
     # included in this `src`, then, rather than modifying the tree in
     # the `patchPhase` or `postPatch` of the outer builder.
     src = self.applyPatches {
       src = let
         version = "9.6.1";
       in
         self.fetchurl {
           url = "https://downloads.haskell.org/ghc/${version}/ghc-${version}-src.tar.xz";
           sha256 = "fe5ac909cb8bb087e235de97fa63aff47a8ae650efaa37a2140f4780e21f34cb";
         };

       patches = [
         # Enable response files for linker if supported
         (self.fetchpatch {
           url = "5ed77deb1b.patch";
           hash = "sha256-dvenK+EPTZJYXnyfKPdkvLp+zeUmsY9YrWpcGCzYStM=";
         })
       ];
     };
   }

Note that we do have to re-declare the `src` we want, but I'm not sure
of a good way to avoid this while also sharing one set of patches
between the GHC and Hadrian builds.
2023-06-08 20:11:52 +02:00
..
8.6.5-binary.nix
8.8.4.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
8.10.2-binary.nix
8.10.7-binary.nix
8.10.7.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.0.2.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.2.4-binary.nix
9.2.4.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.2.5.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.2.6.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.2.7.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.2.8.nix haskell.compiler.ghc928: init at 9.2.8 2023-05-27 17:24:01 +09:00
9.4.2.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.4.3.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.4.4.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.4.5.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
9.6.1.nix
9.6.2.nix haskell.compiler.ghc962: init at 9.6.2 2023-05-30 13:35:14 +02:00
Cabal-3.2-3.4-paths-fix-cycle-aarch64-darwin.patch
Cabal-3.6-paths-fix-cycle-aarch64-darwin.patch
common-hadrian.nix haskell.compiler: allow overriding source with hadrian 2023-06-08 20:11:52 +02:00
gcc-clang-wrapper.sh
ghc-8.8.4-sphinx-6.0.patch
head.nix haskell.compiler.ghcHEAD: 9.7.20230406 -> 9.7.20230505 2023-05-09 18:16:07 +02:00
rename-numa-api-call.patch
respect-ar-path.patch
sphinx-4-configuration.patch