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

wit-component: static Resource function causes Validate to fail #1529

Closed
FrankReh opened this issue May 3, 2024 · 0 comments · Fixed by #1530
Closed

wit-component: static Resource function causes Validate to fail #1529

FrankReh opened this issue May 3, 2024 · 0 comments · Fixed by #1530

Comments

@FrankReh
Copy link

FrankReh commented May 3, 2024

Per the Zulip discussion this afternoon,

this is opened against wasm-tools. The original issue, against cargo-component, included the zip file to allow easy reproduction of the problem.

The importer.wasm file that is created seems to be the raw wasm file:
importer.wasm.gz

And here is the command line that could reproduce the problem.

wasm-tools component new ~/Downloads/importer.wasm --adapt ./wasi_snapshot_preview1.reactor.wasm

The error message:

error: failed to encode a component from module

Caused by:
    0: failed to validate component output
    1: export name `[static]my-resource.get-static` is not valid
       static resource name is not known in this context (at offset 0xb)
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue May 3, 2024
Previously the resource itself wasn't imported which meant that the
`[static]` function did not pass validation. This commit updates the
liveness of these functions to include the resource that the static
function is attached to which ensures that the type is emitted during
component construction.

Closes bytecodealliance#1529
github-merge-queue bot pushed a commit that referenced this issue May 3, 2024
Previously the resource itself wasn't imported which meant that the
`[static]` function did not pass validation. This commit updates the
liveness of these functions to include the resource that the static
function is attached to which ensures that the type is emitted during
component construction.

Closes #1529
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.

1 participant