Skip to content

Commit 5ecae37

Browse files
[6.2][WebAssembly] Create clang/lib/wasip1 symlink only if it doesn't exist (#230)
Cherry-pick #229 to release/6.2 to unblock swiftlang/swift#83199 --------- Co-authored-by: Max Desiatov <[email protected]>
1 parent d393e2f commit 5ecae37

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +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(at: embeddedCompilerRTPath, pointingTo: "wasi")
203+
if await !generator.doesFileExist(at: embeddedCompilerRTPath) {
204+
try await generator.createSymlink(
205+
at: embeddedCompilerRTPath,
206+
pointingTo: "../../../swift_static/clang/lib/wasi"
207+
)
208+
}
204209

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

0 commit comments

Comments
 (0)