Merge pull request #49605 from mroi/swift-4.2.1

swift: 4.1.3 -> 4.2.1

authored by

Will Dietz and committed by
GitHub
6753b2c6 c246b528

+54 -27
+22 -21
pkgs/development/compilers/swift/default.nix
··· 32 32 , makeWrapper 33 33 , gnumake 34 34 , file 35 - #, systemtap 36 35 }: 37 36 38 37 let 39 - v_base = "4.1.3"; 38 + v_base = "4.2.1"; 40 39 version = "${v_base}-RELEASE"; 41 40 version_friendly = "${v_base}"; 42 41 ··· 54 53 # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 55 54 clang = fetch { 56 55 repo = "swift-clang"; 57 - sha256 = "0j8bi6jv4m4hqiib02q5cvnxd9j6bwiri853x6px86vai3mdff0h"; 56 + sha256 = "0l6w4xzpl3w2nax9a0b885nfzhfj38p2g99158nb5bzfd4s0man7"; 58 57 }; 59 58 llvm = fetch { 60 59 repo = "swift-llvm"; 61 - sha256 = "0q5cv4iydm8c1kcax32573y3q2cbpihwgj5aa8ws1fnpy4jvq934"; 60 + sha256 = "1664zwxbq0a1cmxr9n5a0vw6vdk6ygr7rpglpdsfc7ki857vpsyv"; 62 61 }; 63 62 compilerrt = fetch { 64 63 repo = "swift-compiler-rt"; 65 - sha256 = "1wkymmxi2v759xkwlzfrq9rivndjfvp6ikrzz10mvvrvyvrgwqnl"; 64 + sha256 = "19s6qxn4i0kxpf39xjp2i7zg427iinbmaxqkbb1p91g616y367sf"; 66 65 }; 67 66 cmark = fetch { 68 67 repo = "swift-cmark"; ··· 70 69 }; 71 70 lldb = fetch { 72 71 repo = "swift-lldb"; 73 - sha256 = "1d0pa7xm289bjb6r52hkkmlngkqkwbwgixnmm30bin2q18mkxk7s"; 72 + sha256 = "00kz0xhj1p6ckyandj2gs1yfl29kxv84x9pfph00r8crbkd2jz7b"; 74 73 }; 75 74 llbuild = fetch { 76 75 repo = "swift-llbuild"; 77 - sha256 = "04y0ihfyam2n671vmpk9gy0gb9lb3ivh6mr19862p5kg5bmrcic1"; 76 + sha256 = "1mkkhydshhxr28igbldzr0hhqvb6ql43cpf3ba5vglfkbcz6wh6q"; 78 77 }; 79 78 pm = fetch { 80 79 repo = "swift-package-manager"; 81 - sha256 = "08d87fc29qq7m92jaxkiczsa7b567pwbibiwwkzdrj6a0gr11qn3"; 80 + sha256 = "1aqvmgq9g5zs4k2qnkvw3h3mar66d690hqq6g2dmrapsyb321j9l"; 82 81 }; 83 82 xctest = fetch { 84 83 repo = "swift-corelibs-xctest"; 85 - sha256 = "1alkgxx8jsr2jjv2kchnjaaddb1byjwim015m1z3qxh6lknqm0k5"; 84 + sha256 = "1n4w7bfgy73vjzbvbphlwayy0dw73bbrayrpkqq8lbidg0x9lam8"; 86 85 }; 87 86 foundation = fetch { 88 87 repo = "swift-corelibs-foundation"; 89 - sha256 = "1bhrag63rmz41bg2g6ap01qrdpq37hislgf5hg6myy2v69q7mahx"; 88 + sha256 = "1bfnkj8s3v327cy0czkngz0ryzmz7amjzkkxbsg2zyrhf9a9f0f7"; 90 89 }; 91 90 libdispatch = fetch { 92 91 repo = "swift-corelibs-libdispatch"; 93 - sha256 = "198vskbajch8s168a649qz5an92i2mxmmmzcjlgxlzh38fgxri0n"; 92 + sha256 = "0fibrx54nbaawhsgd7cbr356ji9qvf8y8ahd5bdx28fpj6q0cnwc"; 94 93 fetchSubmodules = true; 95 94 }; 96 95 swift = fetch { 97 96 repo = "swift"; 98 - sha256 = "1ydx11pkvaasgjbr29lnha0lpnak758gd5l0aqzmp3q6mcyvfm7a"; 97 + sha256 = "0y277wi0m6zp1yph9s14mmc65m21q5fm6lgzkn2rkrbaz25fdzak"; 99 98 }; 100 99 }; 101 100 ··· 111 110 ncurses 112 111 sqlite 113 112 swig 114 - # systemtap? 115 113 ]; 116 114 117 115 cmakeFlags = [ ··· 215 213 216 214 substituteInPlace swift/stdlib/public/Platform/CMakeLists.txt \ 217 215 --replace '/usr/include' "${stdenv.cc.libc.dev}/include" 216 + substituteInPlace swift-corelibs-libdispatch/src/CMakeLists.txt \ 217 + --replace '/usr/include' "${stdenv.cc.libc.dev}/include" 218 218 substituteInPlace swift/utils/build-script-impl \ 219 219 --replace '/usr/include/c++' "${clang.cc.gcc}/include/c++" 220 + patch -p1 -d swift -i ${./patches/glibc-arch-headers.patch} 220 221 '' + stdenv.lib.optionalString stdenv.needsPax '' 221 222 patch -p1 -d swift -i ${./patches/build-script-pax.patch} 222 223 '' + '' ··· 228 229 -e 's/^test-installable-package$/# \0/' \ 229 230 -e 's/^test$/# \0/' \ 230 231 -e 's/^validation-test$/# \0/' \ 231 - -e 's/^long-test$/# \0/' 232 + -e 's/^long-test$/# \0/' \ 233 + -e 's/^stress-test$/# \0/' \ 234 + -e 's/^test-optimized$/# \0/' 232 235 233 236 # https://bugs.swift.org/browse/SR-5779 234 237 sed -i -e 's|"-latomic"|"-Wl,-rpath,${clang.cc.gcc.lib}/lib" "-L${clang.cc.gcc.lib}/lib" "-latomic"|' swift/cmake/modules/AddSwift.cmake 235 238 236 239 substituteInPlace clang/lib/Driver/ToolChains/Linux.cpp \ 237 - --replace ' addPathIfExists(D, SysRoot + "/usr/lib", Paths);' \ 238 - ' addPathIfExists(D, SysRoot + "/usr/lib", Paths); addPathIfExists(D, "${glibc}/lib", Paths);' 240 + --replace 'SysRoot + "/usr/lib' '"${glibc}/lib" "' 241 + patch -p1 -d clang -i ${./patches/llvm-include-dirs.patch} 239 242 patch -p1 -d clang -i ${./purity.patch} 240 243 241 244 # Workaround hardcoded dep on "libcurses" (vs "libncurses"): 242 245 sed -i 's,curses,ncurses,' llbuild/*/*/CMakeLists.txt 243 - 244 - # This test fails on one of my machines, not sure why. 245 - # Disabling for now. 246 - rm llbuild/tests/Examples/buildsystem-capi.llbuild 247 246 248 247 PREFIX=''${out/#\/} 248 + substituteInPlace swift-corelibs-foundation/build.py \ 249 + --replace usr/lib "$PREFIX/lib" 249 250 substituteInPlace swift-corelibs-xctest/build_script.py \ 250 251 --replace usr "$PREFIX" 251 252 substituteInPlace swiftpm/Utilities/bootstrap \ ··· 263 264 # Extract the generated tarball into the store 264 265 PREFIX=''${out/#\/} 265 266 tar xf $INSTALLABLE_PACKAGE -C $out --strip-components=3 $PREFIX 267 + find $out -type d -empty -delete 266 268 267 269 paxmark pmr $out/bin/swift 268 270 paxmark pmr $out/bin/* ··· 290 292 broken = stdenv.isAarch64; # 2018-09-04, never built on Hydra 291 293 }; 292 294 } 293 -
+1 -1
pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
··· 11 11 index 7ee57ad2df..e6b0af3581 100644 12 12 --- a/utils/build-presets.ini 13 13 +++ b/utils/build-presets.ini 14 - @@ -686,7 +686,7 @@ swiftpm 14 + @@ -717,7 +717,7 @@ swiftpm 15 15 xctest 16 16 dash-dash 17 17
+1 -1
pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
··· 11 11 index e6b0af3581..1095cbaab7 100644 12 12 --- a/utils/build-presets.ini 13 13 +++ b/utils/build-presets.ini 14 - @@ -708,7 +708,7 @@ install-lldb 14 + @@ -723,7 +723,7 @@ install-lldb 15 15 install-llbuild 16 16 install-swiftpm 17 17 install-xctest
+1 -1
pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
··· 11 11 index 1739e91dc2..0608fed9c1 100644 12 12 --- a/utils/build-presets.ini 13 13 +++ b/utils/build-presets.ini 14 - @@ -708,6 +708,8 @@ install-destdir=%(install_destdir)s 14 + @@ -740,6 +740,8 @@ install-destdir=%(install_destdir)s 15 15 # Path to the .tar.gz package we would create. 16 16 installable-package=%(installable_package)s 17 17
+2 -2
pkgs/development/compilers/swift/patches/build-script-pax.patch
··· 1 1 --- swift/utils/build-script-impl 2017-01-23 12:47:20.401326309 -0600 2 2 +++ swift-pax/utils/build-script-impl 2017-01-23 13:24:10.339366996 -0600 3 - @@ -1823,6 +1823,17 @@ function set_lldb_xcodebuild_options() { 3 + @@ -1837,6 +1837,17 @@ function set_lldb_xcodebuild_options() { 4 4 fi 5 5 } 6 6 ··· 18 18 # 19 19 # Configure and build each product 20 20 # 21 - @@ -2624,6 +2634,12 @@ for host in "${ALL_HOSTS[@]}"; do 21 + @@ -2735,6 +2746,12 @@ for host in "${ALL_HOSTS[@]}"; do 22 22 fi 23 23 24 24 call "${CMAKE_BUILD[@]}" "${build_dir}" $(cmake_config_opt ${product}) -- "${BUILD_ARGS[@]}" ${build_targets[@]}
+13
pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
··· 1 + The Nix glibc headers do not use include/x86_64-linux-gnu subdirectories. 2 + 3 + --- swift/stdlib/public/Platform/CMakeLists.txt 2018-09-30 17:51:51.581766303 +0200 4 + +++ swift/stdlib/public/Platform/CMakeLists.txt 2018-09-30 18:40:04.118956708 +0200 5 + @@ -65,7 +65,7 @@ 6 + endif() 7 + 8 + set(GLIBC_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}") 9 + - set(GLIBC_ARCH_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_ARCH_INCLUDE_PATH}") 10 + + set(GLIBC_ARCH_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}") 11 + 12 + if(NOT "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}" STREQUAL "/") 13 + set(GLIBC_INCLUDE_PATH "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}${GLIBC_INCLUDE_PATH}")
+13
pkgs/development/compilers/swift/patches/llvm-include-dirs.patch
··· 1 + Only use the Nix include dirs when no sysroot is configured. 2 + 3 + --- clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:01:15.731109551 +0200 4 + +++ clang/lib/Driver/ToolChains/Linux.cpp 2018-10-05 18:00:27.959509924 +0200 5 + @@ -565,7 +565,7 @@ 6 + 7 + // Check for configure-time C include directories. 8 + StringRef CIncludeDirs(C_INCLUDE_DIRS); 9 + - if (CIncludeDirs != "") { 10 + + if (CIncludeDirs != "" && (SysRoot.empty() || SysRoot == "/")) { 11 + SmallVector<StringRef, 5> dirs; 12 + CIncludeDirs.split(dirs, ":"); 13 + for (StringRef dir : dirs) {
+1 -1
pkgs/development/compilers/swift/purity.patch
··· 11 11 index fe3c0191bb..c6a482bece 100644 12 12 --- a/lib/Driver/ToolChains/Gnu.cpp 13 13 +++ b/lib/Driver/ToolChains/Gnu.cpp 14 - @@ -494,13 +494,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 14 + @@ -398,13 +398,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 15 15 if (!Args.hasArg(options::OPT_static)) { 16 16 if (Args.hasArg(options::OPT_rdynamic)) 17 17 CmdArgs.push_back("-export-dynamic");