Skip to content

Commit bb99c98

Browse files
[WebAssembly] Create clang/lib/wasip1 symlink only if it doesn't exist (#229)
We are renaming `wasm32-unknown-wasi` to `wasm32-unknown-wasip1` for non-Embedded targets, so we will no longer have the `clang/lib/wasi`.
1 parent 84da716 commit bb99c98

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,17 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe {
195195
try await generator.createSymlink(at: autolinkExtractPath, pointingTo: "swift")
196196
}
197197

198+
// TODO: Remove this once we drop support for Swift 6.2
198199
// Embedded Swift looks up clang compiler-rt in a different path.
199200
let embeddedCompilerRTPath = pathsConfiguration.toolchainDirPath.appending(
200201
"usr/lib/swift/clang/lib/wasip1"
201202
)
202-
203-
try await generator.createSymlink(
204-
at: embeddedCompilerRTPath,
205-
pointingTo: "../../../swift_static/clang/lib/wasi"
206-
)
203+
if await !generator.doesFileExist(at: embeddedCompilerRTPath) {
204+
try await generator.createSymlink(
205+
at: embeddedCompilerRTPath,
206+
pointingTo: "../../../swift_static/clang/lib/wasi"
207+
)
208+
}
207209

208210
// Copy the WASI sysroot into the SDK bundle.
209211
let sdkDirPath = pathsConfiguration.swiftSDKRootPath.appending("WASI.sdk")

0 commit comments

Comments
 (0)