Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkgs/development/compilers/ghc/common-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@
inherit rev;
})

# Patches applied to both GHC and Hadrian.
, patches ? []

# GHC's build system hadrian built from the GHC-to-build's source tree
# using our bootstrap GHC.
, hadrian ? import ../../tools/haskell/hadrian/make-hadrian.nix { inherit bootPkgs lib; } {
ghcSrc = ghcSrc;
ghcVersion = version;
inherit patches;
userSettings = hadrianUserSettings;
# Disable haddock generating pretty source listings to stay under 3GB on aarch64-linux
enableHyperlinkedSource =
Expand Down Expand Up @@ -277,7 +281,7 @@ stdenv.mkDerivation ({
# elimination on aarch64-darwin. (see
# https://github.com/NixOS/nixpkgs/issues/140774 for details).
./Cabal-at-least-3.6-paths-fix-cycle-aarch64-darwin.patch
];
] ++ patches;

postPatch = ''
patchShebangs --build .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/hadrian/src/Settings/Builders/Haddock.hs b/hadrian/src/Settings/Builders/Haddock.hs
index 902b2f85e2..429a441c3b 100644
--- a/src/Settings/Builders/Haddock.hs
+++ b/src/Settings/Builders/Haddock.hs
--- a/hadrian/src/Settings/Builders/Haddock.hs
+++ b/hadrian/src/Settings/Builders/Haddock.hs
@@ -57,7 +57,6 @@ haddockBuilderArgs = mconcat
, arg $ "--odir=" ++ takeDirectory output
, arg $ "--dump-interface=" ++ output
Expand Down
9 changes: 4 additions & 5 deletions pkgs/development/tools/haskell/hadrian/hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# GHC source tree to build hadrian from
, ghcSrc
, ghcVersion
, patches ? []
# Customization
, userSettings ? null
, enableHyperlinkedSource
Expand All @@ -18,15 +19,13 @@ mkDerivation {
pname = "hadrian";
version = ghcVersion;
src = ghcSrc;
postUnpack = ''
sourceRoot="$sourceRoot/hadrian"
'';
patches = lib.optionals (!enableHyperlinkedSource) [
patches = patches ++ lib.optionals (!enableHyperlinkedSource) [
./disable-hyperlinked-source.patch
];
# Overwrite UserSettings.hs with a provided custom one
postPatch = lib.optionalString (userSettings != null) ''
install -m644 "${writeText "UserSettings.hs" userSettings}" src/UserSettings.hs
install -m644 "${writeText "UserSettings.hs" userSettings}" hadrian/src/UserSettings.hs
cd hadrian
'';
configureFlags = [
# avoid QuickCheck dep which needs shared libs / TH
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/tools/haskell/hadrian/make-hadrian.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# These are passed on to the actual package expressions.
ghcSrc
, ghcVersion
, patches
# Contents of a non-default UserSettings.hs to use when building hadrian, if any.
# Should be a string or null.
, userSettings ? null
Expand All @@ -50,7 +51,7 @@ let
in

callPackage' ./hadrian.nix ({
inherit userSettings enableHyperlinkedSource;
inherit userSettings enableHyperlinkedSource patches;
} // lib.optionalAttrs (lib.versionAtLeast ghcVersion "9.9") {
# Starting with GHC 9.9 development, additional in tree packages are required
# to build hadrian. (Hackage-released conditional dependencies are handled
Expand Down