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

wasm-pack build --target web panics for hello_world from a checked out repository #1680

Closed
kud1ing opened this issue Jul 27, 2019 · 2 comments
Labels

Comments

@kud1ing
Copy link

kud1ing commented Jul 27, 2019

Describe the Bug

wasm-pack build --target web on the hello_world example in a repository checkout gives a panic:

[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
    Finished release [optimized] target(s) in 0.21s
[INFO]: ⬇️  Installing wasm-bindgen...
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', crates/cli-support/src/descriptor.rs:195:15
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic_bounds_check
   9: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
  10: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
  11: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
  12: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
  13: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
  14: wasm_bindgen_cli_support::descriptor::Function::decode
  15: wasm_bindgen_cli_support::descriptor::Descriptor::_decode
  16: wasm_bindgen_cli_support::descriptors::execute
  17: wasm_bindgen_cli_support::Bindgen::_generate
  18: wasm_bindgen::main
  19: std::rt::lang_start::{{closure}}
  20: std::panicking::try::do_call
  21: __rust_maybe_catch_panic
  22: std::rt::lang_start_internal
  23: main
Error: Running the wasm-bindgen CLI
Caused by: failed to execute `wasm-bindgen`: exited with exit code: 101

Steps to Reproduce

Expected Behavior

wasm-pack build --target web should not panic.

Actual Behavior

wasm-pack build --target web panics.

Additional Context

There is no panic, if only the hello_world directory is downloaded, instead of checking out the repository.

@kud1ing kud1ing added the bug label Jul 27, 2019
@kud1ing kud1ing changed the title wasm-pack build --target web panics for hello_world wasm-pack build --target web panics for hello_world from repository Jul 27, 2019
@kud1ing kud1ing changed the title wasm-pack build --target web panics for hello_world from repository wasm-pack build --target web panics for hello_world from a checked out repository Jul 27, 2019
@alexcrichton
Copy link
Contributor

Thanks for the report! This is an issue of mismatch between the git crate and the crates.io CLI. The bug here is in wasm-bindgen itself and is tracked at #1227.

To build the examples out of the wasm-bindgen repository the best way to do it is to copy them out and then wasm-pack build should work.

@kud1ing
Copy link
Author

kud1ing commented Jul 29, 2019

Thank you.

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

No branches or pull requests

2 participants