|
220 | 220 |
|
221 | 221 | useHadrian = builtins.compareVersions ghc-version "9.4" >= 0; |
222 | 222 | # Indicates if we are installing by copying the hadrian stage1 output |
223 | | - installStage1 = useHadrian && (haskell-nix.haskellLib.isCrossTarget || targetPlatform.isMusl); |
| 223 | + # I think we want to _always_ just install stage1. For now let's do this |
| 224 | + # for musl only; but I'd like to stay far away from the unnecessary |
| 225 | + # bindist logic as we can. It's slow, and buggy, and doesn't provide any |
| 226 | + # value for us. |
| 227 | + installStage1 = useHadrian && (haskell-nix.haskellLib.isCrossTarget || stdenv.targetPlatform.isMusl); |
224 | 228 |
|
225 | 229 | inherit ((buildPackages.haskell-nix.cabalProject { |
226 | 230 | compiler-nix-name = "ghc8107"; |
@@ -586,6 +590,10 @@ stdenv.mkDerivation (rec { |
586 | 590 | --replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib' |
587 | 591 | find . -name 'system*.conf*' |
588 | 592 | cat mk/system-cxx-std-lib-1.0.conf |
| 593 | + '' + lib.optionalString (installStage1 && stdenv.targetPlatform.isMusl) '' |
| 594 | + substituteInPlace hadrian/cfg/system.config \ |
| 595 | + --replace 'cross-compiling = YES' \ |
| 596 | + 'cross-compiling = NO' |
589 | 597 | ''; |
590 | 598 | }); |
591 | 599 |
|
@@ -651,13 +659,24 @@ stdenv.mkDerivation (rec { |
651 | 659 | --replace 'dynamic-library-dirs:' 'dynamic-library-dirs: ${libcxx}/lib ${libcxxabi}/lib' |
652 | 660 | find . -name 'system*.conf*' |
653 | 661 | cat mk/system-cxx-std-lib-1.0.conf |
| 662 | + '' + lib.optionalString (installStage1 && stdenv.targetPlatform.isMusl) '' |
| 663 | + substituteInPlace hadrian/cfg/system.config \ |
| 664 | + --replace 'cross-compiling = YES' \ |
| 665 | + 'cross-compiling = NO' |
654 | 666 | ''; |
655 | 667 | buildPhase = '' |
656 | 668 | ${hadrian}/bin/hadrian ${hadrianArgs} |
657 | 669 | '' + lib.optionalString installStage1 '' |
658 | 670 | ${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:libiserv |
659 | 671 | '' + lib.optionalString targetPlatform.isMusl '' |
660 | 672 | ${hadrian}/bin/hadrian ${hadrianArgs} stage1:lib:terminfo |
| 673 | + '' + lib.optionalString (installStage1 && !haskell-nix.haskellLib.isCrossTarget) '' |
| 674 | + ${hadrian}/bin/hadrian ${hadrianArgs} stage2:exe:iserv |
| 675 | + pushd _build/stage1/bin |
| 676 | + for exe in *; do |
| 677 | + mv $exe ${targetPrefix}$exe |
| 678 | + done |
| 679 | + popd |
661 | 680 | ''; |
662 | 681 |
|
663 | 682 | # Hadrian's installation only works for native compilers, and is broken for cross compilers. |
|
0 commit comments