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