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

[Bug]: AssertionError: "<package>.wasm" is not a valid WASI executable #130

Open
wellcaffeinated opened this issue Apr 11, 2023 · 1 comment
Labels
category: bug Something isn't working needs-triage This ticket hasn't been triaged yet

Comments

@wellcaffeinated
Copy link

What happened?

Hi. I'm trying to use wapm and wasm-bindgen to create js/python bindings for a library i'm writing, and it works in node.js, but when i try to load the bindings in python i get this:

>>> from spdcalc import bindings
>>> spdc = bindings.spdcalc()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/wellcaffeinated/Documents/github/spdcalc/wasm/py/spdcalc/bindings/__init__.py", line 56, in spdcalc
    assert version is not None, f'"{filename}" is not a valid WASI executable'
AssertionError: "spdcalc/spdcalc.wasm" is not a valid WASI executable

My Cargo.toml contains the following meta:

[package.metadata.wapm]
namespace = "wellcaffeinated"  # Replace this with your WAPM username
abi = "wasi"
bindings = { wit-bindgen = "0.2.0", wit-exports = "spdcalc.wai" }

and I'm using the following commands to build it:

cargo wapm -d --out-dir ./wapm
wasmer-pack python ./wapm --out-dir ./py

Any help would be appreciated!

Wasmer Pack Version

wasmer-pack-cli 0.7.0

How were you using wasmer-pack?

the command-line

@wellcaffeinated wellcaffeinated added category: bug Something isn't working needs-triage This ticket hasn't been triaged yet labels Apr 11, 2023
@wellcaffeinated
Copy link
Author

wellcaffeinated commented Apr 27, 2023

More information:
This error goes away when i remove the following:

resource foo {
  test: func() -> float32
}

any resource implementing seems to give this error.

edit: However the following works:

resource foo {
  static test: func() -> float32
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug Something isn't working needs-triage This ticket hasn't been triaged yet
Projects
None yet
Development

No branches or pull requests

1 participant