Open Kyle-Ye opened 2 months ago
Solved by adding the them to my Package.swift
cSettings: [
...
+ .define("_WASI_EMULATED_SIGNAL", to: "1", .when(platforms: [.wasi]))
],
linkerSettings: [
...
+ .unsafeFlags(["wasi-emulated-signal"], .when(platforms: [.wasi])),
]
),
But then encounter other issue then. (Build and run test fine with normal Linux build)
eg.
# Host OS: Ubuntu 22.04 & swift sdk download the correct WASM SDK
swift build --triple wasm32-unknown-wasi
/toolchain/swift-6.0/usr/lib/swift/CoreFoundation/CoreFoundation.h:16:10: fatal error: 'sys/types.h' file not found
16 | #include <sys/types.h>
# Host OS: Ubuntu 22.04 & swift sdk download the correct WASM SDK
swift build --swift-sdk 6.0-SNAPSHOT-2024-09-18-a-wasm32-unknown-wasi
warning: Could not read SDKSettings.json for SDK at: /home/kyle/.swiftpm/swift-sdks/swift-wasm-6.0-SNAPSHOT-2024-09-18-a-wasm32-unknown-wasi.artifactbundle/6.0-SNAPSHOT-2024-09-18-a-wasm32-unknown-wasi/wasm32-unknown-wasi/WASI.sdk
Swift version 6.0 (swift-6.0-RELEASE)
Target: wasm32-unknown-wasi
...
<unknown>:0: error: module compiled with Swift 6.0.2 cannot be imported by the Swift 6.0 compiler: xx
I guess I should wait for a final release 6.0 of WASM and test it again.
Still encounter this after I tried the latest 6.0.2 release.
This will happen when I try to include the CoreFoundation header. It used to work on 5.x version.
I'm dropping support for Swift 5.10 for all supported platform in my package.
Since WASM does not have a corresponding release yet. I'm switching to the latest 6.0 snapshot
wasm-6.0-SNAPSHOT-2024-09-18-a
toolchain. And I hit with the above error.Is there some extra param I can use to workaround it like https://github.com/swiftwasm/swift/issues/5563#issuecomment-1913533592?