Merge pull request #52964 from ThomasMader/dlang-update
Dlang update 2018-12
This commit is contained in:
commit
6056319934
5 changed files with 69 additions and 111 deletions
|
@ -2,10 +2,10 @@
|
|||
, makeWrapper, unzip, which
|
||||
, curl, tzdata, gdb, darwin
|
||||
, callPackage, targetPackages, ldc
|
||||
, version ? "2.081.2"
|
||||
, dmdSha256 ? "1wwk4shqldvgyczv1ihmljpfj3yidq7mxcj69i9kjl7jqx54hw62"
|
||||
, druntimeSha256 ? "0dqfsy34q2q7mk2gsi4ix3vgqg7szg3m067fghgx53vnvrzlpsc0"
|
||||
, phobosSha256 ? "1dan59lc4wggsrv5aax7jsxnzg7fz37xah84k1cbwjb3xxhhkd9n"
|
||||
, version ? "2.083.1"
|
||||
, dmdSha256 ? "0b52yq7slgbrawb22kib9bk2x9xjiy6axwz1317fck5axl093d90"
|
||||
, druntimeSha256 ? "1hm9p59ih21yv8x7cqjhkyy94677q4f8wk9fs9i1rybx8x19njyn"
|
||||
, phobosSha256 ? "1zmz0f1wj0dgxy2cy63ljjc1sl2sgb7ij8bamlxw9nxrchwi3l43"
|
||||
}:
|
||||
|
||||
let
|
||||
|
@ -48,12 +48,15 @@ let
|
|||
# Remove cppa test for now because it doesn't work.
|
||||
rm dmd/test/runnable/cppa.d
|
||||
rm dmd/test/runnable/extra-files/cppb.cpp
|
||||
''
|
||||
|
||||
+ stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin) ''
|
||||
rm dmd/test/runnable/test16096.sh
|
||||
'';
|
||||
|
||||
# Compile with PIC to prevent colliding modules with binutils 2.28.
|
||||
# https://issues.dlang.org/show_bug.cgi?id=17375
|
||||
usePIC = "-fPIC";
|
||||
ROOT_HOME_DIR = "$(echo ~root)";
|
||||
|
||||
phobosPatches = ''
|
||||
# Ugly hack so the dlopen call has a chance to succeed.
|
||||
|
@ -105,13 +108,14 @@ let
|
|||
cd ../druntime
|
||||
make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd}
|
||||
cd ../phobos
|
||||
make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
|
||||
echo ${tzdata}/share/zoneinfo/ > TZDatabaseDirFile
|
||||
make -j$NIX_BUILD_CORES -f posix.mak BUILD=release ENABLE_RELEASE=1 PIC=1 INSTALL_DIR=$out DMD=${pathToDmd} DFLAGS="-version=TZDatabaseDir -J$(pwd)"
|
||||
cd ..
|
||||
'';
|
||||
|
||||
# Disable tests on Darwin for now because of
|
||||
# https://github.com/NixOS/nixpkgs/issues/41099
|
||||
doCheck = !stdenv.hostPlatform.isDarwin;
|
||||
doCheck = true;
|
||||
|
||||
checkPhase = ''
|
||||
cd dmd
|
||||
|
@ -197,7 +201,8 @@ let
|
|||
|
||||
buildPhase = ''
|
||||
cd phobos
|
||||
make -j$NIX_BUILD_CORES -f posix.mak unittest BUILD=release ENABLE_RELEASE=1 PIC=1 DMD=${dmdBuild}/bin/dmd TZ_DATABASE_DIR=${tzdata}/share/zoneinfo/
|
||||
echo ${tzdata}/share/zoneinfo/ > TZDatabaseDirFile
|
||||
make -j$NIX_BUILD_CORES -f posix.mak unittest BUILD=release ENABLE_RELEASE=1 PIC=1 DMD=${dmdBuild}/bin/dmd DFLAGS="-version=TZDatabaseDir -J$(pwd)"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
|
|
@ -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,97 +30,52 @@ let
|
|||
|
||||
postUnpack = ''
|
||||
patchShebangs .
|
||||
''
|
||||
|
||||
+ 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
|
||||
|
||||
# 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
|
||||
''
|
||||
|
||||
+ 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) ''
|
||||
# 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)";
|
||||
|
||||
datetimePath = if bootstrapVersion then
|
||||
"phobos/std/datetime.d"
|
||||
else
|
||||
"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"
|
||||
# Xcode 9.0.1 fixes that bug according to ldc release notes
|
||||
"-DRT_ARCHIVE_WITH_LDC=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"
|
||||
#"-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,15 +174,10 @@ 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"
|
||||
"-DD_COMPILER=${ldcBuild.out}/bin/ldmd2"
|
||||
)
|
||||
cmakeFlagsArray=(
|
||||
${ldcBuild.cmakeFlagsString}
|
||||
"-DD_COMPILER=${ldcBuild.out}/bin/ldmd2"
|
||||
)
|
||||
'';
|
||||
|
||||
postConfigure = ldcBuild.postConfigure;
|
||||
|
|
|
@ -4,7 +4,7 @@ let
|
|||
|
||||
dubBuild = stdenv.mkDerivation rec {
|
||||
name = "dubBuild-${version}";
|
||||
version = "1.10.0";
|
||||
version = "1.12.1";
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
|
@ -12,7 +12,7 @@ let
|
|||
owner = "dlang";
|
||||
repo = "dub";
|
||||
rev = "v${version}";
|
||||
sha256 = "02xxpfcjs427jqbwz0vh5vl3bh62ys65zmi9gpa3svzqffyx13n4";
|
||||
sha256 = "0q4968vxgfxhq6ywhdvj6sqddwf7aadqmmpfqc6nl65r7jyga52a";
|
||||
};
|
||||
|
||||
postUnpack = ''
|
||||
|
|
|
@ -2,21 +2,21 @@
|
|||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "dtools-${version}";
|
||||
version = "2.081.2";
|
||||
version = "2.083.1";
|
||||
|
||||
srcs = [
|
||||
(fetchFromGitHub {
|
||||
owner = "dlang";
|
||||
repo = "dmd";
|
||||
rev = "v${version}";
|
||||
sha256 = "1wwk4shqldvgyczv1ihmljpfj3yidq7mxcj69i9kjl7jqx54hw62";
|
||||
sha256 = "0b52yq7slgbrawb22kib9bk2x9xjiy6axwz1317fck5axl093d90";
|
||||
name = "dmd";
|
||||
})
|
||||
(fetchFromGitHub {
|
||||
owner = "dlang";
|
||||
repo = "tools";
|
||||
rev = "v${version}";
|
||||
sha256 = "1sbcfj8r1nvy7ynh9dy55q9bvfvxwf1z3llpxckvi8p6yvf35qn2";
|
||||
sha256 = "0z3xkv9s1pdx8zdhsb92mwax2q5xhwjgh6g3iv53xip1nsxygn48";
|
||||
name = "dtools";
|
||||
})
|
||||
];
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{ stdenv, fetchgit, dmd, dub }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "Literate-2018-08-20";
|
||||
name = "Literate-2018-12-23";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://github.com/zyedidia/Literate.git";
|
||||
rev = "737567e49c9e12ac56222c147191da58ea1521e2";
|
||||
sha256 = "19v8v66lv8ayg3irqkbk7ln5lkmgwpx4wgz8h3yr81arl40bbzqs";
|
||||
rev = "99a0b7dd1ac451c2386094be06364df9386c3862";
|
||||
sha256 = "0jvciajr33iz049m0yal41mz9p8nxmwkpq2mrfhg1ysx2zv3q3pm";
|
||||
};
|
||||
|
||||
buildInputs = [ dmd dub ];
|
||||
|
|
Loading…
Reference in a new issue