Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift and Grain Templates Tests Not Working #2774

Closed
rylev opened this issue Aug 27, 2024 · 4 comments · Fixed by #2789
Closed

Swift and Grain Templates Tests Not Working #2774

rylev opened this issue Aug 27, 2024 · 4 comments · Fixed by #2789

Comments

@rylev
Copy link
Collaborator

rylev commented Aug 27, 2024

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.

@fermyon fermyon deleted a comment Aug 27, 2024
@fermyon fermyon deleted a comment Aug 27, 2024
@fermyon fermyon deleted a comment from YeGop0218 Aug 27, 2024
@lann
Copy link
Collaborator

lann commented Aug 27, 2024

The Grain issue appears to be a missing newline between the header and the body, which reproduces under wasmtime run.

@lann
Copy link
Collaborator

lann commented Aug 27, 2024

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

@lann
Copy link
Collaborator

lann commented Aug 28, 2024

Duplicate imports tracked separately: #2778

@lann
Copy link
Collaborator

lann commented Aug 28, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants