Swift and Grain Templates Tests Not Working
rylev opened this issue · 4 comments
After the Factors work the Swift and Grain templates have stopped working:
Swift
When the http_swift_template_smoke_test
test is run, the following error appears:
Error: preparing wasm "/tmp/t68d4-a/main.wasm"
Caused by:
This Wasm module appears to have been compiled with wasi-sdk version <19 which contains a critical memory safety bug. For more information, see: https://github.com/fermyon/spin/issues/2552
The Swift toolchain uses a fairly old version of wasi-sdk. It is possible that a newer version of the Swift toolchain would work, but as of yet we've not been able to get things working.
Grain
When the http_grain_template_smoke_test
test is run, the following error appears:
Error: Expected status 200 for / but got 500
Body: 'Exactly one of 'location' or 'content-type' must be specified'
Stderr: '2024-08-27T15:11:00.204342Z ERROR spin_http::wagi: HTTP 500 error error=Exactly one of 'location' or 'content-type' must be specified
Most likely the wagi module is not giving any output and thus there are no headers to parse leading to the error. Why this would be happy is not clear at the moment.
For now, we will be turning off both tests while we continue to investigate.
The Grain issue appears to be a missing newline between the header and the body, which reproduces under wasmtime run
.
A newer versions of Grain (0.6.6) fixes the newline issue but has an exciting new problem: it emits duplicate imports which are permitted in core wasm modules but forbidden in component model modules. Deduping imports as part of componentization may be a plausible fix here.
Edit: Deeper problems: grain-lang/grain#2153
I'm not sure how plausible it is to get the Swift template working again; SwiftWasm 5.10 appears to be producing uncomponentizable modules.
Given that the current Swift template is WAGI-only and - since it doesn't use wit-bindgen - supports only very limited host functionality, I would vote for dropping the template until we have better tooling.