Remove top-level ldcBootstrap

This commit is contained in:
Lionello Lunesu 2020-04-19 20:52:41 +08:00
parent 4c538d022d
commit 0b23e4e5b7
2 changed files with 26 additions and 48 deletions

View File

@ -1,10 +1,8 @@
{ bootstrapVersion ? false { version, ldcSha256 }:
, version
, ldcSha256
}:
{ stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata { stdenv, fetchurl, cmake, ninja, llvm_5, llvm_8, curl, tzdata
, libconfig, lit, gdb, unzip, darwin, bash, ldcBootstrap , libconfig, lit, gdb, unzip, darwin, bash
, callPackage, makeWrapper, runCommand, targetPackages , callPackage, makeWrapper, runCommand, targetPackages
, ldcBootstrap ? callPackage ./bootstrap.nix { }
}: }:
let let
@ -14,8 +12,6 @@ let
echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile
''; '';
bootstrapLdc = if bootstrapVersion then null else ldcBootstrap;
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -35,8 +31,7 @@ stdenv.mkDerivation rec {
postUnpack = '' postUnpack = ''
patchShebangs . patchShebangs .
'' ''
+ ''
+ stdenv.lib.optionalString (!bootstrapVersion) ''
rm ldc-${version}-src/tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d rm ldc-${version}-src/tests/d2/dmd-testsuite/fail_compilation/mixin_gc.d
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/xtest46_gc.d rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/xtest46_gc.d
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/testptrref_gc.d
@ -44,8 +39,7 @@ stdenv.mkDerivation rec {
# test depends on current year # test depends on current year
rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ddocYear.d rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ddocYear.d
'' ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
# https://github.com/NixOS/nixpkgs/issues/34817 # https://github.com/NixOS/nixpkgs/issues/34817
rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall
''; '';
@ -54,44 +48,31 @@ stdenv.mkDerivation rec {
# Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow # Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow
substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash" substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash"
'' ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isLinux) ''
substituteInPlace runtime/phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" "" substituteInPlace runtime/phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
'' ''
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
substituteInPlace runtime/phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)" substituteInPlace runtime/phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)"
''
+ stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
# Was not able to compile on darwin due to "__inline_isnanl"
# being undefined.
# TODO Remove with version > 0.17.6
substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan
''; '';
nativeBuildInputs = [ cmake ninja makeWrapper unzip ] nativeBuildInputs = [
++ stdenv.lib.optionals (!bootstrapVersion) [ cmake ninja makeWrapper unzip ldcBootstrap lit lit.python
bootstrapLdc lit lit.python
] ]
++ stdenv.lib.optional (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Foundation
# https://github.com/NixOS/nixpkgs/issues/57120 # https://github.com/NixOS/nixpkgs/issues/57120
# https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515 # https://github.com/NixOS/nixpkgs/pull/59197#issuecomment-481972515
llvm_5 llvm_5
++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin) ]
++ stdenv.lib.optionals (!stdenv.hostPlatform.isDarwin) [
llvm_8 llvm_8
++ stdenv.lib.optional (!bootstrapVersion && !stdenv.hostPlatform.isDarwin)
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818 # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
gdb gdb
++ stdenv.lib.optionals (bootstrapVersion) [ ];
libconfig llvm_5
]
++ stdenv.lib.optional stdenv.hostPlatform.isDarwin
darwin.apple_sdk.frameworks.Foundation;
buildInputs = [ curl tzdata ]; buildInputs = [ curl tzdata ];
cmakeFlags = stdenv.lib.optionals (!bootstrapVersion) [ cmakeFlags = [
"-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}" "-DD_FLAGS=-d-version=TZDatabaseDir;-d-version=LibcurlPath;-J${pathConfig}"
"-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_BUILD_TYPE=Release"
]; ];
@ -125,9 +106,7 @@ stdenv.mkDerivation rec {
additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
"|druntime-test-shared"; "|druntime-test-shared";
doCheck = !bootstrapVersion; checkPhase = ''
checkPhase = stdenv.lib.optionalString doCheck ''
# Build default lib test runners # Build default lib test runners
ninja -j$NIX_BUILD_CORES all-test-runners ninja -j$NIX_BUILD_CORES all-test-runners

View File

@ -4554,7 +4554,6 @@ in
lalezar-fonts = callPackage ../data/fonts/lalezar-fonts { }; lalezar-fonts = callPackage ../data/fonts/lalezar-fonts { };
ldcBootstrap = callPackage ../development/compilers/ldc/bootstrap.nix { };
ldc = callPackage ../development/compilers/ldc { }; ldc = callPackage ../development/compilers/ldc { };
lbreakout2 = callPackage ../games/lbreakout2 { }; lbreakout2 = callPackage ../games/lbreakout2 { };