ldc: 1.11.0 -> 1.12.0
Additional various cleanups here and there
This commit is contained in:
parent
c485a491db
commit
3ff636fb2e
@ -2,19 +2,18 @@
|
||||
, python, libconfig, lit, gdb, unzip, darwin, bash
|
||||
, callPackage, makeWrapper, targetPackages
|
||||
, bootstrapVersion ? false
|
||||
, version ? "1.11.0"
|
||||
, ldcSha256 ? "0w4z261gzji31hn1xdnmi9dfkbyydpy6rz8aj4456q5w8yp4yil5"
|
||||
, version ? "1.12.0"
|
||||
, ldcSha256 ? "1fdma1w8j37wkr0pqdar11slkk36qymamxnk6d9k8ybhjmxaaawm"
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
bootstrapLdc = if !bootstrapVersion then
|
||||
# LDC 0.17.x is the last version which doesn't need a working D compiler to
|
||||
# build so we use that version to bootstrap the actual build.
|
||||
callPackage ./default.nix {
|
||||
bootstrapVersion = true;
|
||||
version = "0.17.5";
|
||||
ldcSha256 = "0200r5y8hs5yv2cx24csgyh00dlg18877b9cfblixypr6nhl19bs";
|
||||
version = "0.17.6";
|
||||
ldcSha256 = "0qf5kbxddgmg3kqzi0kf4bgv8vdrnv16y07hcpm0cwv9mc3qr2w6";
|
||||
}
|
||||
else
|
||||
"";
|
||||
@ -31,38 +30,33 @@ let
|
||||
|
||||
postUnpack = ''
|
||||
patchShebangs .
|
||||
|
||||
# Remove cppa test for now because it doesn't work.
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/cppa.d
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/extra-files/cppb.cpp
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (bootstrapVersion) ''
|
||||
# ... runnable/variadic.d ()
|
||||
#Test failed. The logged output:
|
||||
#/tmp/nix-build-ldcBuild-0.17.5.drv-0/ldc-0.17.5-src/build/bin/ldmd2 -conf= -m64 -Irunnable -od/tmp/nix-build-ldcBuild-0.17.5.drv-0/ldc-0.17.5-src/build/dmd-testsuite/runnable -of/tmp/nix-build-ldcBuild-0.17.5.drv-0/ldc-0.17.5-src/build/dmd-testsuite/runnable/variadic_0 runnable/variadic.d
|
||||
#Error: integer constant expression expected instead of <cant>
|
||||
#Error: integer constant expression expected instead of <cant>
|
||||
#Error: integer constant expression expected instead of <cant>
|
||||
#Error: integer constant expression expected instead of <cant>
|
||||
#Error: integer constant expression expected instead of <cant>
|
||||
#runnable/variadic.d(84): Error: template instance variadic.Foo3!(int, int, int) error instantiating
|
||||
#
|
||||
#
|
||||
#==============================
|
||||
#Test failed: expected rc == 0, exited with rc == 1
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/variadic.d
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||
+ stdenv.lib.optionalString (!bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
|
||||
# http://forum.dlang.org/thread/xtbbqthxutdoyhnxjhxl@forum.dlang.org
|
||||
rm -r ldc-${version}-src/tests/dynamiccompile
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/issues/34817
|
||||
rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall
|
||||
'';
|
||||
|
||||
ROOT_HOME_DIR = "$(echo ~root)";
|
||||
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
|
||||
rm -r ldc-${version}-src/tests/debuginfo/classtypes_gdb.d
|
||||
rm -r ldc-${version}-src/tests/debuginfo/nested_gdb.d
|
||||
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/test16096.sh
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ldc_output_filenames.sh
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/crlf.sh
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/issue15574.sh
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/test6461.sh
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||
echo ${tzdata}/share/zoneinfo/ > ldc-${version}-src/TZDatabaseDirFile
|
||||
|
||||
# Remove cppa test for now because it doesn't work.
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/cppa.d
|
||||
rm ldc-${version}-src/tests/d2/dmd-testsuite/runnable/extra-files/cppb.cpp
|
||||
'';
|
||||
|
||||
datetimePath = if bootstrapVersion then
|
||||
"phobos/std/datetime.d"
|
||||
@ -70,58 +64,18 @@ let
|
||||
"phobos/std/datetime/timezone.d";
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace runtime/${datetimePath} \
|
||||
--replace "import core.time;" "import core.time;import std.path;"
|
||||
|
||||
substituteInPlace runtime/${datetimePath} \
|
||||
--replace "tzName == \"leapseconds\"" "baseName(tzName) == \"leapseconds\""
|
||||
|
||||
# https://issues.dlang.org/show_bug.cgi?id=15391
|
||||
substituteInPlace runtime/phobos/std/net/curl.d \
|
||||
--replace libcurl.so ${curl.out}/lib/libcurl.so
|
||||
|
||||
# Ugly hack to fix the hardcoded path to zoneinfo in the source file.
|
||||
# https://issues.dlang.org/show_bug.cgi?id=15391
|
||||
substituteInPlace runtime/${datetimePath} \
|
||||
--replace /usr/share/zoneinfo/ ${tzdata}/share/zoneinfo/
|
||||
|
||||
substituteInPlace tests/d2/dmd-testsuite/Makefile \
|
||||
--replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash"
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
# See https://github.com/NixOS/nixpkgs/issues/29443
|
||||
substituteInPlace runtime/phobos/std/path.d \
|
||||
--replace "\"/root" "\"${ROOT_HOME_DIR}"
|
||||
|
||||
# Can be remove with front end version >= 2.078.0
|
||||
substituteInPlace runtime/druntime/src/core/memory.d \
|
||||
--replace "assert(z is null);" "//assert(z is null);"
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (bootstrapVersion && stdenv.hostPlatform.isDarwin) ''
|
||||
# https://github.com/ldc-developers/ldc/pull/2306
|
||||
# Can be removed on bootstrap version > 0.17.5
|
||||
substituteInPlace gen/programs.cpp \
|
||||
--replace "gcc" "clang"
|
||||
|
||||
# Was not able to compile on darwin due to "__inline_isnanl"
|
||||
# being undefined.
|
||||
substituteInPlace dmd2/root/port.c --replace __inline_isnanl __inline_isnan
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||
# TODO Can be removed with the next ldc version > 1.7.0
|
||||
# https://github.com/ldc-developers/ldc/issues/2493
|
||||
substituteInPlace tests/d2/dmd-testsuite/Makefile \
|
||||
--replace "# disable tests based on arch" "DISABLED_TESTS += test_cdvecfill"
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (bootstrapVersion) ''
|
||||
substituteInPlace runtime/${datetimePath} \
|
||||
--replace "import std.traits;" "import std.traits;import std.path;"
|
||||
|
||||
substituteInPlace runtime/${datetimePath} \
|
||||
--replace "tzName == \"+VERSION\"" "baseName(tzName) == \"leapseconds\" || tzName == \"+VERSION\""
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ cmake makeWrapper llvm bootstrapLdc python lit gdb unzip ]
|
||||
@ -137,17 +91,24 @@ let
|
||||
|
||||
buildInputs = [ curl tzdata ];
|
||||
|
||||
preConfigure = ''
|
||||
cmakeFlagsArray=("-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DCMAKE_SKIP_RPATH=ON"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
"-DLDC_WITH_LLD=OFF"
|
||||
#"-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
|
||||
# Xcode 9.0.1 fixes that bug according to ldc release notes
|
||||
"-DRT_ARCHIVE_WITH_LDC=OFF"
|
||||
)
|
||||
#"-DRT_ARCHIVE_WITH_LDC=OFF"
|
||||
#"-DD_FLAGS=TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/"
|
||||
#"-DCMAKE_BUILD_TYPE=Release"
|
||||
#"-DCMAKE_SKIP_RPATH=ON"
|
||||
|
||||
#-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc
|
||||
#
|
||||
cmakeFlagsString = stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||
"-DD_FLAGS=-d-version=TZDatabaseDir;-J$PWD"
|
||||
'';
|
||||
|
||||
preConfigure = stdenv.lib.optionalString (!bootstrapVersion) ''
|
||||
cmakeFlagsArray=(
|
||||
${cmakeFlagsString}
|
||||
)
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
export DMD=$PWD/bin/ldmd2
|
||||
@ -155,10 +116,7 @@ let
|
||||
|
||||
makeFlags = [ "DMD=$DMD" ];
|
||||
|
||||
# Disable tests on Darwin for now because of
|
||||
# https://github.com/NixOS/nixpkgs/issues/41099
|
||||
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
|
||||
doCheck = !bootstrapVersion && !stdenv.hostPlatform.isDarwin;
|
||||
doCheck = !bootstrapVersion;
|
||||
|
||||
checkPhase = ''
|
||||
# Build and run LDC D unittests.
|
||||
@ -216,13 +174,8 @@ let
|
||||
buildInputs = ldcBuild.buildInputs;
|
||||
|
||||
preConfigure = ''
|
||||
cmakeFlagsArray=( "-DINCLUDE_INSTALL_DIR=$out/include/dlang/ldc"
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
"-DCMAKE_SKIP_RPATH=ON"
|
||||
"-DBUILD_SHARED_LIBS=OFF"
|
||||
"-DLDC_WITH_LLD=OFF"
|
||||
# Xcode 9.0.1 fixes that bug according to ldc release notes
|
||||
"-DRT_ARCHIVE_WITH_LDC=OFF"
|
||||
cmakeFlagsArray=(
|
||||
${ldcBuild.cmakeFlagsString}
|
||||
"-DD_COMPILER=${ldcBuild.out}/bin/ldmd2"
|
||||
)
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user