swift: 3.1.1 -> 4.0.3

taku0 c275c3dc e2783b29

+46 -37
+28 -18
pkgs/development/compilers/swift/default.nix
··· 31 , paxctl 32 , findutils 33 , makeWrapper 34 #, systemtap 35 }: 36 37 let 38 - v_major = "3.1.1"; 39 version = "${v_major}-RELEASE"; 40 version_friendly = "${v_major}"; 41 ··· 53 # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 54 clang = fetch { 55 repo = "swift-clang"; 56 - sha256 = "1gmdgr8jph87nya8cgdl7iwrggbji2sag996m27hkbszw4nxy8sd"; 57 }; 58 llvm = fetch { 59 repo = "swift-llvm"; 60 - sha256 = "0nwd7cp6mbj7f6a2rx8123n7ygs8406hsx7hp7ybagww6v75bwzi"; 61 }; 62 compilerrt = fetch { 63 repo = "swift-compiler-rt"; 64 - sha256 = "1gjcr6g3ffs3nhf4a84iwg4flbd7rqcf9rvvclwyq96msa3mj950"; 65 }; 66 cmark = fetch { 67 repo = "swift-cmark"; 68 - sha256 = "0qf2f3zd8lndkfbxbz6vkznzz8rvq5gigijh7pgmfx9fi4zcssqx"; 69 }; 70 lldb = fetch { 71 repo = "swift-lldb"; 72 - sha256 = "17n4whpf3wxw9zaayiq21gk9q3547qxi4rvxld2hybh0k7a1bj5c"; 73 }; 74 llbuild = fetch { 75 repo = "swift-llbuild"; 76 - sha256 = "1l3hnb2s01jby91k1ipbc3bhszq14vyx5pzdhf2chld1yhpg420d"; 77 }; 78 pm = fetch { 79 repo = "swift-package-manager"; 80 - sha256 = "1ayy5vk3mjk354pg9bf68wvnaj3jymx23w0qnlw1jxz256ff8fwi"; 81 }; 82 xctest = fetch { 83 repo = "swift-corelibs-xctest"; 84 - sha256 = "0cj5y7wanllfldag08ci567x12aw793c79afckpbsiaxmwy4xhnm"; 85 }; 86 foundation = fetch { 87 repo = "swift-corelibs-foundation"; 88 - sha256 = "1d1ldk7ckqn4mhmdhsx2zrmsd6jfxzgdywn2pki7limk979hcwjc"; 89 }; 90 libdispatch = fetch { 91 repo = "swift-corelibs-libdispatch"; 92 - sha256 = "0ckjg41fjak06i532azhryckjq64fkxzsal4svf5v4s8n9mkq2sg"; 93 fetchSubmodules = true; 94 }; 95 swift = fetch { 96 repo = "swift"; 97 - sha256 = "0879jlv37lmxc1apzi53xn033y72548i86r7fzwr0g52124q5gry"; 98 }; 99 }; 100 ··· 120 ]; 121 122 builder = '' 123 - NIX_CFLAGS_COMPILE=$( echo ${clang.default_cxx_stdlib_compile} ) 124 125 $SWIFT_SOURCE_ROOT/swift/utils/build-script \ 126 --preset=buildbot_linux \ ··· 163 which 164 findutils 165 makeWrapper 166 ] ++ stdenv.lib.optional stdenv.needsPax paxctl; 167 168 # TODO: Revisit what's propagated and how ··· 216 # Just patch all the things for now, we can focus this later 217 patchShebangs $SWIFT_SOURCE_ROOT 218 219 substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \ 220 --replace '/usr/include' "${stdenv.cc.libc.dev}/include" 221 substituteInPlace swift/utils/build-script-impl \ ··· 231 patch -p1 -i ${./patches/remove_xlocale.patch} 232 # https://bugs.swift.org/browse/SR-4633 233 patch -p1 -d swift -i ${./patches/icu59.patch} 234 235 substituteInPlace clang/lib/Driver/ToolChains.cpp \ 236 --replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \ ··· 239 240 # Workaround hardcoded dep on "libcurses" (vs "libncurses"): 241 sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt 242 - substituteInPlace llbuild/tests/BuildSystem/Build/basic.llbuild \ 243 - --replace /usr/bin/env $(type -p env) 244 245 # This test fails on one of my machines, not sure why. 246 # Disabling for now. 247 rm llbuild/tests/Examples/buildsystem-capi.llbuild 248 - 249 - substituteInPlace swift-corelibs-foundation/lib/script.py \ 250 - --replace /bin/cp $(type -p cp) 251 252 PREFIX=''${out/#\/} 253 substituteInPlace swift-corelibs-xctest/build_script.py \
··· 31 , paxctl 32 , findutils 33 , makeWrapper 34 + , gnumake 35 + , file 36 #, systemtap 37 }: 38 39 let 40 + v_major = "4.0.3"; 41 version = "${v_major}-RELEASE"; 42 version_friendly = "${v_major}"; 43 ··· 55 # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 56 clang = fetch { 57 repo = "swift-clang"; 58 + sha256 = "0zm624iwiprk3c3nzqf4p1fd9zqic4yi3jv51cw3249ax4x6vy10"; 59 }; 60 llvm = fetch { 61 repo = "swift-llvm"; 62 + sha256 = "11vw6461c0cdvwm1wna1a5709fjj14hzp6br6jg94p4f6jp3yv4d"; 63 }; 64 compilerrt = fetch { 65 repo = "swift-compiler-rt"; 66 + sha256 = "1hj4qaj4c9n2wzg2cvarbyl0n708zd1dlw4zkzq07fjxxqs36nfa"; 67 }; 68 cmark = fetch { 69 repo = "swift-cmark"; 70 + sha256 = "1nmxp0fj749sgar682c5nsj7zxxigqwg973baxj2r656a7ybh325"; 71 }; 72 lldb = fetch { 73 repo = "swift-lldb"; 74 + sha256 = "0yk5qg85008vcn63vn2jpn5ls9pdhda222p2w1cfkrj27k5k8vqr"; 75 }; 76 llbuild = fetch { 77 repo = "swift-llbuild"; 78 + sha256 = "0jffw6z1s6ck1i05brw59x6vsg7zrxbz5n2wz72fj29rh3nppc7a"; 79 }; 80 pm = fetch { 81 repo = "swift-package-manager"; 82 + sha256 = "0xj070b8fii7ijfsnyq4fxgv6569vdrg0yippi85h2p1l7s9aagh"; 83 }; 84 xctest = fetch { 85 repo = "swift-corelibs-xctest"; 86 + sha256 = "0l355wq8zfwrpv044xf4smjwbm0bmib360748n8cwls3vkr9l2yv"; 87 }; 88 foundation = fetch { 89 repo = "swift-corelibs-foundation"; 90 + sha256 = "0s7yc5gsbd96a4bs8c6q24dyfjm4xhcr2nzhl2ics8dmi60j15s4"; 91 }; 92 libdispatch = fetch { 93 repo = "swift-corelibs-libdispatch"; 94 + sha256 = "0x8zzq3shhvmhq4sbhaaa0ddiv3nw347pz6ayym6jyzq7j9n15ia"; 95 fetchSubmodules = true; 96 }; 97 swift = fetch { 98 repo = "swift"; 99 + sha256 = "0a1gq0k5701i418f0qi7kywv16q7vh4a4wp0f6fpyv4sjkq27msx"; 100 }; 101 }; 102 ··· 122 ]; 123 124 builder = '' 125 + # gcc-6.4.0/include/c++/6.4.0/cstdlib:75:15: fatal error: 'stdlib.h' file not found 126 + NIX_CFLAGS_COMPILE="$( echo ${clang.default_cxx_stdlib_compile} ) $NIX_CFLAGS_COMPILE" 127 128 $SWIFT_SOURCE_ROOT/swift/utils/build-script \ 129 --preset=buildbot_linux \ ··· 166 which 167 findutils 168 makeWrapper 169 + gnumake 170 ] ++ stdenv.lib.optional stdenv.needsPax paxctl; 171 172 # TODO: Revisit what's propagated and how ··· 220 # Just patch all the things for now, we can focus this later 221 patchShebangs $SWIFT_SOURCE_ROOT 222 223 + # TODO eliminate use of env. 224 + find -type f -print0 | xargs -0 sed -i \ 225 + -e 's|/usr/bin/env|${coreutils}/bin/env|g' \ 226 + -e 's|/usr/bin/make|${gnumake}/bin/make|g' \ 227 + -e 's|/bin/mkdir|${coreutils}/bin/mkdir|g' \ 228 + -e 's|/bin/cp|${coreutils}/bin/cp|g' \ 229 + -e 's|/usr/bin/file|${file}/bin/file|g' 230 + 231 substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \ 232 --replace '/usr/include' "${stdenv.cc.libc.dev}/include" 233 substituteInPlace swift/utils/build-script-impl \ ··· 243 patch -p1 -i ${./patches/remove_xlocale.patch} 244 # https://bugs.swift.org/browse/SR-4633 245 patch -p1 -d swift -i ${./patches/icu59.patch} 246 + 247 + # https://bugs.swift.org/browse/SR-5779 248 + sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake 249 250 substituteInPlace clang/lib/Driver/ToolChains.cpp \ 251 --replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \ ··· 254 255 # Workaround hardcoded dep on "libcurses" (vs "libncurses"): 256 sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt 257 258 # This test fails on one of my machines, not sure why. 259 # Disabling for now. 260 rm llbuild/tests/Examples/buildsystem-capi.llbuild 261 262 PREFIX=''${out/#\/} 263 substituteInPlace swift-corelibs-xctest/build_script.py \
+2 -2
pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
··· 11 index e6b0af3581..1095cbaab7 100644 12 --- a/utils/build-presets.ini 13 +++ b/utils/build-presets.ini 14 - @@ -692,7 +692,7 @@ install-lldb 15 install-llbuild 16 install-swiftpm 17 install-xctest 18 -install-prefix=/usr 19 +install-prefix=%(install_prefix)s 20 - swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license 21 build-swift-static-stdlib 22 build-swift-static-sdk-overlay 23 --
··· 11 index e6b0af3581..1095cbaab7 100644 12 --- a/utils/build-presets.ini 13 +++ b/utils/build-presets.ini 14 + @@ -708,7 +708,7 @@ install-lldb 15 install-llbuild 16 install-swiftpm 17 install-xctest 18 -install-prefix=/usr 19 +install-prefix=%(install_prefix)s 20 + swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc 21 build-swift-static-stdlib 22 build-swift-static-sdk-overlay 23 --
+12
pkgs/development/compilers/swift/patches/icu59.patch
··· 99 if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { 100 swift::crash("u_strToLower: Unexpected error lowercasing unicode string."); 101 }
··· 99 if (U_FAILURE(ErrorCode) && ErrorCode != U_BUFFER_OVERFLOW_ERROR) { 100 swift::crash("u_strToLower: Unexpected error lowercasing unicode string."); 101 } 102 + @@ -300,9 +300,9 @@ 103 + 104 + swift::__swift_stdlib_UBreakIterator *swift::__swift_stdlib_ubrk_open( 105 + swift::__swift_stdlib_UBreakIteratorType type, const char *locale, 106 + - const UChar *text, int32_t textLength, __swift_stdlib_UErrorCode *status) { 107 + + const __swift_stdlib_UChar * text, __swift_int32_t textLength, __swift_stdlib_UErrorCode *status) { 108 + return ptr_cast<swift::__swift_stdlib_UBreakIterator>( 109 + - ubrk_open(static_cast<UBreakIteratorType>(type), locale, text, textLength, 110 + + ubrk_open(static_cast<UBreakIteratorType>(type), locale, reinterpret_cast<const UChar *>(text), textLength, 111 + ptr_cast<UErrorCode>(status))); 112 + } 113 +
+4 -17
pkgs/development/compilers/swift/patches/sigunused.patch
··· 1 - --- a/swift-corelibs-libdispatch/libpwq/src/posix/manager.c 2 - +++ b/swift-corelibs-libdispatch/libpwq/src/posix/manager.c 3 - @@ -273,9 +273,6 @@ static void sigmask_init(void) 4 - sigdelset(&sigmask, SIGFPE); 5 - sigdelset(&sigmask, SIGBUS); 6 - sigdelset(&sigmask, SIGSEGV); 7 - -#if SIGSYS != SIGUNUSED 8 - - sigdelset(&sigmask, SIGSYS); 9 - -#endif 10 - sigdelset(&sigmask, SIGPIPE); 11 - sigdelset(&sigmask, SIGPROF); 12 - 13 - 14 - --- a/swiftpm/Sources/Utility/Process.swift 15 - +++ b/swiftpm/Sources/Utility/Process.swift 16 - @@ -140,7 +140,7 @@ public final class Process: ObjectIdentifierProtocol { 17 // modify, so we have to take care about the set we use. 18 var mostSignals = sigset_t() 19 - sigemptyset(&mostSignals); 20 - for i in 1 ..< SIGUNUSED { 21 + for i in 1 ..< SIGSYS { 22 if i == SIGKILL || i == SIGSTOP {
··· 1 + --- a/swiftpm/Sources/Basic/Process.swift 2 + +++ b/swiftpm/Sources/Basic/Process.swift 3 + @@ -258,7 +258,7 @@ public func launch() throws { 4 // modify, so we have to take care about the set we use. 5 var mostSignals = sigset_t() 6 + sigemptyset(&mostSignals) 7 - for i in 1 ..< SIGUNUSED { 8 + for i in 1 ..< SIGSYS { 9 if i == SIGKILL || i == SIGSTOP {