Closed kateinoigakukun closed 4 months ago
We need to unlock Data.write
Foundation APIs, and also make O_CREAT
available through WASILibc module.
/tmp/tmp.EY6vzcLx5z/.build/wasm32-unknown-wasi/debug/ExamplePackageTests.derived/runner.swift:31:31: error: value of type 'Data' has no member 'write'
_ = try? data.write(to: URL(fileURLWithPath: self.testOutputPath))
~~~~ ^~~~~
/tmp/tmp.EY6vzcLx5z/.build/wasm32-unknown-wasi/debug/ExamplePackageTests.derived/runner.swift:162:53: error: cannot find 'O_CREAT' in scope
let fd = open(lockFile.path, O_WRONLY | O_CREAT | O_CLOEXEC, 0o666)
^~~~~~~
/home/katei/ghq/work.katei.dev/swiftwasm-source/swift-wasm-DEVELOPMENT-SNAPSHOT-2023-10-31-a/usr/share/wasi-sysroot/include/__header_fcntl.h:13:9: note: macro 'O_CREAT' unavailable: structure not supported
#define O_CREAT (__WASI_OFLAGS_CREAT << 12)
^
/tmp/tmp.EY6vzcLx5z/.build/wasm32-unknown-wasi/debug/ExamplePackageTests.derived/runner.swift:396:42: error: value of type 'Bundle' has no member 'bundleIdentifier'
bundleIdentifier: testBundle.bundleIdentifier,
~~~~~~~~~~ ^~~~~~~~~~~~~~~~
SwiftPM recently introduced a new test runner and it does not support WASILibc for now. https://github.com/apple/swift-package-manager/blob/dafbae563ff2fe827ac5d3285dae718d7c7fc6b4/Sources/Build/TestObservation.swift#L126-L135