haskell.compiler.ghc924Binary: tag bindists built using hadrian

`ghc ? hadrian` can be used to check if a GHC was built using hadrian.
This is often relevant since hadrian changed the ghc libdir location, so
we need to install libs to a different location as well.
This commit is contained in:
sternenseemann
2023-01-22 13:21:52 +01:00
committed by Florian Brandes
parent df3a033fef
commit e6f2a626c3

View File

@@ -94,6 +94,7 @@ let
{ nixPackage = ncurses6; fileToCheckFor = null; } { nixPackage = ncurses6; fileToCheckFor = null; }
{ nixPackage = libiconv; fileToCheckFor = null; } { nixPackage = libiconv; fileToCheckFor = null; }
]; ];
isHadrian = true;
}; };
aarch64-darwin = { aarch64-darwin = {
variantSuffix = ""; variantSuffix = "";
@@ -107,6 +108,7 @@ let
{ nixPackage = ncurses6; fileToCheckFor = null; } { nixPackage = ncurses6; fileToCheckFor = null; }
{ nixPackage = libiconv; fileToCheckFor = null; } { nixPackage = libiconv; fileToCheckFor = null; }
]; ];
isHadrian = true;
}; };
}; };
# Binary distributions for the musl libc for the respective system. # Binary distributions for the musl libc for the respective system.
@@ -118,6 +120,7 @@ let
sha256 = "026348947d30a156b84de5d6afeaa48fdcb2795b47954cd8341db00d3263a481"; sha256 = "026348947d30a156b84de5d6afeaa48fdcb2795b47954cd8341db00d3263a481";
}; };
isStatic = true; isStatic = true;
isHadrian = true;
# We can't check the RPATH for statically linked executable # We can't check the RPATH for statically linked executable
exePathForLibraryCheck = null; exePathForLibraryCheck = null;
archSpecificLibraries = [ archSpecificLibraries = [
@@ -400,6 +403,13 @@ stdenv.mkDerivation rec {
# Our Cabal compiler name # Our Cabal compiler name
haskellCompilerName = "ghc-${version}"; haskellCompilerName = "ghc-${version}";
} // lib.optionalAttrs (binDistUsed.isHadrian or false) {
# Normal GHC derivations expose the hadrian derivation used to build them
# here. In the case of bindists we just make sure that the attribute exists,
# as it is used for checking if a GHC derivation has been built with hadrian.
# The isHadrian mechanism will become obsolete with GHCs that use hadrian
# exclusively, i.e. 9.6 (and 9.4?).
hadrian = null;
}; };
meta = rec { meta = rec {