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

webidl-bindings table does not contain valid function indices #711

Closed
yurydelendik opened this issue Sep 6, 2019 · 6 comments
Closed

webidl-bindings table does not contain valid function indices #711

yurydelendik opened this issue Sep 6, 2019 · 6 comments

Comments

@yurydelendik
Copy link

🐛 Bug description

The wasm-pack executes step wasm_opt after wasm_bindgen. The wasm_bindgen generates 'webidl-bindings' table with specific function ids in it. When wasm_opt is run, the function ids changed, e.g. some import or local functions are removed, thus breaking the webidl-bindings references.

🤔 Expected Behavior

The 'webidl-bindings' table contains right indices.

👟 Steps to reproduce

(Too deep a bug chain, depends on fixes at rust-lang/rust#64187 and #654)

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: 0.8.1
rustc version:

/cc @alexcrichton

@alexcrichton
Copy link
Contributor

alexcrichton commented Sep 9, 2019

Ah yes right! For now you'll have to disable wasm-opt when using wasm interface types. @yurydelendik are you using a master-built version of wasm-pack or a prebuilt version? (I don't think the prebuilt versions run wasm-opt yet)

@yurydelendik
Copy link
Author

are you using a master-built version of wasm-pack or a prebuilt version?

I'm using the master since I need workarounds for the wasm32-wasi target.

@alexcrichton
Copy link
Contributor

Ah ok, if you do:

# ... at the end of Cargo.toml
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

does that fix the issue?

@yurydelendik
Copy link
Author

does that fix the issue?

I commented the step in the code, and it fixed the issue and allowed me to create an output wasm where wasmtime properly gets the export metadata. (I observe next issue during running of wasmtime, but I think it is unrealed)

@alexcrichton
Copy link
Contributor

Ah ok, great!

I think in the long term we would want to automatically disable wasm-opt if interface types are enabled (at least until wasm-opt has interface types support), but until that happens are you ok closing this in the meantime?

@yurydelendik
Copy link
Author

are you ok closing this in the meantime?

yes. closing

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

No branches or pull requests

2 participants