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 haskell.compiler.ghc865Binary: add powerpc64le bootstrap 2022-07-01 13:05:30 +02:00
8.8.4.nix ghc: fix typos 2023-05-08 20:12:24 +04:00
8.10.2-binary.nix haskell.compiler.ghc8102Binary: tag bindists built using hadrian 2023-02-05 14:01:25 +01:00
8.10.7-binary.nix haskell.compiler.ghc8107Binary: tag bindists built using hadrian 2023-02-05 14:01:25 +01:00
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 haskell.compiler.ghc924Binary: tag bindists built using hadrian 2023-02-05 14:01:25 +01:00
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 haskell.compiler.ghc961: init at 9.6.1 2023-03-12 13:16:26 +01:00
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 haskell.compiler.ghc{8107,902}: give cabal-paths.patch a better name 2023-03-11 12:22:48 +01:00
Cabal-3.6-paths-fix-cycle-aarch64-darwin.patch haskell.compiler.ghc9*: work around output cycles on aarch64-darwin 2023-03-11 12:22:48 +01:00
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 haskell.compiler: fix GHCs' user guide build with sphinx >= 6.0 2023-03-03 23:56:30 +01:00
head.nix haskell.compiler.ghcHEAD: 9.7.20230406 -> 9.7.20230505 2023-05-09 18:16:07 +02:00
rename-numa-api-call.patch ghc8.8.4: fix mingw build 2021-09-09 03:35:17 +01:00
respect-ar-path.patch Fix ar command path in GHC. 2021-02-05 22:54:09 +01:00
sphinx-4-configuration.patch haskell.compiler.ghc8104: patch for sphinx >= 4.0 2021-06-22 13:42:55 +02:00