Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

swift: 5.0.2 -> 5.1.1

+53 -44
+43 -19
pkgs/development/compilers/swift/default.nix
··· 33 33 }: 34 34 35 35 let 36 - version = "5.0.2"; 36 + version = "5.1.1"; 37 37 38 38 fetch = { repo, sha256, fetchSubmodules ? false }: 39 39 fetchFromGitHub { ··· 44 44 }; 45 45 46 46 sources = { 47 - # FYI: SourceKit probably would work but currently requires building everything twice 48 - # For more inforation, see: https://github.com/apple/swift/pull/3594#issuecomment-234169759 49 47 llvm = fetch { 50 48 repo = "swift-llvm"; 51 - sha256 = "1bnscqsiljiclij60f44h2fyx5c84pzry0lz1jbwknphwmqd6f84"; 49 + sha256 = "00ldd9dby6fl6nk3z17148fvb7g9x4jkn1afx26y51v8rwgm1i7f"; 52 50 }; 53 51 compilerrt = fetch { 54 52 repo = "swift-compiler-rt"; 55 - sha256 = "0bba54xa7z0wj6k7a24q74gc4yajc6s64g1m894i3yd6swdk7f6r"; 53 + sha256 = "1431f74l0n2dxn728qp65nc6hivx88fax1wzfrnrv19y77br05wj"; 56 54 }; 57 55 clang = fetch { 58 56 repo = "swift-clang"; 59 - sha256 = "046p7f4044ls8hhgklsz32md5jvxkaaim1d75n0fmnwap6di3n1q"; 57 + sha256 = "0n7k6nvzgqp6h6bfqcmna484w90db3zv4sh5rdh89wxyhdz6rk4v"; 58 + }; 59 + clangtools = fetch { 60 + repo = "swift-clang-tools-extra"; 61 + sha256 = "0snp2rpd60z239pr7fxpkj332rkdjhg63adqvqdkjsbrxcqqcgqa"; 62 + }; 63 + indexstore = fetch { 64 + repo = "indexstore-db"; 65 + sha256 = "1gwkqkdmpd5hn7555dpdkys0z50yh00hjry2886h6rx7avh5p05n"; 66 + }; 67 + sourcekit = fetch { 68 + repo = "sourcekit-lsp"; 69 + sha256 = "0k84ssr1k7grbvpk81rr21ii8csnixn9dp0cga98h6i1gshn8ml4"; 60 70 }; 61 71 cmark = fetch { 62 72 repo = "swift-cmark"; ··· 64 74 }; 65 75 lldb = fetch { 66 76 repo = "swift-lldb"; 67 - sha256 = "01yrhc1ggv89qii03fdjdvb2aq9v4hd1wk83n8ygrwwc75p44qmi"; 77 + sha256 = "0j787475f0nlmvxqblkhn3yrvn9qhcb2jcijwijxwq95ar2jdygs"; 68 78 }; 69 79 llbuild = fetch { 70 80 repo = "swift-llbuild"; 71 - sha256 = "0ipwryzpqxpk3rzkxilfahlkz06k39j91q2lv7fprf0slqknrdms"; 81 + sha256 = "1n2s5isxyl6b6ya617gdzjbw68shbvd52vsfqc1256rk4g448v8b"; 72 82 }; 73 83 pm = fetch { 74 84 repo = "swift-package-manager"; 75 - sha256 = "1mnywlm7i2mbp16q0rskskvnbx1ap8lchwr8q3gx0xs3b2fs6chh"; 85 + sha256 = "1a49jmag5mpld9zr96g8a773334mrz1c4nyw38gf4p6sckf4jp29"; 76 86 }; 77 87 xctest = fetch { 78 88 repo = "swift-corelibs-xctest"; 79 - sha256 = "1vpljkxhfk3yd07ry0xsv3qwbn62pwd2mdn9cw22jhbhvqinc13z"; 89 + sha256 = "0rxy9sq7i0s0kxfkz0hvdp8zyb40h31f7g4m0kry36qk82gzzh89"; 80 90 }; 81 91 foundation = fetch { 82 92 repo = "swift-corelibs-foundation"; 83 - sha256 = "1wys4xh7f6c7yjf210x41n2krmyi2qj1wpxbv0p48d230va1azj1"; 93 + sha256 = "1iiiijsnys0r3hjcj1jlkn3yszzi7hwb2041cnm5z306nl9sybzp"; 84 94 }; 85 95 libdispatch = fetch { 86 96 repo = "swift-corelibs-libdispatch"; 87 - sha256 = "0chnb0d4xjyn9wnc8bgimd5ji5igfyq891flgnqpfwr4y26496c1"; 97 + sha256 = "0laqsizsikyjhrzn0rghvxd8afg4yav7cbghvnf7ywk9wc6kpkmn"; 88 98 fetchSubmodules = true; 89 99 }; 90 100 swift = fetch { 91 101 repo = "swift"; 92 - sha256 = "0fsq1y8dz4ssn90akvzj36cqyblalb09bjzy4ikqn67mb5x99wpb"; 102 + sha256 = "0m4r1gzrnn0s1c7haqq9dlmvpqxbgbkbdfmq6qaph869wcmvdkvy"; 93 103 }; 94 104 }; 95 105 ··· 155 165 cp -r ${sources.llvm} llvm 156 166 cp -r ${sources.compilerrt} compiler-rt 157 167 cp -r ${sources.clang} clang 168 + cp -r ${sources.clangtools} clang-tools-extra 169 + cp -r ${sources.indexstore} indexstore-db 170 + cp -r ${sources.sourcekit} sourcekit-lsp 158 171 cp -r ${sources.cmark} cmark 159 172 cp -r ${sources.lldb} lldb 160 173 cp -r ${sources.llbuild} llbuild ··· 199 212 \ 200 213 -e 's/^swift-install-components=autolink.*$/\0;editor-integration/' 201 214 202 - # https://bugs.swift.org/browse/SR-10559 203 - patch -p1 -d swift-corelibs-libdispatch -i ${./patches/libdispatch-fortify-fix.patch} 204 - 215 + substituteInPlace clang/lib/Driver/ToolChains/Linux.cpp \ 216 + --replace 'SysRoot + "/lib' '"${glibc}/lib" "' 205 217 substituteInPlace clang/lib/Driver/ToolChains/Linux.cpp \ 206 218 --replace 'SysRoot + "/usr/lib' '"${glibc}/lib" "' 207 219 patch -p1 -d clang -i ${./patches/llvm-toolchain-dir.patch} ··· 211 223 sed -i 's/curses/ncurses/' llbuild/*/*/CMakeLists.txt 212 224 213 225 PREFIX=''${out/#\/} 226 + substituteInPlace indexstore-db/Utilities/build-script-helper.py \ 227 + --replace usr "$PREFIX" 228 + substituteInPlace sourcekit-lsp/Utilities/build-script-helper.py \ 229 + --replace usr "$PREFIX" 214 230 substituteInPlace swift-corelibs-xctest/build_script.py \ 215 231 --replace usr "$PREFIX" 216 232 ''; ··· 221 237 mkdir build install 222 238 export SWIFT_BUILD_ROOT=$PWD/build 223 239 export SWIFT_INSTALL_DIR=$PWD/install 224 - 225 - unset CC 226 - unset CXX 227 240 228 241 export INSTALLABLE_PACKAGE=$PWD/swift.tar.gz 229 242 export NIX_ENFORCE_PURITY= ··· 237 250 # During the Swift build, a full local LLVM build is performed and the resulting clang is invoked. 238 251 # This compiler is not using the Nix wrappers, so it needs some help to find things. 239 252 export NIX_LDFLAGS_BEFORE="-rpath ${clang.cc.gcc.lib}/lib -L${clang.cc.gcc.lib}/lib $NIX_LDFLAGS_BEFORE" 253 + # However, we want to use the wrapped compiler whenever possible. 254 + export CC="${clang}/bin/clang" 255 + 256 + # fix for https://bugs.llvm.org/show_bug.cgi?id=39743 257 + # see also https://forums.swift.org/t/18138/15 258 + export CCC_OVERRIDE_OPTIONS="#x-fmodules s/-fmodules-cache-path.*//" 240 259 241 260 $SWIFT_SOURCE_ROOT/swift/utils/build-script \ 242 261 --preset=buildbot_linux \ ··· 264 283 # Extract the generated tarball into the store 265 284 tar xf $INSTALLABLE_PACKAGE -C $out --strip-components=3 ''${out/#\/} 266 285 find $out -type d -empty -delete 286 + 287 + # fix installation weirdness, also present in Apple’s official tarballs 288 + mv $out/local/include/indexstore $out/include 289 + rmdir $out/local/include $out/local 290 + rm -r $out/bin/sdk-module-lists $out/bin/swift-api-checker.py 267 291 268 292 wrapProgram $out/bin/swift \ 269 293 --suffix C_INCLUDE_PATH : $out/lib/swift/clang/include \
+1 -1
pkgs/development/compilers/swift/patches/0001-build-presets-linux-don-t-require-using-Ninja.patch
··· 2 2 3 3 --- a/utils/build-presets.ini 4 4 +++ b/utils/build-presets.ini 5 - @@ -721,7 +721,7 @@ swiftpm 5 + @@ -745,7 +745,7 @@ swiftpm 6 6 7 7 dash-dash 8 8
+3 -3
pkgs/development/compilers/swift/patches/0002-build-presets-linux-allow-custom-install-prefix.patch
··· 2 2 3 3 --- a/utils/build-presets.ini 2019-04-11 14:51:40.060259462 +0200 4 4 +++ b/utils/build-presets.ini 2019-04-11 15:16:17.471137969 +0200 5 - @@ -728,7 +728,7 @@ 5 + @@ -752,7 +752,7 @@ 6 6 install-swiftpm 7 7 install-xctest 8 8 install-libicu 9 9 -install-prefix=/usr 10 10 +install-prefix=%(install_prefix)s 11 - swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc 12 - llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt 13 11 install-libcxx 12 + install-sourcekit-lsp 13 + build-swift-static-stdlib
+3 -5
pkgs/development/compilers/swift/patches/0003-build-presets-linux-don-t-build-extra-libs.patch
··· 2 2 3 3 --- a/utils/build-presets.ini 2019-04-11 15:19:57.845178834 +0200 4 4 +++ b/utils/build-presets.ini 2019-04-11 15:27:42.041297057 +0200 5 - @@ -716,8 +716,6 @@ 5 + @@ -740,8 +740,6 @@ 6 6 llbuild 7 7 swiftpm 8 8 xctest ··· 11 11 12 12 dash-dash 13 13 14 - @@ -727,11 +725,9 @@ 14 + @@ -751,9 +749,7 @@ 15 15 install-llbuild 16 16 install-swiftpm 17 17 install-xctest 18 18 -install-libicu 19 19 install-prefix=%(install_prefix)s 20 - swift-install-components=autolink-driver;compiler;clang-resource-dir-symlink;stdlib;swift-remote-mirror;sdk-overlay;license;sourcekit-inproc 21 - llvm-install-components=llvm-cov;llvm-profdata;IndexStore;clang;clang-headers;compiler-rt 22 20 -install-libcxx 21 + install-sourcekit-lsp 23 22 build-swift-static-stdlib 24 23 build-swift-static-sdk-overlay 25 - build-swift-stdlib-unittest-extra
+1 -1
pkgs/development/compilers/swift/patches/0004-build-presets-linux-plumb-extra-cmake-options.patch
··· 2 2 3 3 --- a/utils/build-presets.ini 4 4 +++ b/utils/build-presets.ini 5 - @@ -743,6 +743,8 @@ install-destdir=%(install_destdir)s 5 + @@ -766,6 +766,8 @@ install-destdir=%(install_destdir)s 6 6 # Path to the .tar.gz package we would create. 7 7 installable-package=%(installable_package)s 8 8
+1 -1
pkgs/development/compilers/swift/patches/glibc-arch-headers.patch
··· 2 2 3 3 --- swift/stdlib/public/Platform/CMakeLists.txt 2019-04-09 20:14:44.493801403 +0200 4 4 +++ swift/stdlib/public/Platform/CMakeLists.txt 2019-04-09 20:14:44.577800593 +0200 5 - @@ -68,7 +68,7 @@ 5 + @@ -77,7 +77,7 @@ 6 6 endif() 7 7 8 8 set(GLIBC_INCLUDE_PATH "${GLIBC_SYSROOT_RELATIVE_INCLUDE_PATH}")
-13
pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch
··· 1 - Nix compiles with _FORTIFY_SOURCE enabled. Fix error due to -Werror and an unused return value warning. 2 - 3 - --- swift-corelibs-libdispatch/src/internal.h 2019-04-26 09:33:38.287289099 +0200 4 - +++ swift-corelibs-libdispatch/src/internal.h 2019-04-26 15:31:10.485334128 +0200 5 - @@ -1053,7 +1053,7 @@ 6 - #else 7 - #define _dispatch_client_assert_fail(fmt, ...) do { \ 8 - char *_msg = NULL; \ 9 - - asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \ 10 - + (void)asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \ 11 - ##__VA_ARGS__); \ 12 - _dispatch_assert_crash(_msg); \ 13 - free(_msg); \
+1 -1
pkgs/development/compilers/swift/purity.patch
··· 2 2 3 3 --- a/lib/Driver/ToolChains/Gnu.cpp 4 4 +++ b/lib/Driver/ToolChains/Gnu.cpp 5 - @@ -380,13 +380,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 5 + @@ -402,13 +402,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA, 6 6 if (!Args.hasArg(options::OPT_static)) { 7 7 if (Args.hasArg(options::OPT_rdynamic)) 8 8 CmdArgs.push_back("-export-dynamic");