swiftPackages.*: 5.8 -> 5.10.1 (#447292)

This commit is contained in:
Emily
2025-10-11 22:22:48 +00:00
committed by GitHub
36 changed files with 556 additions and 1993 deletions

View File

@@ -1243,6 +1243,7 @@ with lib.maintainers;
swift = { swift = {
members = [ members = [
dduan dduan
samasaur
stephank stephank
trepetti trepetti
trundle trundle

View File

@@ -35,12 +35,12 @@
cctools, # libtool cctools, # libtool
sigtool, sigtool,
DarwinTools, DarwinTools,
apple-sdk_13, apple-sdk_14,
darwinMinVersionHook, darwinMinVersionHook,
}: }:
let let
apple-sdk_swift = apple-sdk_13; # Use the SDK that was available when Swift shipped. apple-sdk_swift = apple-sdk_14; # Use the SDK that was available when Swift shipped.
deploymentVersion = deploymentVersion =
if lib.versionOlder (targetPlatform.darwinMinVersion or "0") "10.15" then if lib.versionOlder (targetPlatform.darwinMinVersion or "0") "10.15" then
@@ -322,7 +322,6 @@ stdenv.mkDerivation {
-e 's|/bin/cp|${coreutils}/bin/cp|g' \ -e 's|/bin/cp|${coreutils}/bin/cp|g' \
-e 's|/usr/bin/file|${file}/bin/file|g' -e 's|/usr/bin/file|${file}/bin/file|g'
patch -p1 -d swift -i ${./patches/swift-cmake-3.25-compat.patch}
patch -p1 -d swift -i ${./patches/swift-wrap.patch} patch -p1 -d swift -i ${./patches/swift-wrap.patch}
patch -p1 -d swift -i ${./patches/swift-linux-fix-libc-paths.patch} patch -p1 -d swift -i ${./patches/swift-linux-fix-libc-paths.patch}
patch -p1 -d swift -i ${ patch -p1 -d swift -i ${
@@ -351,28 +350,6 @@ stdenv.mkDerivation {
for lldbPatch in ${ for lldbPatch in ${
lib.escapeShellArgs [ lib.escapeShellArgs [
# Fixes for SWIG 4
(fetchpatch2 {
url = "https://github.com/llvm/llvm-project/commit/81fc5f7909a4ef5a8d4b5da2a10f77f7cb01ba63.patch?full_index=1";
stripLen = 1;
hash = "sha256-Znw+C0uEw7lGETQLKPBZV/Ymo2UigZS+Hv/j1mUo7p0=";
})
(fetchpatch2 {
url = "https://github.com/llvm/llvm-project/commit/f0a25fe0b746f56295d5c02116ba28d2f965c175.patch?full_index=1";
stripLen = 1;
hash = "sha256-QzVeZzmc99xIMiO7n//b+RNAvmxghISKQD93U2zOgFI=";
})
(fetchpatch2 {
url = "https://github.com/llvm/llvm-project/commit/ba35c27ec9aa9807f5b4be2a0c33ca9b045accc7.patch?full_index=1";
stripLen = 1;
hash = "sha256-LXl+WbpmWZww5xMDrle3BM2Tw56v8k9LO1f1Z1/wDTs=";
})
(fetchpatch2 {
url = "https://github.com/llvm/llvm-project/commit/9ec115978ea2bdfc60800cd3c21264341cdc8b0a.patch?full_index=1";
stripLen = 1;
hash = "sha256-u0zSejEjfrH3ZoMFm1j+NVv2t5AP9cE5yhsrdTS1dG4=";
})
# Fix the build with modern libc++. # Fix the build with modern libc++.
(fetchpatch { (fetchpatch {
name = "add-cstdio.patch"; name = "add-cstdio.patch";
@@ -393,30 +370,21 @@ stdenv.mkDerivation {
patch -p1 -d llvm-project/clang -i ${./patches/clang-toolchain-dir.patch} patch -p1 -d llvm-project/clang -i ${./patches/clang-toolchain-dir.patch}
patch -p1 -d llvm-project/clang -i ${./patches/clang-wrap.patch} patch -p1 -d llvm-project/clang -i ${./patches/clang-wrap.patch}
patch -p1 -d llvm-project/clang -i ${./patches/clang-purity.patch} patch -p1 -d llvm-project/clang -i ${./patches/clang-purity.patch}
patch -p2 -d llvm-project/clang -i ${
fetchpatch {
name = "clang-cmake-fix-interpreter.patch";
url = "https://github.com/llvm/llvm-project/commit/b5eaf500f2441eff2277ea2973878fb1f171fd0a.patch";
sha256 = "1rma1al0rbm3s3ql6bnvbcighp74lri1lcrwbyacgdqp80fgw1b6";
}
}
# gcc-13 build fixes patch -p1 -d llvm-project/cmake -i ${
patch -p2 -d llvm-project/llvm -i ${ fetchpatch2 {
fetchpatch { name = "cmake-fix.patch";
name = "gcc-13.patch"; url = "https://github.com/llvm/llvm-project/commit/3676a86a4322e8c2b9c541f057b5d3704146b8f3.patch?full_index=1";
url = "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch"; stripLen = 1;
hash = "sha256-nkRPWx8gNvYr7mlvEUiOAb1rTrf+skCZjAydJVUHrcI="; hash = "sha256-zP9dQOmWs7qrxkBRj70DyQBbRjH78B6tNJVy6ilA1xM=";
} }
} }
${lib.optionalString stdenv.hostPlatform.isLinux '' ${lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace llvm-project/clang/lib/Driver/ToolChains/Linux.cpp \ substituteInPlace llvm-project/clang/lib/Driver/ToolChains/Linux.cpp \
--replace 'SysRoot + "/lib' '"${glibc}/lib" "' \ --replace-fail 'LibDir = "lib";' 'LibDir = "${glibc}/lib";' \
--replace 'SysRoot + "/usr/lib' '"${glibc}/lib" "' \ --replace-fail 'LibDir = "lib64";' 'LibDir = "${glibc}/lib";' \
--replace 'LibDir = "lib";' 'LibDir = "${glibc}/lib";' \ --replace-fail 'LibDir = X32 ? "libx32" : "lib64";' 'LibDir = "${glibc}/lib";'
--replace 'LibDir = "lib64";' 'LibDir = "${glibc}/lib";' \
--replace 'LibDir = X32 ? "libx32" : "lib64";' 'LibDir = "${glibc}/lib";'
# uuid.h is not part of glibc, but of libuuid. # uuid.h is not part of glibc, but of libuuid.
sed -i 's|''${GLIBC_INCLUDE_PATH}/uuid/uuid.h|${libuuid.dev}/include/uuid/uuid.h|' \ sed -i 's|''${GLIBC_INCLUDE_PATH}/uuid/uuid.h|${libuuid.dev}/include/uuid/uuid.h|' \
@@ -457,6 +425,13 @@ stdenv.mkDerivation {
hash = "sha256-wPZQ4wtEWk8HaKMfzjamlU6p/IW5EFiTssY63rGM+ZA="; hash = "sha256-wPZQ4wtEWk8HaKMfzjamlU6p/IW5EFiTssY63rGM+ZA=";
} }
} }
patch -p1 -d swift-corelibs-libdispatch -i ${
# Fix the build with modern Clang.
fetchpatch {
url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/38872e2d44d66d2fb94186988509defc734888a5.patch";
hash = "sha256-GABwDeTjciV36Sa0FS10mCfFCqRoBBstgW/OiKdPahA=";
}
}
''} ''}
''; '';
@@ -541,7 +516,7 @@ stdenv.mkDerivation {
# Ensure that the built Clang can find the runtime libraries by # Ensure that the built Clang can find the runtime libraries by
# copying the symlinks from the main wrapper. # copying the symlinks from the main wrapper.
cp -P ${clang}/resource-root/{lib,share} $SWIFT_BUILD_ROOT/llvm/lib/clang/15.0.0/ cp -P ${clang}/resource-root/{lib,share} $SWIFT_BUILD_ROOT/llvm/lib/clang/16.0.0/
'' ''
+ lib.optionalString stdenv.hostPlatform.isDarwin '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
@@ -570,8 +545,11 @@ stdenv.mkDerivation {
-DBOOTSTRAPPING_MODE=BOOTSTRAPPING${lib.optionalString stdenv.hostPlatform.isDarwin "-WITH-HOSTLIBS"} -DBOOTSTRAPPING_MODE=BOOTSTRAPPING${lib.optionalString stdenv.hostPlatform.isDarwin "-WITH-HOSTLIBS"}
-DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=ON -DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=ON
-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=ON -DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=ON
-DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=ON
-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=ON -DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=ON
-DSWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=ON -DSWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=ON
-DSWIFT_ENABLE_BACKTRACING=ON
-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=ON
-DLLVM_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/llvm -DLLVM_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/llvm
-DClang_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/clang -DClang_DIR=$SWIFT_BUILD_ROOT/llvm/lib/cmake/clang
-DSWIFT_PATH_TO_CMARK_SOURCE=$SWIFT_SOURCE_ROOT/swift-cmark -DSWIFT_PATH_TO_CMARK_SOURCE=$SWIFT_SOURCE_ROOT/swift-cmark
@@ -712,7 +690,7 @@ stdenv.mkDerivation {
# Undo the clang and swift wrapping we did for the build. # Undo the clang and swift wrapping we did for the build.
# (This happened via patches to cmake files.) # (This happened via patches to cmake files.)
cd $SWIFT_BUILD_ROOT cd $SWIFT_BUILD_ROOT
mv llvm/bin/clang-15{-unwrapped,} mv llvm/bin/clang-16{-unwrapped,}
mv swift/bin/swift-frontend{-unwrapped,} mv swift/bin/swift-frontend{-unwrapped,}
mkdir $lib mkdir $lib
@@ -751,7 +729,7 @@ stdenv.mkDerivation {
# Swift has a separate resource root from Clang, but locates the Clang # Swift has a separate resource root from Clang, but locates the Clang
# resource root via subdir or symlink. # resource root via subdir or symlink.
mv $SWIFT_BUILD_ROOT/llvm/lib/clang/15.0.0 $lib/lib/swift/clang mv $SWIFT_BUILD_ROOT/llvm/lib/clang/16.0.0 $lib/lib/swift/clang
''; '';
preFixup = lib.optionalString stdenv.hostPlatform.isLinux '' preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''

View File

@@ -3,20 +3,15 @@ From: Will Dietz <w@wdtz.org>
Date: Thu, 18 May 2017 11:56:12 -0500 Date: Thu, 18 May 2017 11:56:12 -0500
Subject: [PATCH] "purity" patch for 5.0 Subject: [PATCH] "purity" patch for 5.0
--- --- clang/lib/Driver/ToolChains/Gnu.cpp
lib/Driver/ToolChains/Gnu.cpp | 7 ------- +++ clang/lib/Driver/ToolChains/Gnu.cpp
1 file changed, 7 deletions(-) @@ -480,13 +480,6 @@
} else {
diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp
index fe3c0191bb..c6a482bece 100644
--- a/lib/Driver/ToolChains/Gnu.cpp
+++ b/lib/Driver/ToolChains/Gnu.cpp
@@ -487,12 +487,6 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
if (!IsStatic) {
if (Args.hasArg(options::OPT_rdynamic)) if (Args.hasArg(options::OPT_rdynamic))
CmdArgs.push_back("-export-dynamic"); CmdArgs.push_back("-export-dynamic");
- -
- if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE) { - if (!Args.hasArg(options::OPT_shared) && !IsStaticPIE &&
- !Args.hasArg(options::OPT_r)) {
- CmdArgs.push_back("-dynamic-linker"); - CmdArgs.push_back("-dynamic-linker");
- CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) + - CmdArgs.push_back(Args.MakeArgString(Twine(D.DyldPrefix) +
- ToolChain.getDynamicLinker(Args))); - ToolChain.getDynamicLinker(Args)));
@@ -24,5 +19,3 @@ index fe3c0191bb..c6a482bece 100644
} }
CmdArgs.push_back("-o"); CmdArgs.push_back("-o");
--
2.11.0

View File

@@ -5,15 +5,15 @@ patch it to also consider `-idirafter` and `-isystem` as added by cc-wrapper.
--- a/lib/ClangImporter/ClangIncludePaths.cpp --- a/lib/ClangImporter/ClangIncludePaths.cpp
+++ b/lib/ClangImporter/ClangIncludePaths.cpp +++ b/lib/ClangImporter/ClangIncludePaths.cpp
@@ -120,6 +120,7 @@ static clang::driver::Driver createClangDriver(const ASTContext &ctx) { @@ -142,6 +142,7 @@
/// \return a path without dots (`../`, './'). /// \return a path without dots (`../`, './').
static llvm::Optional<Path> static llvm::Optional<Path> findFirstIncludeDir(
findFirstIncludeDir(const llvm::opt::InputArgList &args, const llvm::opt::InputArgList &args,
+ const llvm::opt::ArgList &DriverArgs, + const llvm::opt::ArgList &DriverArgs,
const ArrayRef<const char *> expectedFileNames) { const ArrayRef<const char *> expectedFileNames,
const llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> &vfs) {
// C++ stdlib paths are added as `-internal-isystem`. // C++ stdlib paths are added as `-internal-isystem`.
std::vector<std::string> includeDirs = @@ -151,6 +152,14 @@
@@ -128,6 +129,14 @@ findFirstIncludeDir(const llvm::opt::InputArgList &args,
llvm::append_range(includeDirs, llvm::append_range(includeDirs,
args.getAllArgValues( args.getAllArgValues(
clang::driver::options::OPT_internal_externc_isystem)); clang::driver::options::OPT_internal_externc_isystem));
@@ -28,21 +28,21 @@ patch it to also consider `-idirafter` and `-isystem` as added by cc-wrapper.
for (const auto &includeDir : includeDirs) { for (const auto &includeDir : includeDirs) {
Path dir(includeDir); Path dir(includeDir);
@@ -193,7 +202,7 @@ getGlibcFileMapping(ASTContext &ctx) { @@ -218,7 +227,7 @@
// Ideally we would check that all of the headers referenced from the
// modulemap are present. // modulemap are present.
Path glibcDir; Path glibcDir;
- if (auto dir = findFirstIncludeDir(parsedIncludeArgs, if (auto dir = findFirstIncludeDir(
+ if (auto dir = findFirstIncludeDir(parsedIncludeArgs, clangDriverArgs, - parsedIncludeArgs, {"inttypes.h", "unistd.h", "stdint.h"}, vfs)) {
{"inttypes.h", "unistd.h", "stdint.h"})) { + parsedIncludeArgs, clangDriverArgs, {"inttypes.h", "unistd.h", "stdint.h"}, vfs)) {
glibcDir = dir.value(); glibcDir = dir.value();
} else { } else {
@@ -251,7 +260,7 @@ getLibStdCxxFileMapping(ASTContext &ctx) { ctx.Diags.diagnose(SourceLoc(), diag::glibc_not_found, triple.str());
@@ -276,7 +285,7 @@
auto parsedStdlibArgs = parseClangDriverArgs(clangDriver, stdlibArgStrings); auto parsedStdlibArgs = parseClangDriverArgs(clangDriver, stdlibArgStrings);
Path cxxStdlibDir; Path cxxStdlibDir;
- if (auto dir = findFirstIncludeDir(parsedStdlibArgs, - if (auto dir = findFirstIncludeDir(parsedStdlibArgs,
+ if (auto dir = findFirstIncludeDir(parsedStdlibArgs, clangDriverArgs, + if (auto dir = findFirstIncludeDir(parsedStdlibArgs, clangDriverArgs,
{"cstdlib", "string", "vector"})) { {"cstdlib", "string", "vector"}, vfs)) {
cxxStdlibDir = dir.value(); cxxStdlibDir = dir.value();
} else { } else {

View File

@@ -1,4 +1,4 @@
// swift-tools-version: 5.8 // swift-tools-version: 5.10
import PackageDescription import PackageDescription
@@ -9,7 +9,7 @@ let package = Package(
name: "CxxInteropTest", name: "CxxInteropTest",
path: "Sources", path: "Sources",
swiftSettings: [ swiftSettings: [
.unsafeFlags(["-enable-experimental-cxx-interop"]) .interoperabilityMode(.Cxx)
] ]
) )
] ]

View File

@@ -1,3 +1,3 @@
import CxxStdlib import CxxStdlib
print(String(cxxString: std.string("Hello, world!"))) print(String(std.string("Hello, world!")))

View File

@@ -21,25 +21,6 @@ stdenv.mkDerivation {
inherit (sources) version; inherit (sources) version;
src = sources.swift-corelibs-foundation; src = sources.swift-corelibs-foundation;
patches = [
# from https://github.com/apple/swift-corelibs-foundation/pull/4811
# fix build with glibc >=2.38
(fetchpatch {
url = "https://github.com/apple/swift-corelibs-foundation/commit/47260803a108c6e0d639adcebeed3ac6a76e8bcd.patch";
hash = "sha256-1JUSQW86IHKkBZqxvpk0P8zcSKntzOTNlMoGBfgeT4c=";
})
# Fix the build with modern Clang.
(fetchpatch {
url = "https://github.com/swiftlang/swift-corelibs-foundation/commit/76058114e5f5b47e02dd4441a6389858bb599bd6.patch";
hash = "sha256-N/hdTGCWMz092xh3AI28v3b+zjQHRmsb1F/2Q2u/jik=";
})
(fetchpatch {
url = "https://github.com/swiftlang/swift-corelibs-foundation/commit/5f3e896e522ff364780e6330df867e20e26269b4.patch";
hash = "sha256-AaBWSysNpZ7NV10RGD4TehZqE0k8Sn+TlhlGw1PiRdI=";
})
];
outputs = [ outputs = [
"out" "out"
"dev" "dev"

View File

@@ -38,6 +38,10 @@ stdenv.mkDerivation {
url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/30bb8019ba79cdae0eb1dc0c967c17996dd5cc0a.patch"; url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/30bb8019ba79cdae0eb1dc0c967c17996dd5cc0a.patch";
hash = "sha256-wPZQ4wtEWk8HaKMfzjamlU6p/IW5EFiTssY63rGM+ZA="; hash = "sha256-wPZQ4wtEWk8HaKMfzjamlU6p/IW5EFiTssY63rGM+ZA=";
}) })
(fetchpatch {
url = "https://github.com/swiftlang/swift-corelibs-libdispatch/commit/38872e2d44d66d2fb94186988509defc734888a5.patch";
hash = "sha256-GABwDeTjciV36Sa0FS10mCfFCqRoBBstgW/OiKdPahA=";
})
./disable-swift-overlay.patch ./disable-swift-overlay.patch
]; ];

View File

@@ -7,6 +7,7 @@
swift, swift,
swiftpm, swiftpm,
swiftpm2nix, swiftpm2nix,
Dispatch,
Foundation, Foundation,
XCTest, XCTest,
sqlite, sqlite,
@@ -40,6 +41,10 @@ stdenv.mkDerivation {
ncursesInput ncursesInput
]; ];
env.LD_LIBRARY_PATH = lib.optionalString stdenv.hostPlatform.isLinux (
lib.makeLibraryPath [ Dispatch ]
);
configurePhase = generated.configure + '' configurePhase = generated.configure + ''
swiftpmMakeMutable indexstore-db swiftpmMakeMutable indexstore-db
patch -p1 -d .build/checkouts/indexstore-db -i ${./patches/indexstore-db-macos-target.patch} patch -p1 -d .build/checkouts/indexstore-db -i ${./patches/indexstore-db-macos-target.patch}
@@ -51,19 +56,10 @@ stdenv.mkDerivation {
} }
} }
swiftpmMakeMutable swift-tools-support-core
patch -p1 -d .build/checkouts/swift-tools-support-core -i ${
fetchpatch {
url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch";
hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE=";
includes = [ "Sources/TSCBasic/FileSystem.swift" ];
}
}
# This toggles a section specific to Xcode XCTest, which doesn't work on # This toggles a section specific to Xcode XCTest, which doesn't work on
# Darwin, where we also use swift-corelibs-xctest. # Darwin, where we also use swift-corelibs-xctest.
substituteInPlace Sources/LSPTestSupport/PerfTestCase.swift \ substituteInPlace Sources/LSPTestSupport/PerfTestCase.swift \
--replace '#if os(macOS)' '#if false' --replace-fail '#if os(macOS)' '#if false'
# Required to link with swift-corelibs-xctest on Darwin. # Required to link with swift-corelibs-xctest on Darwin.
export SWIFTTSC_MACOS_DEPLOYMENT_TARGET=10.12 export SWIFTTSC_MACOS_DEPLOYMENT_TARGET=10.12

View File

@@ -2,16 +2,18 @@
{ {
workspaceStateFile = ./workspace-state.json; workspaceStateFile = ./workspace-state.json;
hashes = { hashes = {
"indexstore-db" = "0lf96m82s8f6lv67wbcnm9ii01fgw4bsr4vn2xp07ydfj1iqy8il"; "indexstore-db" = "sha256-2EIzEaVLHZ5vwO8skTaq9HoAaLuT9WFVLMgcgGYuVAk=";
"swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; "swift-argument-parser" = "sha256-qEJ329hqQyQVxtHScD7qPmWW9ZDf9bX+4xgpDlX0w5A=";
"swift-collections" = "1k6sjx5rqmp3gklny77b480hyzy6gkhpi23r0s8ljfbrcwawgnan"; "swift-asn1" = "sha256-aN6BJOBvUCFn62mPv0nT4Z3edD1bQZ2zT5GubzdXZDw=";
"swift-crypto" = "0kllp7j0hd8k67l9b9zr2c3ddc5bvshldchzivhcz3q31qvq9ag8"; "swift-certificates" = "sha256-34FcJfZgdufFehgjxgo8UbbFPnWnYsS6qR8SIba/WZg=";
"swift-driver" = "0cbvddj54k3sbw0vzlmzhccs7h43hi5kq6i3n2i0mysz3bf0c6zg"; "swift-collections" = "sha256-+f9Azcl+NbDvxlMsX0UbT3n87aYaBR1Kjp3rDqoLgkA=";
"swift-llbuild" = "106vnssh6pgy5s9dnq1hi1c9v2wkfydqgncg5dy7c9n23iisjy3s"; "swift-crypto" = "sha256-lcB497b/T1bHShPrjNjHthrs76pDFpU+4uN0uW4tz+4=";
"swift-package-manager" = "1d1ngh7da42dm0rwkw7jzxa63a1rpc88wimm85w2j59cm446pk9k"; "swift-driver" = "sha256-Xaz9gZuOspDb+PB67d6tXfpcs+kkDCPSkhu+eIfrb0A=";
"swift-syntax" = "05394mzznmcrw246lyzsjsn1fmilj98jgkjyyxr2ynhnbgzp2jl2"; "swift-llbuild" = "sha256-kUm8/+DWDBhuqU/kJBleqSl8/Vz478pMhx5QK2g7k0o=";
"swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; "swift-package-manager" = "sha256-7jkAum4nJj9ofVRF3RZDXAR6PyAjORPMnftTNnUrA+U=";
"swift-tools-support-core" = "1qvblyiazv58qwyxgyk2dh5ymbab3y70vm2q81qs6rmv43hs8ciz"; "swift-syntax" = "sha256-8XV2dlB3Vio5O+wFnS5EQeHyPCIgFyCjEYFGCWzOPwE=";
"Yams" = "0b4lprxl4f6yqq0djnp394mxgmsxm2pljr7fh4f6ihdhnpwfsfvl"; "swift-system" = "sha256-NpTzyppbOQR0Bg/0jrwdphZgbxyRrXy/4dnYcjFvY6w=";
"swift-tools-support-core" = "sha256-Pqy01AyDg7ZTyDM6lV69e6nhfhxwFTOhGFTfhcA1e9E=";
"Yams" = "sha256-AY/fIvB7THrl9GWzGJL8eDBbkcLw27tSRTGtUqmYw8k=";
}; };
} }

View File

@@ -12,8 +12,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "6caa12ab3bb6245eee4e09dce7677e64720c6545" "revision": "89ec16c2ac1bb271614e734a2ee792224809eb20"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -29,13 +29,47 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "e394bf350e38cb100b6bc4172834770ede1b7232", "revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version": "1.0.3" "version": "1.2.3"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
"subpath": "swift-argument-parser" "subpath": "swift-argument-parser"
}, },
{
"basedOn": null,
"packageRef": {
"identity": "swift-asn1",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-asn1.git",
"name": "swift-asn1"
},
"state": {
"checkoutState": {
"revision": "df5d2fcd22e3f480e3ef85bf23e277a4a0ef524d",
"version": "1.2.0"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-asn1"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-certificates",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-certificates.git",
"name": "swift-certificates"
},
"state": {
"checkoutState": {
"revision": "83640c8097acaec17c9835a083e89678cb0f2b66",
"version": "1.3.0"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-certificates"
},
{ {
"basedOn": null, "basedOn": null,
"packageRef": { "packageRef": {
@@ -46,8 +80,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", "revision": "c11818f3cae0780656baa430b49e7f163f08dffd",
"version": "1.0.4" "version": "1.1.6"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -63,8 +97,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "75ec60b8b4cc0f085c3ac414f3dca5625fa3588e", "revision": "629f0b679d0fd0a6ae823d7f750b9ab032c00b80",
"version": "2.2.4" "version": "3.0.0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -80,8 +114,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "7cfe0c0b6e6297efe88a3ce34e6138ee7eda969e" "revision": "b461fd4fc51be8e1f2a3f4a2184b664b8846b46f"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -97,8 +131,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "dccfc2e127a34b89a849407594cf2d604b598ba9" "revision": "fd7c2e0d9279edd023ced6b0a590f8407f5472f9"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -114,8 +148,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "6651d98a4ce3c6faa82768256ca286412bf4a04d" "revision": "b5f8ad931b7a40b81f64765fa08c2751164759b4"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -127,12 +161,12 @@
"identity": "swift-syntax", "identity": "swift-syntax",
"kind": "remoteSourceControl", "kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-syntax.git", "location": "https://github.com/apple/swift-syntax.git",
"name": "SwiftSyntax" "name": "swift-syntax"
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "cd793adf5680e138bf2bcbaacc292490175d0dcd" "revision": "cdd571f366a4298bb863a9dcfe1295bb595041d5"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -148,8 +182,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574", "revision": "d2ba781702a1d8285419c15ee62fd734a9437ff5",
"version": "1.1.1" "version": "1.3.2"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -165,8 +199,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "ac4871e01ef338cb95b5d28328cab0ec1dfae935" "revision": "90bdc2a157ebacc5d3de0c83e085d05d22ca5fa0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -182,8 +216,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "f47ba4838c30dbd59998a4e4c87ab620ff959e8a", "revision": "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
"version": "5.0.5" "version": "5.0.6"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },

View File

@@ -5,22 +5,22 @@ let
# These packages are all part of the Swift toolchain, and have a single # These packages are all part of the Swift toolchain, and have a single
# upstream version that should match. We also list the hashes here so a basic # upstream version that should match. We also list the hashes here so a basic
# version upgrade touches only this file. # version upgrade touches only this file.
version = "5.8"; version = "5.10.1";
hashes = { hashes = {
llvm-project = "sha256-0xwSAwwkzFgYO3mY1rHqV8TCeH2NpM7m3VUkCDqjcdE="; llvm-project = "sha256-D+zZjLgnAFy6zBuUQwRI0VmDrgr2TQeNUnDbDtvtRZ4=";
sourcekit-lsp = "sha256-XDGq64LbpgBrRy3IvZNgsoLUePXECK5p10vQ8cUKeGE="; sourcekit-lsp = "sha256-mMZ8zPkyoht0aSSnStIULWbLjowahdza9DQXboT1D0o=";
swift = "sha256-EY2IImBCVLiUutvDQjNUiInwCNxZsCu1mZzYSjNd4+A="; swift = "sha256-UK8yPwHu/sCvcuKKmBMCP9rGRJCZE3ct0ckdNw2BVbE=";
swift-cmark = "sha256-6xkO9kN6eXMAigjk+KyIgVhTyC50BxmkZmD4+9z6nz8="; swift-cmark = "sha256-GK2tFu49Sw8jJWJpxQerVFqsuUJwkAhRloa2/aUTYB8=";
swift-corelibs-foundation = "sha256-yRjjxJRy1eTM9VG7/Fn60UMghPavsaoueH0V8cjaIyM="; swift-corelibs-foundation = "sha256-izYpdCZaf3ktgz/k3pjmHJHH5BebdG7nj8l6vbuk+o0=";
swift-corelibs-libdispatch = "sha256-XOAWuaGqWJtxhGIPXYT3PIvk5OK0rkY4g1IOybJUlm4="; swift-corelibs-libdispatch = "sha256-pta3wJj2LJ/lsYAWQpw0wSGLDMO41mN8Zbl78LUCaQo=";
swift-corelibs-xctest = "sha256-uwxQhKUQ1xp5ao6kfkdlYOvMr6yAb5IaBIdOfoyf+n8="; swift-corelibs-xctest = "sha256-HgnVFYUuefCZKsOjXgt98ebMsLdMl0oXFXy2Pb2iUdw=";
swift-docc = "sha256-k1ygYDZwF4Jo7iOkHxc/3NzfgN+8XNCks5aizxBgPjM="; swift-docc = "sha256-zgGahAanYI95nQZ+3zAYrs0h4APNamPrZfwF81k1si0=";
swift-docc-render-artifact = "sha256-vdSyICXOjlNSjZXzPRxa/5305pg6PG4xww9GYEV9m10="; swift-docc-render-artifact = "sha256-Ky9l6tzAxQOpcPFq2FeGnFUl8i59TifRBSHNaZg8wfw=";
swift-driver = "sha256-7xsG3Bpf+wqisCMaPEuEg8CjGYO/0r8BX3pMUmRrezE="; swift-driver = "sha256-Xaz9gZuOspDb+PB67d6tXfpcs+kkDCPSkhu+eIfrb0A=";
swift-experimental-string-processing = "sha256-ioXG6pQKjlAc2oF38Z7TGighyZN8w2ZAAtFUq83Ow6Q="; swift-experimental-string-processing = "sha256-gv3xY9s6gdv0lpXH8RGfiLAvZWM7xVsUSLcqyb4rSeQ=";
swift-format = "sha256-uKhIcbJb0DDHKACfVrhQ4fSyXVUkAj090eUZsOrtEqw="; swift-format = "sha256-oYf9Qt0b/6G3+uQaoExQRKzgpi1RPYSSpZLfwhuRmF8=";
swift-package-manager = "sha256-xd6ZpeXfMoHyVrJxz6XcDLPKBvc2nl1lgWXuLrJdq+E="; swift-package-manager = "sha256-yL/cPCt7pZ0XqbbxEnrbzM2X3EkU9klon7SzO2Z13SA=";
swift-syntax = "sha256-gkpx/1sWWi9y917OJ1GSNFYXrJb6e2qI4JlV+38laRQ="; swift-syntax = "sha256-OcrOdlnLYpMxH5CGWNGbs5XW3gJaGgKWQqB9YtwmZeY=";
}; };
# Create fetch derivations. # Create fetch derivations.

View File

@@ -2,13 +2,15 @@
{ {
workspaceStateFile = ./workspace-state.json; workspaceStateFile = ./workspace-state.json;
hashes = { hashes = {
"swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; "swift-argument-parser" = "sha256-G4Tz/AdL5WbRq93aJnQhMjHLH7dEuhmXL3PPn+0H6vM=";
"swift-cmark" = "1qswlh6j9mlfq8qj7xfqspla7w7rrzvplgcs4mgllgi012yfgwnp"; "swift-atomics" = "sha256-fjRGySMI7Mv52sCYejWI5YA+IcehOdz5XxK3p+hxwmU=";
"swift-crypto" = "020b8q4ss2k7a65r5dgh59z40i6sn7ij1allxkh8c8a9d0jzn313"; "swift-cmark" = "sha256-1/LnvAggPkpfJZo9evfP+fCj6NXY9SMxwo7WJA2kXOM=";
"swift-docc-plugin" = "11d6nhi139yzk1lxxrixsbgyj1bnvmh40wj30y725q83nqq49ljh"; "swift-collections" = "sha256-VtnHFWd5OUmRBnmIeOF8xn8PASLrHG/pfONWnEuX2sw=";
"swift-docc-symbolkit" = "14w37wzbx1mygfwm4iv0ypj120n1axhk627rg5a7v8j0ln511r7s"; "swift-crypto" = "sha256-vBDjXtynl3HMq1RK/hMOu36b+0hX2SRRnwhPNjPUOsU=";
"swift-lmdb" = "0azmc24mnxn4pbda8w8v7hy3h0gqqm4br43pnr7lc4sfj3dcv43m"; "swift-docc-plugin" = "sha256-r+cFtDTK6rRWDOOsgJNF6J2mfm/oKxoK7HIv6fpFW4o=";
"swift-markdown" = "1l4ydc0xyv88gnyc33p61qavdh8cv98c548n1icphrfd6i78yygw"; "swift-docc-symbolkit" = "sha256-hAcoe57wE9gkPc1E/lXY41W+Eh3a7cUWfRv3Xi4rO2M=";
"swift-nio" = "04bvay94b34ynmlvgyl9a7f431l3cf8k2zr483spv8mvyh1hxiqn"; "swift-lmdb" = "sha256-dZDN2pBOE0ZPtneQvEjF+AE4PDwbcaTausR2W4lg9Ss=";
"swift-markdown" = "sha256-qb+mSS1A3WzLQdCB9lIz+UhSG9tf0hknitTfh6VIrHs=";
"swift-nio" = "sha256-KOvnE5VF6lw9hfTLHIlG+6EV/7kl8hL4IOIVoP2om3Q=";
}; };
} }

View File

@@ -12,13 +12,30 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "e394bf350e38cb100b6bc4172834770ede1b7232", "revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version": "1.0.3" "version": "1.2.2"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
"subpath": "swift-argument-parser" "subpath": "swift-argument-parser"
}, },
{
"basedOn": null,
"packageRef": {
"identity": "swift-atomics",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-atomics.git",
"name": "swift-atomics"
},
"state": {
"checkoutState": {
"revision": "6c89474e62719ddcc1e9614989fff2f68208fe10",
"version": "1.1.0"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-atomics"
},
{ {
"basedOn": null, "basedOn": null,
"packageRef": { "packageRef": {
@@ -36,6 +53,23 @@
}, },
"subpath": "swift-cmark" "subpath": "swift-cmark"
}, },
{
"basedOn": null,
"packageRef": {
"identity": "swift-collections",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-collections.git",
"name": "swift-collections"
},
"state": {
"checkoutState": {
"revision": "937e904258d22af6e447a0b72c0bc67583ef64a2",
"version": "1.0.4"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-collections"
},
{ {
"basedOn": null, "basedOn": null,
"packageRef": { "packageRef": {
@@ -46,8 +80,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "ddb07e896a2a8af79512543b1c7eb9797f8898a5", "revision": "33a20e650c33f6d72d822d558333f2085effa3dc",
"version": "1.1.7" "version": "2.5.0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -63,8 +97,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "3303b164430d9a7055ba484c8ead67a52f7b74f6", "revision": "9b1258905c21fc1b97bf03d1b4ca12c4ec4e5fda",
"version": "1.0.0" "version": "1.2.0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -80,8 +114,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "main", "branch": "release/5.10",
"revision": "b45d1f2ed151d057b54504d653e0da5552844e34" "revision": "1d5aba8186fc648e17b30631b34043110ca8dd19"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -97,7 +131,7 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "main", "branch": "release/5.10",
"revision": "584941b1236b15bad74d8163785d389c028b1ad8" "revision": "584941b1236b15bad74d8163785d389c028b1ad8"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
@@ -114,8 +148,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "main", "branch": "release/5.10",
"revision": "d491147940587dbadfb3472354f4d0c6e063e061" "revision": "636291555b65bd59b2b3279abc7d03a622aa7c55"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -131,8 +165,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "1d425b0851ffa2695d488cce1d68df2539f42500", "revision": "2d8e6ca36fe3e8ed74b0883f593757a45463c34d",
"version": "2.31.2" "version": "2.53.0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },

View File

@@ -57,16 +57,7 @@ stdenv.mkDerivation {
}) })
]; ];
configurePhase = generated.configure + '' configurePhase = generated.configure;
swiftpmMakeMutable swift-tools-support-core
patch -p1 -d .build/checkouts/swift-tools-support-core -i ${
fetchpatch {
url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch";
hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE=";
includes = [ "Sources/TSCBasic/FileSystem.swift" ];
}
}
'';
# TODO: Tests depend on indexstore-db being provided by an existing Swift # TODO: Tests depend on indexstore-db being provided by an existing Swift
# toolchain. (ie. looks for `../lib/libIndexStore.so` relative to swiftc. # toolchain. (ie. looks for `../lib/libIndexStore.so` relative to swiftc.

View File

@@ -2,10 +2,10 @@
{ {
workspaceStateFile = ./workspace-state.json; workspaceStateFile = ./workspace-state.json;
hashes = { hashes = {
"swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; "swift-argument-parser" = "sha256-G4Tz/AdL5WbRq93aJnQhMjHLH7dEuhmXL3PPn+0H6vM=";
"swift-llbuild" = "106vnssh6pgy5s9dnq1hi1c9v2wkfydqgncg5dy7c9n23iisjy3s"; "swift-llbuild" = "sha256-kUm8/+DWDBhuqU/kJBleqSl8/Vz478pMhx5QK2g7k0o=";
"swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; "swift-system" = "sha256-p18QHzO+NtoY/WQzOD+PfD+bjqrIWsbeEbsJLPqEAhA=";
"swift-tools-support-core" = "1qvblyiazv58qwyxgyk2dh5ymbab3y70vm2q81qs6rmv43hs8ciz"; "swift-tools-support-core" = "sha256-Pqy01AyDg7ZTyDM6lV69e6nhfhxwFTOhGFTfhcA1e9E=";
"Yams" = "11abhcfkmqm3cmh7vp7rqzvxd1zj02j2866a2pp6v9m89456xb76"; "Yams" = "sha256-5qxuCkmopm3uFcoYJKQA8ofW98f53H1gZaPiOh2DS4U=";
}; };
} }

View File

@@ -12,8 +12,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "e394bf350e38cb100b6bc4172834770ede1b7232", "revision": "fee6933f37fde9a5e12a1e4aeaa93fe60116ff2a",
"version": "1.0.3" "version": "1.2.2"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -29,8 +29,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "dccfc2e127a34b89a849407594cf2d604b598ba9" "revision": "fd7c2e0d9279edd023ced6b0a590f8407f5472f9"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -63,8 +63,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "ac4871e01ef338cb95b5d28328cab0ec1dfae935" "revision": "90bdc2a157ebacc5d3de0c83e085d05d22ca5fa0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },

View File

@@ -10,10 +10,10 @@ index a4a735f498..381522cc1f 100644
import SwiftOptions import SwiftOptions
import func TSCBasic.lookupExecutablePath import func TSCBasic.lookupExecutablePath
@@ -120,7 +121,18 @@ @@ -130,7 +131,18 @@
// just using `clang` and avoid a dependency on the C++ runtime. }
let clangTool: Tool =
parsedOptions.hasArgument(.enableExperimentalCxxInterop) ? .clangxx : .clang let clangTool: Tool = cxxCompatEnabled ? .clangxx : .clang
- var clangPath = try getToolPath(clangTool) - var clangPath = try getToolPath(clangTool)
+ +
+ // For Nix, prefer linking using the wrapped Nixpkgs clang, instead of using + // For Nix, prefer linking using the wrapped Nixpkgs clang, instead of using
@@ -21,7 +21,7 @@ index a4a735f498..381522cc1f 100644
+ // we still want to use it for other purposes (clang importer). + // we still want to use it for other purposes (clang importer).
+ var clangPath: AbsolutePath + var clangPath: AbsolutePath
+ if let binPath = try? AbsolutePath(validating: "@clang@/bin"), + if let binPath = try? AbsolutePath(validating: "@clang@/bin"),
+ let tool = lookupExecutablePath(filename: parsedOptions.hasArgument(.enableExperimentalCxxInterop) + let tool = lookupExecutablePath(filename: cxxCompatEnabled
+ ? "clang++" : "clang", + ? "clang++" : "clang",
+ searchPaths: [binPath]) { + searchPaths: [binPath]) {
+ clangPath = tool + clangPath = tool
@@ -30,7 +30,7 @@ index a4a735f498..381522cc1f 100644
if let toolsDirPath = parsedOptions.getLastArgument(.toolsDirectory) { if let toolsDirPath = parsedOptions.getLastArgument(.toolsDirectory) {
// FIXME: What if this isn't an absolute path? // FIXME: What if this isn't an absolute path?
let toolsDir = try AbsolutePath(validating: toolsDirPath.asSingle) let toolsDir = try AbsolutePath(validating: toolsDirPath.asSingle)
@@ -136,6 +148,7 @@ @@ -146,6 +158,7 @@
commandLine.appendFlag("-B") commandLine.appendFlag("-B")
commandLine.appendPath(toolsDir) commandLine.appendPath(toolsDir)
} }

View File

@@ -6,6 +6,7 @@
swift, swift,
swiftpm, swiftpm,
swiftpm2nix, swiftpm2nix,
Dispatch,
Foundation, Foundation,
}: }:
let let
@@ -24,16 +25,11 @@ stdenv.mkDerivation {
]; ];
buildInputs = [ Foundation ]; buildInputs = [ Foundation ];
configurePhase = generated.configure + '' env.LD_LIBRARY_PATH = lib.optionalString stdenv.hostPlatform.isLinux (
swiftpmMakeMutable swift-tools-support-core lib.makeLibraryPath [ Dispatch ]
patch -p1 -d .build/checkouts/swift-tools-support-core -i ${ );
fetchpatch {
url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch"; configurePhase = generated.configure;
hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE=";
includes = [ "Sources/TSCBasic/FileSystem.swift" ];
}
}
'';
# We only install the swift-format binary, so don't need the other products. # We only install the swift-format binary, so don't need the other products.
swiftpmFlags = [ "--product swift-format" ]; swiftpmFlags = [ "--product swift-format" ];

View File

@@ -2,9 +2,9 @@
{ {
workspaceStateFile = ./workspace-state.json; workspaceStateFile = ./workspace-state.json;
hashes = { hashes = {
"swift-argument-parser" = "01p814snzlfpby2qj67a3dcnsa6038fbk8411npi28440w1hzpzx"; "swift-argument-parser" = "sha256-JXNjFpLNaqzOGXlIgQtwzG2Yq1daOl4tmTAUcZL4thM=";
"swift-syntax" = "05394mzznmcrw246lyzsjsn1fmilj98jgkjyyxr2ynhnbgzp2jl2"; "swift-cmark" = "sha256-npLzvHtMmWZlqNIYOMAZfqyX2TOkICZNHCN1+laOBZA=";
"swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; "swift-markdown" = "sha256-F8xJYp8kf9IzLAe+HuKLFWJe3fdC2yewb+zaJgyeJ1U=";
"swift-tools-support-core" = "16kp0y1akr99v319j46x0zwc8kzh5klnqcvjhsb57ah5xr0l29bk"; "swift-syntax" = "sha256-8XV2dlB3Vio5O+wFnS5EQeHyPCIgFyCjEYFGCWzOPwE=";
}; };
} }

View File

@@ -12,8 +12,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "main", "revision": "309a47b2b1d9b5e991f36961c983ecec72275be3",
"revision": "c5050aa63ed5bb23209e7120b7ff6618ee06e0ee" "version": "1.6.1"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -22,53 +22,53 @@
{ {
"basedOn": null, "basedOn": null,
"packageRef": { "packageRef": {
"identity": "swift-syntax", "identity": "swift-cmark",
"kind": "remoteSourceControl", "kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-syntax.git", "location": "https://github.com/swiftlang/swift-cmark.git",
"name": "SwiftSyntax" "name": "cmark-gfm"
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "main", "revision": "b97d09472e847a416629f026eceae0e2afcfad65",
"revision": "cd793adf5680e138bf2bcbaacc292490175d0dcd" "version": "0.7.0"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-cmark"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-markdown",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-markdown.git",
"name": "swift-markdown"
},
"state": {
"checkoutState": {
"revision": "d8cf111c276ed18cff82d3cad563d2ca5903b982",
"version": "0.7.1"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-markdown"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-syntax",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-syntax.git",
"name": "swift-syntax"
},
"state": {
"checkoutState": {
"branch": "release/5.10",
"revision": "cdd571f366a4298bb863a9dcfe1295bb595041d5"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
"subpath": "swift-syntax" "subpath": "swift-syntax"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-system",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-system.git",
"name": "swift-system"
},
"state": {
"checkoutState": {
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574",
"version": "1.1.1"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-system"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-tools-support-core",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-tools-support-core.git",
"name": "swift-tools-support-core"
},
"state": {
"checkoutState": {
"branch": "main",
"revision": "1296d2f11b0226c4b83540010936c7238d21c12b"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-tools-support-core"
} }
] ]
}, },

View File

@@ -88,5 +88,20 @@ lib.mapAttrs mkInstallScript {
SwiftCrypto = '' SwiftCrypto = ''
add_library(Crypto SHARED IMPORTED) add_library(Crypto SHARED IMPORTED)
set_property(TARGET Crypto PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libCrypto@sharedLibExt@") set_property(TARGET Crypto PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libCrypto@sharedLibExt@")
add_library(_CryptoExtras SHARED IMPORTED)
# this can't possibly be right... I really think it should be `libCryptoExtras`
# swift-certificates did build with this though.....
set_property(TARGET _CryptoExtras PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libCrypto@sharedLibExt@")
'';
SwiftASN1 = ''
add_library(SwiftASN1 SHARED IMPORTED)
set_property(TARGET SwiftASN1 PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libSwiftASN1@sharedLibExt@")
'';
SwiftCertificates = ''
add_library(SwiftCertificates SHARED IMPORTED)
set_property(TARGET SwiftCertificates PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libCertificates@sharedLibExt@")
''; '';
} }

View File

@@ -2,7 +2,7 @@
lib, lib,
stdenv, stdenv,
callPackage, callPackage,
fetchpatch, fetchFromGitHub,
cmake, cmake,
ninja, ninja,
git, git,
@@ -23,7 +23,11 @@
let let
inherit (swift) swiftOs swiftModuleSubdir swiftStaticModuleSubdir; inherit (swift)
swiftOs
swiftModuleSubdir
swiftStaticModuleSubdir
;
sharedLibraryExt = stdenv.hostPlatform.extensions.sharedLibrary; sharedLibraryExt = stdenv.hostPlatform.extensions.sharedLibrary;
sources = callPackage ../sources.nix { }; sources = callPackage ../sources.nix { };
@@ -39,7 +43,6 @@ let
propagatedBuildInputs = [ Foundation ]; propagatedBuildInputs = [ Foundation ];
patches = [ patches = [
./patches/cmake-disable-rpath.patch ./patches/cmake-disable-rpath.patch
./patches/cmake-fix-quoting.patch
./patches/disable-index-store.patch ./patches/disable-index-store.patch
./patches/disable-sandbox.patch ./patches/disable-sandbox.patch
./patches/disable-xctest.patch ./patches/disable-xctest.patch
@@ -56,24 +59,9 @@ let
# Patch the location where swiftpm looks for its API modules. # Patch the location where swiftpm looks for its API modules.
substituteInPlace Sources/PackageModel/UserToolchain.swift \ substituteInPlace Sources/PackageModel/UserToolchain.swift \
--replace \ --replace-fail \
'librariesPath = applicationPath.parentDirectory' \ 'librariesPath = applicationPath.parentDirectory' \
"librariesPath = AbsolutePath(\"$out\")" "librariesPath = try AbsolutePath(validating: \"$out\")"
# Fix case-sensitivity issues.
# Upstream PR: https://github.com/apple/swift-package-manager/pull/6500
substituteInPlace Sources/CMakeLists.txt \
--replace \
'packageCollectionsSigning' \
'PackageCollectionsSigning'
substituteInPlace Sources/PackageCollectionsSigning/CMakeLists.txt \
--replace \
'SubjectPublickeyInfo' \
'SubjectPublicKeyInfo'
substituteInPlace Sources/PackageCollections/CMakeLists.txt \
--replace \
'FilepackageCollectionsSourcesStorage' \
'FilePackageCollectionsSourcesStorage'
''; '';
}; };
@@ -117,6 +105,8 @@ let
+ lib.optionalString stdenv.hostPlatform.isDarwin '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
# On Darwin only, Swift uses arm64 as cpu arch. # On Darwin only, Swift uses arm64 as cpu arch.
if [ -e cmake/modules/SwiftSupport.cmake ]; then if [ -e cmake/modules/SwiftSupport.cmake ]; then
# At least in swift-asn1, this has been removed and the module uses the full target triple as the name
# (https://github.com/apple/swift-asn1/pull/103)
substituteInPlace cmake/modules/SwiftSupport.cmake \ substituteInPlace cmake/modules/SwiftSupport.cmake \
--replace '"aarch64" PARENT_SCOPE' '"arm64" PARENT_SCOPE' --replace '"aarch64" PARENT_SCOPE' '"arm64" PARENT_SCOPE'
fi fi
@@ -201,24 +191,10 @@ let
''; '';
}; };
# Part of this patch fixes for glibc 2.39: glibc patch 64b1a44183a3094672ed304532bedb9acc707554
# marks the `FILE*` argument to a few functions including `ferror` & `fread` as non-null. However
# the code passes an `Optional<T>` to these functions.
# This patch uses a `guard` which effectively unwraps the type (or throws an exception).
swift-tools-support-core-glibc-fix = fetchpatch {
url = "https://github.com/apple/swift-tools-support-core/commit/990afca47e75cce136d2f59e464577e68a164035.patch";
hash = "sha256-PLzWsp+syiUBHhEFS8+WyUcSae5p0Lhk7SSRdNvfouE=";
includes = [ "Sources/TSCBasic/FileSystem.swift" ];
};
swift-tools-support-core = mkBootstrapDerivation { swift-tools-support-core = mkBootstrapDerivation {
name = "swift-tools-support-core"; name = "swift-tools-support-core";
src = generated.sources.swift-tools-support-core; src = generated.sources.swift-tools-support-core;
patches = [
swift-tools-support-core-glibc-fix
];
buildInputs = [ buildInputs = [
swift-system swift-system
sqlite sqlite
@@ -293,12 +269,12 @@ let
substituteInPlace \ substituteInPlace \
products/libllbuild/CMakeLists.txt \ products/libllbuild/CMakeLists.txt \
products/llbuildSwift/CMakeLists.txt \ products/llbuildSwift/CMakeLists.txt \
--replace '@rpath' "$out/lib" --replace-fail '@rpath' "$out/lib"
# This subdirectory is enabled for Darwin only, but requires ObjC XCTest # This subdirectory is enabled for Darwin only, but requires ObjC XCTest
# (and only Swift XCTest is open source). # (and only Swift XCTest is open source).
substituteInPlace perftests/CMakeLists.txt \ substituteInPlace perftests/CMakeLists.txt \
--replace 'add_subdirectory(Xcode/' '#add_subdirectory(Xcode/' --replace-fail 'add_subdirectory(Xcode/' '#add_subdirectory(Xcode/'
''; '';
cmakeFlags = [ cmakeFlags = [
@@ -330,7 +306,7 @@ let
postPatch = '' postPatch = ''
# Tries to link against CYaml, but that's private. # Tries to link against CYaml, but that's private.
substituteInPlace Sources/SwiftDriver/CMakeLists.txt \ substituteInPlace Sources/SwiftDriver/CMakeLists.txt \
--replace CYaml "" --replace-fail CYaml ""
''; '';
postInstall = cmakeGlue.SwiftDriver + '' postInstall = cmakeGlue.SwiftDriver + ''
@@ -342,14 +318,28 @@ let
swift-crypto = mkBootstrapDerivation { swift-crypto = mkBootstrapDerivation {
name = "swift-crypto"; name = "swift-crypto";
src = generated.sources.swift-crypto; src = fetchFromGitHub {
owner = "apple";
repo = "swift-crypto";
rev = "95ba0316a9b733e92bb6b071255ff46263bbe7dc"; # 3.15.1, as opposed to the pinned version of 3.0.0
sha256 = "sha256-RzoUBx4l12v0ZamSIAEpHHCRQXxJkXJCwVBEj7Qwg9I=";
fetchSubmodules = true;
};
buildInputs = [
swift-asn1
];
patches = [
./patches/install-crypto-extras.patch
];
postPatch = '' postPatch = ''
# Fix use of hardcoded tool paths on Darwin. # Fix use of hardcoded tool paths on Darwin.
substituteInPlace CMakeLists.txt \ substituteInPlace CMakeLists.txt \
--replace /usr/bin/ar $NIX_CC/bin/ar --replace-fail /usr/bin/ar $NIX_CC/bin/ar
substituteInPlace CMakeLists.txt \ substituteInPlace CMakeLists.txt \
--replace /usr/bin/ranlib $NIX_CC/bin/ranlib --replace-fail /usr/bin/ranlib $NIX_CC/bin/ranlib
''; '';
postInstall = cmakeGlue.SwiftCrypto + '' postInstall = cmakeGlue.SwiftCrypto + ''
@@ -358,9 +348,41 @@ let
# Headers are not installed. # Headers are not installed.
cp -r ../Sources/CCryptoBoringSSL/include $out/include cp -r ../Sources/CCryptoBoringSSL/include $out/include
# Swift modules are put in the wrong place by default (and not all are linked)
mkdir -p $out/${swiftModuleSubdir}
rm -rf $out/${swiftModuleSubdir}/*.swift{module,doc}
# I assume we don't care about .swiftsourceinfo
cp swift/*.swift{module,doc} $out/${swiftModuleSubdir}/
''; '';
}; };
swift-asn1 = mkBootstrapDerivation {
name = "swift-asn1";
src = generated.sources.swift-asn1;
postInstall =
cmakeGlue.SwiftASN1
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
# SwiftASN1 uses the full target triple as the name of the swiftmodule
# (https://github.com/apple/swift-asn1/pull/103)
mkdir -p $out/${swiftModuleSubdir}
cp swift/*.swift{module,doc} $out/${swiftModuleSubdir}/
'';
};
swift-certificates = mkBootstrapDerivation {
name = "swift-certificates";
src = generated.sources.swift-certificates;
buildInputs = [
swift-asn1
swift-crypto
];
postInstall = cmakeGlue.SwiftCertificates;
};
# Build a bootrapping swiftpm using CMake. # Build a bootrapping swiftpm using CMake.
swiftpm-bootstrap = mkBootstrapDerivation ( swiftpm-bootstrap = mkBootstrapDerivation (
commonAttrs commonAttrs
@@ -371,6 +393,8 @@ let
llbuild llbuild
sqlite sqlite
swift-argument-parser swift-argument-parser
swift-asn1
swift-certificates
swift-collections swift-collections
swift-crypto swift-crypto
swift-driver swift-driver
@@ -413,8 +437,7 @@ stdenv.mkDerivation (
# swift-corelibs-xctest. # swift-corelibs-xctest.
swiftpmMakeMutable swift-tools-support-core swiftpmMakeMutable swift-tools-support-core
substituteInPlace .build/checkouts/swift-tools-support-core/Sources/TSCTestSupport/XCTestCasePerf.swift \ substituteInPlace .build/checkouts/swift-tools-support-core/Sources/TSCTestSupport/XCTestCasePerf.swift \
--replace 'canImport(Darwin)' 'false' --replace-fail 'canImport(Darwin)' 'false'
patch -p1 -d .build/checkouts/swift-tools-support-core -i ${swift-tools-support-core-glibc-fix}
# Prevent a warning about SDK directories we don't have. # Prevent a warning about SDK directories we don't have.
swiftpmMakeMutable swift-driver swiftpmMakeMutable swift-driver

View File

@@ -2,13 +2,15 @@
{ {
workspaceStateFile = ./workspace-state.json; workspaceStateFile = ./workspace-state.json;
hashes = { hashes = {
"swift-argument-parser" = "1jph9w7lk9nr20fsv2c8p4hisx3dda817fh7pybd0r0j1jwa9nmw"; "swift-argument-parser" = "sha256-qEJ329hqQyQVxtHScD7qPmWW9ZDf9bX+4xgpDlX0w5A=";
"swift-collections" = "1k6sjx5rqmp3gklny77b480hyzy6gkhpi23r0s8ljfbrcwawgnan"; "swift-asn1" = "sha256-6NqPGUuM55YOXCMqNsqPm/3smKhSC2UIYHJSwtIiuoc=";
"swift-crypto" = "0kllp7j0hd8k67l9b9zr2c3ddc5bvshldchzivhcz3q31qvq9ag8"; "swift-certificates" = "sha256-n5dE5J8f7PAVoJkIpiKrrDvB0xIil5VwtzC2mx6vz80=";
"swift-driver" = "0cbvddj54k3sbw0vzlmzhccs7h43hi5kq6i3n2i0mysz3bf0c6zg"; "swift-collections" = "sha256-WNj19mRvDSZNcDzZvmtS+jZxngBooiHekh3IsPZnKUQ=";
"swift-llbuild" = "106vnssh6pgy5s9dnq1hi1c9v2wkfydqgncg5dy7c9n23iisjy3s"; "swift-crypto" = "sha256-lcB497b/T1bHShPrjNjHthrs76pDFpU+4uN0uW4tz+4=";
"swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7"; "swift-driver" = "sha256-Xaz9gZuOspDb+PB67d6tXfpcs+kkDCPSkhu+eIfrb0A=";
"swift-tools-support-core" = "1qvblyiazv58qwyxgyk2dh5ymbab3y70vm2q81qs6rmv43hs8ciz"; "swift-llbuild" = "sha256-kUm8/+DWDBhuqU/kJBleqSl8/Vz478pMhx5QK2g7k0o=";
"Yams" = "0b4lprxl4f6yqq0djnp394mxgmsxm2pljr7fh4f6ihdhnpwfsfvl"; "swift-system" = "sha256-p18QHzO+NtoY/WQzOD+PfD+bjqrIWsbeEbsJLPqEAhA=";
"swift-tools-support-core" = "sha256-Pqy01AyDg7ZTyDM6lV69e6nhfhxwFTOhGFTfhcA1e9E=";
"Yams" = "sha256-AY/fIvB7THrl9GWzGJL8eDBbkcLw27tSRTGtUqmYw8k=";
}; };
} }

View File

@@ -12,13 +12,47 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "e394bf350e38cb100b6bc4172834770ede1b7232", "revision": "8f4d2753f0e4778c76d5f05ad16c74f707390531",
"version": "1.0.3" "version": "1.2.3"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
"subpath": "swift-argument-parser" "subpath": "swift-argument-parser"
}, },
{
"basedOn": null,
"packageRef": {
"identity": "swift-asn1",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-asn1.git",
"name": "swift-asn1"
},
"state": {
"checkoutState": {
"revision": "f70225981241859eb4aa1a18a75531d26637c8cc",
"version": "1.4.0"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-asn1"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-certificates",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-certificates.git",
"name": "swift-certificates"
},
"state": {
"checkoutState": {
"revision": "01d7664523af5c169f26038f1e5d444ce47ae5ff",
"version": "1.0.1"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-certificates"
},
{ {
"basedOn": null, "basedOn": null,
"packageRef": { "packageRef": {
@@ -29,8 +63,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "937e904258d22af6e447a0b72c0bc67583ef64a2", "revision": "d029d9d39c87bed85b1c50adee7c41795261a192",
"version": "1.0.4" "version": "1.0.6"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -46,8 +80,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "75ec60b8b4cc0f085c3ac414f3dca5625fa3588e", "revision": "629f0b679d0fd0a6ae823d7f750b9ab032c00b80",
"version": "2.2.4" "version": "3.0.0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -63,8 +97,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "7cfe0c0b6e6297efe88a3ce34e6138ee7eda969e" "revision": "b461fd4fc51be8e1f2a3f4a2184b664b8846b46f"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -80,8 +114,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "dccfc2e127a34b89a849407594cf2d604b598ba9" "revision": "fd7c2e0d9279edd023ced6b0a590f8407f5472f9"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -114,8 +148,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"branch": "release/5.8", "branch": "release/5.10",
"revision": "ac4871e01ef338cb95b5d28328cab0ec1dfae935" "revision": "90bdc2a157ebacc5d3de0c83e085d05d22ca5fa0"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },
@@ -131,8 +165,8 @@
}, },
"state": { "state": {
"checkoutState": { "checkoutState": {
"revision": "f47ba4838c30dbd59998a4e4c87ab620ff959e8a", "revision": "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3",
"version": "5.0.5" "version": "5.0.6"
}, },
"name": "sourceControlCheckout" "name": "sourceControlCheckout"
}, },

View File

@@ -2,10 +2,10 @@ Disable rpath for the bootstrap build with CMake.
--- a/Sources/PackageDescription/CMakeLists.txt --- a/Sources/PackageDescription/CMakeLists.txt
+++ b/Sources/PackageDescription/CMakeLists.txt +++ b/Sources/PackageDescription/CMakeLists.txt
@@ -31,14 +31,11 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin) @@ -27,14 +27,11 @@
set(SWIFT_INTERFACE_PATH ${CMAKE_BINARY_DIR}/pm/ManifestAPI/PackageDescription.swiftinterface) $<$<COMPILE_LANGUAGE:Swift>:-package-description-version$<SEMICOLON>999.0>)
target_compile_options(PackageDescription PUBLIC
$<$<COMPILE_LANGUAGE:Swift>:-emit-module-interface-path$<SEMICOLON>${SWIFT_INTERFACE_PATH}>) if(CMAKE_HOST_SYSTEM_NAME STREQUAL Darwin)
- target_link_options(PackageDescription PRIVATE - target_link_options(PackageDescription PRIVATE
- "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackageDescription.dylib") - "SHELL:-Xlinker -install_name -Xlinker @rpath/libPackageDescription.dylib")
endif() endif()

View File

@@ -1,12 +0,0 @@
--- a/Sources/PackageCollectionsSigning/CMakeLists.txt
+++ b/Sources/PackageCollectionsSigning/CMakeLists.txt
@@ -43,6 +43,7 @@ target_link_libraries(PackageCollectionsSigning PUBLIC
PackageCollectionsModel
TSCBasic)
target_link_libraries(PackageCollectionsSigning PRIVATE
- PackageCollectionsSigningLibc
- $<$<PLATFORM_ID:Darwin>:SHELL:-Xlinker -framework -Xlinker Security>)
+ PackageCollectionsSigningLibc)
+target_link_options(PackageCollectionsSigning PRIVATE
+ "$<$<PLATFORM_ID:Darwin>:SHELL:-Xlinker -framework -Xlinker Security>")

View File

@@ -4,9 +4,9 @@ Clang. Make it opt-in by default.
(It is assumed the `target.type == test` check is for Xcode support, because (It is assumed the `target.type == test` check is for Xcode support, because
there is no evidence of it in swift-corelibs-xctest.) there is no evidence of it in swift-corelibs-xctest.)
--- a/Sources/Build/BuildPlan.swift --- a/Sources/Build/BuildPlan/BuildPlan.swift
+++ b/Sources/Build/BuildPlan.swift +++ b/Sources/Build/BuildPlan/BuildPlan.swift
@@ -103,14 +103,7 @@ extension BuildParameters { @@ -111,14 +111,7 @@
case .off: case .off:
addIndexStoreArguments = false addIndexStoreArguments = false
case .auto: case .auto:

View File

@@ -2,13 +2,18 @@ Nix may already sandbox the build, in which case sandbox_apply will fail.
--- a/Sources/Basics/Sandbox.swift --- a/Sources/Basics/Sandbox.swift
+++ b/Sources/Basics/Sandbox.swift +++ b/Sources/Basics/Sandbox.swift
@@ -33,12 +33,14 @@ public enum Sandbox { @@ -57,6 +57,8 @@
readOnlyDirectories: [AbsolutePath] = [] allowNetworkConnections: [SandboxNetworkPermission] = []
) throws -> [String] { ) throws -> [String] {
#if os(macOS) #if os(macOS)
+ let env = ProcessInfo.processInfo.environment + let env = ProcessInfo.processInfo.environment
+ if env["NIX_BUILD_TOP"] == nil || env["IN_NIX_SHELL"] != nil { + if env["NIX_BUILD_TOP"] == nil || env["IN_NIX_SHELL"] != nil {
let profile = try macOSSandboxProfile(strictness: strictness, writableDirectories: writableDirectories, readOnlyDirectories: readOnlyDirectories) let profile = try macOSSandboxProfile(
fileSystem: fileSystem,
strictness: strictness,
@@ -65,10 +67,10 @@
allowNetworkConnections: allowNetworkConnections
)
return ["/usr/bin/sandbox-exec", "-p", profile] + command return ["/usr/bin/sandbox-exec", "-p", profile] + command
- #else - #else
+ } + }
@@ -19,3 +24,4 @@ Nix may already sandbox the build, in which case sandbox_apply will fail.
} }
/// Basic strictness level of a sandbox applied to a command line. /// Basic strictness level of a sandbox applied to a command line.

View File

@@ -3,35 +3,12 @@ command-line runner available, so disable support.
--- a/Sources/Commands/Utilities/TestingSupport.swift --- a/Sources/Commands/Utilities/TestingSupport.swift
+++ b/Sources/Commands/Utilities/TestingSupport.swift +++ b/Sources/Commands/Utilities/TestingSupport.swift
@@ -72,7 +72,7 @@ enum TestingSupport { @@ -105,7 +105,7 @@
/// - Returns: Array of TestSuite ) throws -> [TestSuite] {
static func getTestSuites(fromTestAt path: AbsolutePath, swiftTool: SwiftTool, enableCodeCoverage: Bool, sanitizers: [Sanitizer]) throws -> [TestSuite] {
// Run the correct tool. // Run the correct tool.
var args = [String]()
- #if os(macOS) - #if os(macOS)
+ #if false + #if false
let data: String = try withTemporaryFile { tempFile in let data: String = try withTemporaryFile { tempFile in
let args = [try Self.xctestHelperPath(swiftTool: swiftTool).pathString, path.pathString, tempFile.path.pathString] args = [try Self.xctestHelperPath(swiftTool: swiftTool).pathString, path.pathString, tempFile.path.pathString]
var env = try Self.constructTestEnvironment( var env = try Self.constructTestEnvironment(
--- a/Sources/swiftpm-xctest-helper/main.swift
+++ b/Sources/swiftpm-xctest-helper/main.swift
@@ -11,8 +11,11 @@
//===----------------------------------------------------------------------===//
#if os(macOS)
-import XCTest
import func Darwin.C.exit
+print("Not supported in Nix.")
+exit(1)
+#if false
+import XCTest
/// A helper tool to get list of tests from a XCTest Bundle on macOS.
///
@@ -134,6 +137,7 @@ do {
exit(1)
}
+#endif // nix
#else
#if os(Windows)

View File

@@ -2,20 +2,20 @@ Swiftpm may invoke clang, not clang++, to compile C++. Our cc-wrapper also
doesn't pick up the arguments that enable C++ compilation in this case. Patch doesn't pick up the arguments that enable C++ compilation in this case. Patch
swiftpm to properly invoke clang++. swiftpm to properly invoke clang++.
--- a/Sources/Build/BuildPlan.swift --- a/Sources/Build/BuildPlan/BuildPlan+Product.swift
+++ b/Sources/Build/BuildPlan.swift +++ b/Sources/Build/BuildPlan/BuildPlan+Product.swift
@@ -2089,7 +2089,7 @@ public class BuildPlan: SPMBuildCore.BuildPlan { @@ -53,7 +53,7 @@
for target in dependencies.staticTargets { for target in dependencies.staticTargets {
if case let target as ClangTarget = target.underlyingTarget, target.isCXX { if case let target as ClangTarget = target.underlyingTarget, target.isCXX {
if buildParameters.hostTriple.isDarwin() { if buildParameters.targetTriple.isDarwin() {
- buildProduct.additionalFlags += ["-lc++"] - buildProduct.additionalFlags += ["-lc++"]
+ buildProduct.additionalFlags += ["-lc++", "-lc++abi"] + buildProduct.additionalFlags += ["-lc++", "-lc++abi"]
} else if buildParameters.hostTriple.isWindows() { } else if buildParameters.targetTriple.isWindows() {
// Don't link any C++ library. // Don't link any C++ library.
} else { } else {
--- a/Sources/Build/LLBuildManifestBuilder.swift --- a/Sources/Build/BuildManifest/LLBuildManifestBuilder+Clang.swift
+++ b/Sources/Build/LLBuildManifestBuilder.swift +++ b/Sources/Build/BuildManifest/LLBuildManifestBuilder+Clang.swift
@@ -786,7 +786,7 @@ extension LLBuildManifestBuilder { @@ -97,7 +97,7 @@
args += ["-c", path.source.pathString, "-o", path.object.pathString] args += ["-c", path.source.pathString, "-o", path.object.pathString]
@@ -46,7 +46,7 @@ swiftpm to properly invoke clang++.
private let environment: EnvironmentVariables private let environment: EnvironmentVariables
@@ -196,29 +196,31 @@ public final class UserToolchain: Toolchain { @@ -262,33 +262,35 @@
} }
/// Returns the path to clang compiler tool. /// Returns the path to clang compiler tool.
@@ -59,20 +59,24 @@ swiftpm to properly invoke clang++.
} }
// Check in the environment variable first. // Check in the environment variable first.
- if let toolPath = UserToolchain.lookup(variable: "CC", searchPaths: self.envSearchPaths, environment: environment) { + let envVar = isCXX ? "CXX" : "CC"
if let toolPath = UserToolchain.lookup(
- variable: "CC",
+ variable: envVar,
searchPaths: self.envSearchPaths,
environment: environment
) {
- self._clangCompiler = toolPath - self._clangCompiler = toolPath
+ let envVar = isCXX ? "CXX" : "CC";
+ if let toolPath = UserToolchain.lookup(variable: envVar, searchPaths: self.envSearchPaths, environment: environment) {
+ self._clangCompiler[isCXX] = toolPath + self._clangCompiler[isCXX] = toolPath
return toolPath return toolPath
} }
// Then, check the toolchain. // Then, check the toolchain.
+ let tool = isCXX ? "clang++" : "clang"; + let tool = isCXX ? "clang++" : "clang"
do { do {
- if let toolPath = try? UserToolchain.getTool("clang", binDir: self.destination.toolchainBinDir) { - if let toolPath = try? UserToolchain.getTool("clang", binDirectories: self.swiftSDK.toolset.rootPaths) {
- self._clangCompiler = toolPath - self._clangCompiler = toolPath
+ if let toolPath = try? UserToolchain.getTool(tool, binDir: self.destination.binDir) { + if let toolPath = try? UserToolchain.getTool(tool, binDirectories: self.swiftSDK.toolset.rootPaths) {
+ self._clangCompiler[isCXX] = toolPath + self._clangCompiler[isCXX] = toolPath
return toolPath return toolPath
} }
@@ -86,8 +90,9 @@ swiftpm to properly invoke clang++.
return toolPath return toolPath
} }
--- a/Sources/SPMBuildCore/BuildParameters.swift
+++ b/Sources/SPMBuildCore/BuildParameters.swift --- a/Sources/SPMBuildCore/BuildParameters/BuildParameters.swift
+++ b/Sources/SPMBuildCore/BuildParameters/BuildParameters.swift
@@ -394,7 +394,7 @@ private struct _Toolchain: Encodable { @@ -394,7 +394,7 @@ private struct _Toolchain: Encodable {
public func encode(to encoder: Encoder) throws { public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self) var container = encoder.container(keyedBy: CodingKeys.self)
@@ -110,12 +115,12 @@ swiftpm to properly invoke clang++.
settings["LIBRARY_SEARCH_PATHS"] = "$(inherited) \(try buildParameters.toolchain.toolchainLibDir.pathString)" settings["LIBRARY_SEARCH_PATHS"] = "$(inherited) \(try buildParameters.toolchain.toolchainLibDir.pathString)"
--- a/Tests/BuildTests/MockBuildTestHelper.swift --- a/Tests/BuildTests/MockBuildTestHelper.swift
+++ b/Tests/BuildTests/MockBuildTestHelper.swift +++ b/Tests/BuildTests/MockBuildTestHelper.swift
@@ -23,7 +23,7 @@ struct MockToolchain: PackageModel.Toolchain { @@ -36,7 +36,7 @@
#else let extraFlags = PackageModel.BuildFlags()
let extraFlags = BuildFlags(cxxCompilerFlags: ["-lstdc++"]) let installedSwiftPMConfiguration = InstalledSwiftPMConfiguration.default
#endif
- func getClangCompiler() throws -> AbsolutePath { - func getClangCompiler() throws -> AbsolutePath {
+ func getClangCompiler(isCXX: Bool) throws -> AbsolutePath { + func getClangCompiler(isCXX: Bool) throws -> AbsolutePath {
return AbsolutePath(path: "/fake/path/to/clang") return "/fake/path/to/clang"
} }

View File

@@ -9,7 +9,7 @@ necessary for back-deployment of some features.
public var macosSwiftStdlib: AbsolutePath { public var macosSwiftStdlib: AbsolutePath {
get throws { get throws {
+ if swiftCompilerPath.pathString.starts(with: "@storeDir@") { + if swiftCompilerPath.pathString.starts(with: "@storeDir@") {
+ return AbsolutePath("@swiftLib@/lib/swift/macosx") + return try AbsolutePath(validating: "@swiftLib@/lib/swift/macosx")
+ } + }
return try AbsolutePath(validating: "../../lib/swift/macosx", relativeTo: resolveSymlinks(swiftCompilerPath)) return try AbsolutePath(validating: "../../lib/swift/macosx", relativeTo: resolveSymlinks(swiftCompilerPath))
} }
@@ -18,7 +18,7 @@ necessary for back-deployment of some features.
public var toolchainLibDir: AbsolutePath { public var toolchainLibDir: AbsolutePath {
get throws { get throws {
+ if swiftCompilerPath.pathString.starts(with: "@storeDir@") { + if swiftCompilerPath.pathString.starts(with: "@storeDir@") {
+ return AbsolutePath("@swiftLib@/lib") + return try AbsolutePath(validating: "@swiftLib@/lib")
+ } + }
// FIXME: Not sure if it's better to base this off of Swift compiler or our own binary. // FIXME: Not sure if it's better to base this off of Swift compiler or our own binary.
return try AbsolutePath(validating: "../../lib", relativeTo: resolveSymlinks(swiftCompilerPath)) return try AbsolutePath(validating: "../../lib", relativeTo: resolveSymlinks(swiftCompilerPath))

View File

@@ -0,0 +1,10 @@
Install _CryptoExtras target when building with CMake
--- a/Sources/_CryptoExtras/CMakeLists.txt
+++ b/Sources/_CryptoExtras/CMakeLists.txt
@@ -42,4 +42,5 @@ target_link_options(_CryptoExtras PRIVATE
set_target_properties(_CryptoExtras PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
+_install_target(_CryptoExtras)
set_property(GLOBAL APPEND PROPERTY SWIFT_CRYPTO_EXPORTS _CryptoExtras)

View File

@@ -107,7 +107,7 @@ dontLink=$isFrontend
for p in "${params[@]}"; do for p in "${params[@]}"; do
case "$p" in case "$p" in
-enable-cxx-interop | -enable-experimental-cxx-interop) -cxx-interoperability-mode=default | -enable-cxx-interop | -enable-experimental-cxx-interop)
isCxx=1 ;; isCxx=1 ;;
esac esac
done done

View File

@@ -31,7 +31,7 @@ stdenv.mkDerivation {
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# On Darwin only, Swift uses arm64 as cpu arch. # On Darwin only, Swift uses arm64 as cpu arch.
substituteInPlace cmake/modules/SwiftSupport.cmake \ substituteInPlace cmake/modules/SwiftSupport.cmake \
--replace '"aarch64" PARENT_SCOPE' '"arm64" PARENT_SCOPE' --replace-fail '"aarch64" PARENT_SCOPE' '"arm64" PARENT_SCOPE'
''; '';
preConfigure = '' preConfigure = ''