From 3cd575e07fb6c8f24e719c3963c7a1319bb29067 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 28 May 2025 12:48:20 +0100 Subject: [PATCH 1/2] Fix broken symlink in `WebAssemblyRecipe.swift` `usr/lib/swift/clang/lib/wasi` directory doesn't exist in Swift SDKs for WASI, for `libclang_rt.*-wasm32.a` we should symlink to `../../../swift_static/clang/lib/wasi` instead. --- .../SwiftSDKRecipes/WebAssemblyRecipe.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift b/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift index 8497f9b..1ead7d2 100644 --- a/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift +++ b/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift @@ -200,7 +200,10 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe { "usr/lib/swift/clang/lib/wasip1" ) - try await generator.createSymlink(at: embeddedCompilerRTPath, pointingTo: "wasi") + try await generator.createSymlink( + at: embeddedCompilerRTPath, + pointingTo: "../../../swift_static/clang/lib/wasi" + ) // Copy the WASI sysroot into the SDK bundle. let sdkDirPath = pathsConfiguration.swiftSDKRootPath.appending("WASI.sdk") From c9f88a09cae5c6ce2800b0c4a2326db661fb0cb2 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Wed, 28 May 2025 12:50:14 +0100 Subject: [PATCH 2/2] Fix trailing whitespace in `WebAssemblyRecipe.swift` --- .../SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift b/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift index 1ead7d2..836b9f5 100644 --- a/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift +++ b/Sources/SwiftSDKGenerator/SwiftSDKRecipes/WebAssemblyRecipe.swift @@ -201,7 +201,7 @@ package struct WebAssemblyRecipe: SwiftSDKRecipe { ) try await generator.createSymlink( - at: embeddedCompilerRTPath, + at: embeddedCompilerRTPath, pointingTo: "../../../swift_static/clang/lib/wasi" )