@@ -856,11 +856,6 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
856856 for a in libraries/*/*.cabal.in utils/*/*.cabal.in compiler/ghc.cabal.in; do
857857 ${ hadrian } /bin/hadrian ${ hadrianArgs } "'' ${a%.*}"
858858 done
859- '' + lib . optionalString ( ghc-version == "9.8.20230704" ) ''
860- for a in bytearray-access-ops.txt.pp addr-access-ops.txt.pp primops.txt; do
861- ${ hadrian } /bin/hadrian ${ hadrianArgs } _build/stage0/compiler/build/$a
862- cp _build/stage0/compiler/build/$a compiler/GHC/Builtin/$a
863- done
864859 '' + lib . optionalString ( stdenv . isDarwin && ( __tryEval libcxxabi ) . success ) ''
865860 substituteInPlace mk/system-cxx-std-lib-1.0.conf \
866861 --replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${ libcxx } /lib ${ libcxxabi } /lib'
@@ -953,6 +948,10 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
953948 export XATTR=$(mktemp -d)/nothing
954949 '' ;
955950} // lib . optionalAttrs useHadrian {
951+ preUnpack = ''
952+ mkdir -p $out/build
953+ cd $out/build
954+ '' ;
956955 postConfigure = lib . optionalString ( stdenv . isDarwin && ( __tryEval libcxxabi ) . success ) ''
957956 substituteInPlace mk/system-cxx-std-lib-1.0.conf \
958957 --replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${ libcxx } /lib ${ libcxxabi } /lib'
@@ -995,7 +994,6 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
995994 installPhase =
996995 if installStage1
997996 then ''
998- mkdir $out
999997 cp -r _build/stage1/bin $out
1000998 # let's assume that if we find a non-prefixed genprimop,
1001999 # we also find a non-prefixed deriveConstants
@@ -1012,6 +1010,8 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
10121010 mkdir $doc
10131011 cp -r _build/stage1/share $doc
10141012 runHook postInstall
1013+ cd $out
1014+ rm -rf $out/build
10151015 ''
10161016 # there appears to be a bug in GHCs configure script not properly passing dllwrap, and windres to the
10171017 # generated settings file. Hence we patch it back in here.
@@ -1042,6 +1042,8 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
10421042 make install
10431043 cd ../../..
10441044 runHook postInstall
1045+ cd $out
1046+ rm -rf $out/build
10451047 '' ;
10461048} ) ) ;
10471049in self
0 commit comments