Skip to content

Commit afabf69

Browse files
WITOverlayGenerator: Fix build with Swift 6.1
The `Extern` feature was accidentally added as an implicitly available feature in Swift 6.0, but it should have been an experimental feature. And importing with `@_implementationOnly` without library evolution is now warned about, so we need to import the shims module privately.
1 parent ee4a717 commit afabf69

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/WITOverlayGenerator/GuestGenerators/GuestPrelude.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ let guestPrelude = """
77
#if canImport(WASILibc)
88
import WASILibc
99
#endif
10+
#if compiler(>=6.0)
11+
private import _CabiShims
12+
#else
1013
@_implementationOnly import _CabiShims
14+
#endif
1115
1216
fileprivate enum Prelude {
1317
class LeakBox<Wrapped> {

Tests/WITOverlayGeneratorTests/Runtime/RuntimeTestHarness.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ struct RuntimeTestHarness {
165165
arguments: [
166166
"-target", "wasm32-unknown-none-wasm",
167167
"-enable-experimental-feature", "Embedded",
168+
"-enable-experimental-feature", "Extern",
168169
"-wmo", "-Xcc", "-fdeclspec",
169170
"-Xfrontend", "-disable-stack-protector",
170171
"-Xlinker", "--no-entry", "-Xclang-linker", "-nostdlib",
@@ -176,6 +177,7 @@ struct RuntimeTestHarness {
176177
inputFiles: inputFiles,
177178
arguments: [
178179
"-target", "wasm32-unknown-wasi",
180+
"-enable-experimental-feature", "Extern",
179181
"-static-stdlib",
180182
"-Xclang-linker", "-mexec-model=reactor",
181183
"-resource-dir", configuration.wasiSwiftSDKPath.appendingPathComponent("/swift.xctoolchain/usr/lib/swift_static").path,

0 commit comments

Comments
 (0)