diff --git a/pkgs/development/compilers/swift/swift-driver/default.nix b/pkgs/development/compilers/swift/swift-driver/default.nix index 3da4e5bacdf9..04d41a663cd7 100644 --- a/pkgs/development/compilers/swift/swift-driver/default.nix +++ b/pkgs/development/compilers/swift/swift-driver/default.nix @@ -57,16 +57,7 @@ stdenv.mkDerivation { }) ]; - 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" ]; - } - } - ''; + configurePhase = generated.configure; # TODO: Tests depend on indexstore-db being provided by an existing Swift # toolchain. (ie. looks for `../lib/libIndexStore.so` relative to swiftc. diff --git a/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch b/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch index be4147d44f07..dcdb5292687d 100644 --- a/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch +++ b/pkgs/development/compilers/swift/swift-driver/patches/linux-fix-linking.patch @@ -10,10 +10,10 @@ index a4a735f498..381522cc1f 100644 import SwiftOptions import func TSCBasic.lookupExecutablePath -@@ -120,7 +121,18 @@ - // just using `clang` and avoid a dependency on the C++ runtime. - let clangTool: Tool = - parsedOptions.hasArgument(.enableExperimentalCxxInterop) ? .clangxx : .clang +@@ -130,7 +131,18 @@ + } + + let clangTool: Tool = cxxCompatEnabled ? .clangxx : .clang - var clangPath = try getToolPath(clangTool) + + // 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). + var clangPath: AbsolutePath + if let binPath = try? AbsolutePath(validating: "@clang@/bin"), -+ let tool = lookupExecutablePath(filename: parsedOptions.hasArgument(.enableExperimentalCxxInterop) ++ let tool = lookupExecutablePath(filename: cxxCompatEnabled + ? "clang++" : "clang", + searchPaths: [binPath]) { + clangPath = tool @@ -30,7 +30,7 @@ index a4a735f498..381522cc1f 100644 if let toolsDirPath = parsedOptions.getLastArgument(.toolsDirectory) { // FIXME: What if this isn't an absolute path? let toolsDir = try AbsolutePath(validating: toolsDirPath.asSingle) -@@ -136,6 +148,7 @@ +@@ -146,6 +158,7 @@ commandLine.appendFlag("-B") commandLine.appendPath(toolsDir) }