Skip to content

Commit 2372235

Browse files
PackageToJS: Rename SWIFT_PATH to SWIFT_BIN_PATH env var (#518)
Utilities/format.swift now looks up `SWIFT_PATH` for the "swift" command location, but PackageToJS's test suites also use this env var to locate the Swift toolchain bin path. To avoid confusion, rename the env var in PackageToJS from `SWIFT_PATH` to `SWIFT_BIN_PATH`.
1 parent de0928b commit 2372235

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Configure environment variables
4747
run: |
4848
echo "SWIFT_SDK_ID=${{ steps.setup-swiftwasm.outputs.swift-sdk-id }}" >> $GITHUB_ENV
49-
echo "SWIFT_PATH=$(dirname $(which swiftc))" >> $GITHUB_ENV
49+
echo "SWIFT_BIN_PATH=$(dirname $(which swiftc))" >> $GITHUB_ENV
5050
- run: make bootstrap
5151
- run: make unittest
5252
# Skip unit tests with uwasi because its proc_exit throws

Plugins/PackageToJS/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@ swift test --package-path ./Plugins/PackageToJS
4141
Please define the following environment variables when you want to run E2E tests:
4242

4343
- `SWIFT_SDK_ID`: Specifies the Swift SDK identifier to use
44-
- `SWIFT_PATH`: Specifies the `bin` path to the Swift toolchain to use
44+
- `SWIFT_BIN_PATH`: Specifies the `bin` path to the Swift toolchain to use
4545

Plugins/PackageToJS/Tests/ExampleTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ extension Trait where Self == ConditionTrait {
77
static var requireSwiftSDK: ConditionTrait {
88
.enabled(
99
if: ProcessInfo.processInfo.environment["SWIFT_SDK_ID"] != nil
10-
&& ProcessInfo.processInfo.environment["SWIFT_PATH"] != nil,
11-
"Requires SWIFT_SDK_ID and SWIFT_PATH environment variables"
10+
&& ProcessInfo.processInfo.environment["SWIFT_BIN_PATH"] != nil,
11+
"Requires SWIFT_SDK_ID and SWIFT_BIN_PATH environment variables"
1212
)
1313
}
1414

1515
static func requireSwiftSDK(triple: String) -> ConditionTrait {
1616
.enabled(
1717
if: {
1818
guard let swiftSDKID = ProcessInfo.processInfo.environment["SWIFT_SDK_ID"],
19-
ProcessInfo.processInfo.environment["SWIFT_PATH"] != nil
19+
ProcessInfo.processInfo.environment["SWIFT_BIN_PATH"] != nil
2020
else {
2121
return false
2222
}
@@ -32,22 +32,22 @@ extension Trait where Self == ConditionTrait {
3232
}
3333
return sanityCheckCompatibility(triple: triple)
3434
}(),
35-
"Requires SWIFT_SDK_ID and SWIFT_PATH environment variables"
35+
"Requires SWIFT_SDK_ID and SWIFT_BIN_PATH environment variables"
3636
)
3737
}
3838

3939
static func requireEmbeddedSwiftInToolchain(triple: String) -> ConditionTrait {
40-
// Check if $SWIFT_PATH/../lib/swift/embedded/wasm32-unknown-none-wasm/ exists
40+
// Check if $SWIFT_BIN_PATH/../lib/swift/embedded/wasm32-unknown-none-wasm/ exists
4141
return .enabled(
4242
if: {
43-
guard let swiftPath = ProcessInfo.processInfo.environment["SWIFT_PATH"] else {
43+
guard let swiftPath = ProcessInfo.processInfo.environment["SWIFT_BIN_PATH"] else {
4444
return false
4545
}
4646
let embeddedPath = URL(fileURLWithPath: swiftPath).deletingLastPathComponent()
4747
.appending(path: "lib/swift/embedded/\(triple)")
4848
return FileManager.default.fileExists(atPath: embeddedPath.path)
4949
}(),
50-
"Requires embedded Swift SDK under $SWIFT_PATH/../lib/swift/embedded"
50+
"Requires embedded Swift SDK under $SWIFT_BIN_PATH/../lib/swift/embedded"
5151
)
5252
}
5353

@@ -75,7 +75,7 @@ extension Trait where Self == ConditionTrait {
7575
return false
7676
}
7777
}
78-
guard let swiftPath = ProcessInfo.processInfo.environment["SWIFT_PATH"],
78+
guard let swiftPath = ProcessInfo.processInfo.environment["SWIFT_BIN_PATH"],
7979
let swiftSDKID = ProcessInfo.processInfo.environment["SWIFT_SDK_ID"]
8080
else {
8181
return false
@@ -102,7 +102,7 @@ extension Trait where Self == ConditionTrait {
102102
}
103103

104104
static func getSwiftPath() -> String? {
105-
ProcessInfo.processInfo.environment["SWIFT_PATH"]
105+
ProcessInfo.processInfo.environment["SWIFT_BIN_PATH"]
106106
}
107107

108108
static func getEmbeddedSwiftSDKID() -> String? {

0 commit comments

Comments
 (0)