Skip to content

Commit e0ce8c5

Browse files
committed
When bootstrapping SwiftPM, use relative paths for dependencies.
When bootstrapping SwiftPM, SwiftPM uses relative paths to find its dependencies (e.g., llbuild) rather than repository URLs. Do the same thing for the driver when SWIFTCI_USE_LOCAL_DEPS is set in the environment. This allows us to use the Swift driver when bootstrapping SwiftPM.
1 parent af7726e commit e0ce8c5

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

Package.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// swift-tools-version:5.1
22
import PackageDescription
3+
import class Foundation.ProcessInfo
34

45
let package = Package(
56
name: "swift-driver",
@@ -20,11 +21,6 @@ let package = Package(
2021
name: "SwiftOptions",
2122
targets: ["SwiftOptions"]),
2223
],
23-
dependencies: [
24-
.package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("master")),
25-
.package(url: "https://github.com/apple/swift-llbuild.git", .branch("master")),
26-
.package(url: "https://github.com/jpsim/Yams.git", .branch("master")),
27-
],
2824
targets: [
2925
/// The driver library.
3026
.target(
@@ -59,3 +55,17 @@ let package = Package(
5955
],
6056
cxxLanguageStandard: .cxx14
6157
)
58+
59+
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
60+
package.dependencies += [
61+
.package(url: "https://github.com/apple/swift-tools-support-core.git", .branch("master")),
62+
.package(url: "https://github.com/apple/swift-llbuild.git", .branch("master")),
63+
.package(url: "https://github.com/jpsim/Yams.git", .branch("master")),
64+
]
65+
} else {
66+
package.dependencies += [
67+
.package(path: "../swift-tools-support-core"),
68+
.package(path: "../yams"),
69+
.package(path: "../llbuild"),
70+
]
71+
}

0 commit comments

Comments
 (0)