swift: 3.1.1 -> 4.0.3
This commit is contained in:
parent
e2783b299c
commit
c275c3dc30
@ -31,11 +31,13 @@
|
|||||||
, paxctl
|
, paxctl
|
||||||
, findutils
|
, findutils
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
|
, gnumake
|
||||||
|
, file
|
||||||
#, systemtap
|
#, systemtap
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
v_major = "3.1.1";
|
v_major = "4.0.3";
|
||||||
version = "${v_major}-RELEASE";
|
version = "${v_major}-RELEASE";
|
||||||
version_friendly = "${v_major}";
|
version_friendly = "${v_major}";
|
||||||
|
|
||||||
@ -53,48 +55,48 @@ let
|
|||||||
# For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759
|
# For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759
|
||||||
clang = fetch {
|
clang = fetch {
|
||||||
repo = "swift-clang";
|
repo = "swift-clang";
|
||||||
sha256 = "1gmdgr8jph87nya8cgdl7iwrggbji2sag996m27hkbszw4nxy8sd";
|
sha256 = "0zm624iwiprk3c3nzqf4p1fd9zqic4yi3jv51cw3249ax4x6vy10";
|
||||||
};
|
};
|
||||||
llvm = fetch {
|
llvm = fetch {
|
||||||
repo = "swift-llvm";
|
repo = "swift-llvm";
|
||||||
sha256 = "0nwd7cp6mbj7f6a2rx8123n7ygs8406hsx7hp7ybagww6v75bwzi";
|
sha256 = "11vw6461c0cdvwm1wna1a5709fjj14hzp6br6jg94p4f6jp3yv4d";
|
||||||
};
|
};
|
||||||
compilerrt = fetch {
|
compilerrt = fetch {
|
||||||
repo = "swift-compiler-rt";
|
repo = "swift-compiler-rt";
|
||||||
sha256 = "1gjcr6g3ffs3nhf4a84iwg4flbd7rqcf9rvvclwyq96msa3mj950";
|
sha256 = "1hj4qaj4c9n2wzg2cvarbyl0n708zd1dlw4zkzq07fjxxqs36nfa";
|
||||||
};
|
};
|
||||||
cmark = fetch {
|
cmark = fetch {
|
||||||
repo = "swift-cmark";
|
repo = "swift-cmark";
|
||||||
sha256 = "0qf2f3zd8lndkfbxbz6vkznzz8rvq5gigijh7pgmfx9fi4zcssqx";
|
sha256 = "1nmxp0fj749sgar682c5nsj7zxxigqwg973baxj2r656a7ybh325";
|
||||||
};
|
};
|
||||||
lldb = fetch {
|
lldb = fetch {
|
||||||
repo = "swift-lldb";
|
repo = "swift-lldb";
|
||||||
sha256 = "17n4whpf3wxw9zaayiq21gk9q3547qxi4rvxld2hybh0k7a1bj5c";
|
sha256 = "0yk5qg85008vcn63vn2jpn5ls9pdhda222p2w1cfkrj27k5k8vqr";
|
||||||
};
|
};
|
||||||
llbuild = fetch {
|
llbuild = fetch {
|
||||||
repo = "swift-llbuild";
|
repo = "swift-llbuild";
|
||||||
sha256 = "1l3hnb2s01jby91k1ipbc3bhszq14vyx5pzdhf2chld1yhpg420d";
|
sha256 = "0jffw6z1s6ck1i05brw59x6vsg7zrxbz5n2wz72fj29rh3nppc7a";
|
||||||
};
|
};
|
||||||
pm = fetch {
|
pm = fetch {
|
||||||
repo = "swift-package-manager";
|
repo = "swift-package-manager";
|
||||||
sha256 = "1ayy5vk3mjk354pg9bf68wvnaj3jymx23w0qnlw1jxz256ff8fwi";
|
sha256 = "0xj070b8fii7ijfsnyq4fxgv6569vdrg0yippi85h2p1l7s9aagh";
|
||||||
};
|
};
|
||||||
xctest = fetch {
|
xctest = fetch {
|
||||||
repo = "swift-corelibs-xctest";
|
repo = "swift-corelibs-xctest";
|
||||||
sha256 = "0cj5y7wanllfldag08ci567x12aw793c79afckpbsiaxmwy4xhnm";
|
sha256 = "0l355wq8zfwrpv044xf4smjwbm0bmib360748n8cwls3vkr9l2yv";
|
||||||
};
|
};
|
||||||
foundation = fetch {
|
foundation = fetch {
|
||||||
repo = "swift-corelibs-foundation";
|
repo = "swift-corelibs-foundation";
|
||||||
sha256 = "1d1ldk7ckqn4mhmdhsx2zrmsd6jfxzgdywn2pki7limk979hcwjc";
|
sha256 = "0s7yc5gsbd96a4bs8c6q24dyfjm4xhcr2nzhl2ics8dmi60j15s4";
|
||||||
};
|
};
|
||||||
libdispatch = fetch {
|
libdispatch = fetch {
|
||||||
repo = "swift-corelibs-libdispatch";
|
repo = "swift-corelibs-libdispatch";
|
||||||
sha256 = "0ckjg41fjak06i532azhryckjq64fkxzsal4svf5v4s8n9mkq2sg";
|
sha256 = "0x8zzq3shhvmhq4sbhaaa0ddiv3nw347pz6ayym6jyzq7j9n15ia";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
swift = fetch {
|
swift = fetch {
|
||||||
repo = "swift";
|
repo = "swift";
|
||||||
sha256 = "0879jlv37lmxc1apzi53xn033y72548i86r7fzwr0g52124q5gry";
|
sha256 = "0a1gq0k5701i418f0qi7kywv16q7vh4a4wp0f6fpyv4sjkq27msx";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -120,7 +122,8 @@ let
|
|||||||
];
|
];
|
||||||
|
|
||||||
builder = ''
|
builder = ''
|
||||||
NIX_CFLAGS_COMPILE=$( echo ${clang.default_cxx_stdlib_compile} )
|
# gcc-6.4.0/include/c++/6.4.0/cstdlib:75:15: fatal error: 'stdlib.h' file not found
|
||||||
|
NIX_CFLAGS_COMPILE="$( echo ${clang.default_cxx_stdlib_compile} ) $NIX_CFLAGS_COMPILE"
|
||||||
|
|
||||||
$SWIFT_SOURCE_ROOT/swift/utils/build-script \
|
$SWIFT_SOURCE_ROOT/swift/utils/build-script \
|
||||||
--preset=buildbot_linux \
|
--preset=buildbot_linux \
|
||||||
@ -163,6 +166,7 @@ stdenv.mkDerivation rec {
|
|||||||
which
|
which
|
||||||
findutils
|
findutils
|
||||||
makeWrapper
|
makeWrapper
|
||||||
|
gnumake
|
||||||
] ++ stdenv.lib.optional stdenv.needsPax paxctl;
|
] ++ stdenv.lib.optional stdenv.needsPax paxctl;
|
||||||
|
|
||||||
# TODO: Revisit what's propagated and how
|
# TODO: Revisit what's propagated and how
|
||||||
@ -216,6 +220,14 @@ stdenv.mkDerivation rec {
|
|||||||
# Just patch all the things for now, we can focus this later
|
# Just patch all the things for now, we can focus this later
|
||||||
patchShebangs $SWIFT_SOURCE_ROOT
|
patchShebangs $SWIFT_SOURCE_ROOT
|
||||||
|
|
||||||
|
# TODO eliminate use of env.
|
||||||
|
find -type f -print0 | xargs -0 sed -i \
|
||||||
|
-e 's|/usr/bin/env|${coreutils}/bin/env|g' \
|
||||||
|
-e 's|/usr/bin/make|${gnumake}/bin/make|g' \
|
||||||
|
-e 's|/bin/mkdir|${coreutils}/bin/mkdir|g' \
|
||||||
|
-e 's|/bin/cp|${coreutils}/bin/cp|g' \
|
||||||
|
-e 's|/usr/bin/file|${file}/bin/file|g'
|
||||||
|
|
||||||
substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \
|
substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \
|
||||||
--replace '/usr/include' "${stdenv.cc.libc.dev}/include"
|
--replace '/usr/include' "${stdenv.cc.libc.dev}/include"
|
||||||
substituteInPlace swift/utils/build-script-impl \
|
substituteInPlace swift/utils/build-script-impl \
|
||||||
@ -232,6 +244,9 @@ stdenv.mkDerivation rec {
|
|||||||
# https://bugs.swift.org/browse/SR-4633
|
# https://bugs.swift.org/browse/SR-4633
|
||||||
patch -p1 -d swift -i ${./patches/icu59.patch}
|
patch -p1 -d swift -i ${./patches/icu59.patch}
|
||||||
|
|
||||||
|
# https://bugs.swift.org/browse/SR-5779
|
||||||
|
sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake
|
||||||
|
|
||||||
substituteInPlace clang/lib/Driver/ToolChains.cpp \
|
substituteInPlace clang/lib/Driver/ToolChains.cpp \
|
||||||
--replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \
|
--replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \
|
||||||
' addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);'
|
' addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);'
|
||||||
@ -239,16 +254,11 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
# Workaround hardcoded dep on "libcurses" (vs "libncurses"):
|
# Workaround hardcoded dep on "libcurses" (vs "libncurses"):
|
||||||
sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt
|
sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt
|
||||||
substituteInPlace llbuild/tests/BuildSystem/Build/basic.llbuild \
|
|
||||||
--replace /usr/bin/env $(type -p env)
|
|
||||||
|
|
||||||
# This test fails on one of my machines, not sure why.
|
# This test fails on one of my machines, not sure why.
|
||||||
# Disabling for now.
|
# Disabling for now.
|
||||||
rm llbuild/tests/Examples/buildsystem-capi.llbuild
|
rm llbuild/tests/Examples/buildsystem-capi.llbuild
|
||||||
|
|
||||||
substituteInPlace swift-corelibs-foundation/lib/script.py \
|
|
||||||
--replace /bin/cp $(type -p cp)
|
|
||||||
|
|
||||||
PREFIX=''${out/#\/}
|
PREFIX=''${out/#\/}
|
||||||
substituteInPlace swift-corelibs-xctest/build_script.py \
|
substituteInPlace swift-corelibs-xctest/build_script.py \
|
||||||
--replace usr "$PREFIX"
|
--replace usr "$PREFIX"
|
||||||
|
@ -11,13 +11,13 @@ diff --git a/utils/build-presets.ini b/utils/build-presets.ini
|
|||||||
index e6b0af3581..1095cbaab7 100644
|
index e6b0af3581..1095cbaab7 100644
|
||||||
--- a/utils/build-presets.ini
|
--- a/utils/build-presets.ini
|
||||||
+++ b/utils/build-presets.ini
|
+++ b/utils/build-presets.ini
|
||||||
@@ -692,7 +692,7 @@ install-lldb
|
@@ -708,7 +708,7 @@ install-lldb
|
||||||
install-llbuild
|
install-llbuild
|
||||||
install-swiftpm
|
install-swiftpm
|
||||||
install-xctest
|
install-xctest
|
||||||
-install-prefix=/usr
|
-install-prefix=/usr
|
||||||
+install-prefix=%(install_prefix)s
|
+install-prefix=%(install_prefix)s
|
||||||
swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license
|
swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc
|
||||||
build-swift-static-stdlib
|
build-swift-static-stdlib
|
||||||
build-swift-static-sdk-overlay
|
build-swift-static-sdk-overlay
|
||||||
--
|
--
|
||||||
|
@ -99,3 +99,15 @@
|
|||||||
if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) {
|
if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) {
|
||||||
swift::crash("u_strToLower: Unexpected error lowercasing unicode string.");
|
swift::crash("u_strToLower: Unexpected error lowercasing unicode string.");
|
||||||
}
|
}
|
||||||
|
@@ -300,9 +300,9 @@
|
||||||
|
|
||||||
|
swift::__swift_stdlib_UBreakIterator *swift::__swift_stdlib_ubrk_open(
|
||||||
|
swift::__swift_stdlib_UBreakIteratorType type, const char *locale,
|
||||||
|
- const UChar *text, int32_t textLength, __swift_stdlib_UErrorCode *status) {
|
||||||
|
+ const __swift_stdlib_UChar * text, __swift_int32_t textLength, __swift_stdlib_UErrorCode *status) {
|
||||||
|
return ptr_cast<swift::__swift_stdlib_UBreakIterator>(
|
||||||
|
- ubrk_open(static_cast<UBreakIteratorType>(type), locale, text, textLength,
|
||||||
|
+ ubrk_open(static_cast<UBreakIteratorType>(type), locale, reinterpret_cast<const UChar *>(text), textLength,
|
||||||
|
ptr_cast<UErrorCode>(status)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -1,22 +1,9 @@
|
|||||||
--- a/swift-corelibs-libdispatch/libpwq/src/posix/manager.c
|
--- a/swiftpm/Sources/Basic/Process.swift
|
||||||
+++ b/swift-corelibs-libdispatch/libpwq/src/posix/manager.c
|
+++ b/swiftpm/Sources/Basic/Process.swift
|
||||||
@@ -273,9 +273,6 @@ static void sigmask_init(void)
|
@@ -258,7 +258,7 @@ public func launch() throws {
|
||||||
sigdelset(&sigmask, SIGFPE);
|
|
||||||
sigdelset(&sigmask, SIGBUS);
|
|
||||||
sigdelset(&sigmask, SIGSEGV);
|
|
||||||
-#if SIGSYS != SIGUNUSED
|
|
||||||
- sigdelset(&sigmask, SIGSYS);
|
|
||||||
-#endif
|
|
||||||
sigdelset(&sigmask, SIGPIPE);
|
|
||||||
sigdelset(&sigmask, SIGPROF);
|
|
||||||
|
|
||||||
|
|
||||||
--- a/swiftpm/Sources/Utility/Process.swift
|
|
||||||
+++ b/swiftpm/Sources/Utility/Process.swift
|
|
||||||
@@ -140,7 +140,7 @@ public final class Process: ObjectIdentifierProtocol {
|
|
||||||
// modify, so we have to take care about the set we use.
|
// modify, so we have to take care about the set we use.
|
||||||
var mostSignals = sigset_t()
|
var mostSignals = sigset_t()
|
||||||
sigemptyset(&mostSignals);
|
sigemptyset(&mostSignals)
|
||||||
- for i in 1 ..< SIGUNUSED {
|
- for i in 1 ..< SIGUNUSED {
|
||||||
+ for i in 1 ..< SIGSYS {
|
+ for i in 1 ..< SIGSYS {
|
||||||
if i == SIGKILL || i == SIGSTOP {
|
if i == SIGKILL || i == SIGSTOP {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user