rustwasm / wasm-pack

đŸ“Ļ✨ your favorite rust -> wasm workflow tool!
https://rustwasm.github.io/wasm-pack/
Apache License 2.0
6.2k stars 404 forks source link

panic in 'binary-install' on current nightly #497

Closed cmal closed 5 years ago

cmal commented 5 years ago

🐛 Bug description

Describe your issue in detail. $ wasm-pack build

[1/10] đŸĻ€ Checking rustc version... [2/10] 🔧 Checking crate configuration... [3/10] đŸŽ¯ Adding WASM target... info: downloading component 'rust-std' for 'wasm32-unknown-unknown' info: installing component 'rust-std' for 'wasm32-unknown-unknown' [4/10] 🌀 Compiling to WASM... Updating crates.io index Downloading crates ... Downloaded wasm-bindgen v0.2.31 Downloaded console_error_panic_hook v0.1.5 Downloaded wasm-bindgen-macro v0.2.31 Downloaded wasm-bindgen-macro-support v0.2.31 Downloaded wasm-bindgen-shared v0.2.31 Downloaded wasm-bindgen-backend v0.2.31 Compiling proc-macro2 v0.4.24 Compiling unicode-xid v0.1.0 Compiling wasm-bindgen-shared v0.2.31 Compiling cfg-if v0.1.6 Compiling lazy_static v1.2.0 Compiling wasm-bindgen v0.2.31 Compiling log v0.4.6 Compiling quote v0.6.10 Compiling syn v0.15.26 Compiling wasm-bindgen-backend v0.2.31 Compiling wasm-bindgen-macro-support v0.2.31 Compiling wasm-bindgen-macro v0.2.31 Compiling console_error_panic_hook v0.1.5 Compiling wasm-game-of-life v0.1.0 (/Users/yuzhao/gits/mobile/wasm-pack-template) Finished release [optimized] target(s) in 35.02s [5/10] 📂 Creating a pkg directory... [6/10] 📝 Writing a package.json... ℹī¸ [INFO]: Optional fields missing from Cargo.toml: 'description', 'repository', and 'license'. These are not necessary, but recommended [7/10] đŸ‘¯ Copying over your README... [8/10] No LICENSE found in Cargo.toml, skipping... [9/10] âŦ‡ī¸ Installing wasm-bindgen... Updating crates.io index Downloading crates ... Downloaded wasm-bindgen-cli v0.2.31 Installing wasm-bindgen-cli v0.2.31 Downloading crates ... Downloaded wasm-bindgen-cli-support v0.2.31 Downloaded rouille v3.0.0 Downloaded docopt v1.0.2 Downloaded wasm-bindgen-threads-xform v0.2.31 Downloaded wasm-bindgen-gc v0.2.31 Downloaded wasm-bindgen-wasm-interpreter v0.2.31 Downloaded term v0.5.1 Downloaded threadpool v1.7.1 Downloaded multipart v0.15.4 Downloaded tiny_http v0.6.2 Downloaded buf_redux v0.8.1 Downloaded chunked_transfer v0.3.1 Downloaded mime_guess v1.8.6 Downloaded twoway v0.1.8 Downloaded ascii v0.8.7 Downloaded safemem v0.2.0 Compiling semver-parser v0.7.0 Compiling libc v0.2.47 Compiling autocfg v0.1.1 Compiling version_check v0.1.5 Compiling proc-macro2 v0.4.24 Compiling rand_core v0.3.0 Compiling unicode-xid v0.1.0 Compiling siphasher v0.2.3 Compiling num-traits v0.2.6 Compiling cfg-if v0.1.6 Compiling cc v1.0.28 Compiling failure_derive v0.1.5 Compiling num-integer v0.1.39 Compiling matches v0.1.8 Compiling pkg-config v0.3.14 Compiling unicode-normalization v0.1.7 Compiling rustc-demangle v0.1.13 Compiling serde v1.0.84 Compiling ryu v0.2.7 Compiling httparse v1.3.3 Compiling percent-encoding v1.0.1 Compiling ucd-util v0.1.3 Compiling regex v1.1.0 Compiling remove_dir_all v0.5.1 Compiling lazy_static v1.2.0 Compiling byteorder v1.2.7 Compiling safemem v0.2.0 Compiling wasm-bindgen-shared v0.2.31 Compiling quick-error v1.2.2 Compiling itoa v0.4.3 Compiling chunked_transfer v0.3.1 Compiling utf8-ranges v1.0.2 Compiling ascii v0.8.7 Compiling safemem v0.3.0 Compiling termcolor v1.0.4 Compiling sha1 v0.6.0 Compiling strsim v0.7.0 Compiling log v0.4.6 Compiling rand_hc v0.1.0 Compiling rand_xorshift v0.1.1 Compiling rand_isaac v0.1.1 Compiling rand_core v0.2.2 Compiling unicode-bidi v0.3.4 Compiling unicase v1.4.2 Compiling memchr v2.1.2 Compiling rand_chacha v0.1.1 Compiling rand v0.6.4 Compiling backtrace v0.3.13 Compiling semver v0.9.0 Compiling regex-syntax v0.6.4 Compiling thread_local v0.3.6 Compiling humantime v1.2.0 Compiling parity-wasm v0.35.7 Compiling base64 v0.9.3 Compiling term v0.5.1 Compiling log v0.3.9 Compiling mime v0.2.6 Compiling rustc_version v0.2.3 Compiling rand_os v0.1.1 Compiling rand v0.4.5 Compiling time v0.1.42 Compiling num_cpus v1.9.0 Compiling filetime v0.2.4 Compiling atty v0.2.11 Compiling socket2 v0.3.8 Compiling rand v0.5.5 Compiling libz-sys v1.0.25 Compiling curl-sys v0.4.16 Compiling threadpool v1.7.1 Compiling quote v0.6.10 Compiling rand_pcg v0.1.1 Compiling phf_shared v0.7.24 Compiling tempdir v0.3.7 Compiling twoway v0.1.8 Compiling buf_redux v0.8.1 Compiling aho-corasick v0.6.9 Compiling wasm-bindgen-gc v0.2.31 Compiling wasm-bindgen-wasm-interpreter v0.2.31 Compiling chrono v0.4.6 Compiling phf v0.7.24 Compiling syn v0.15.26 Compiling curl v0.4.19 Compiling serde_json v1.0.35 Compiling phf_generator v0.7.24 Compiling tempfile v3.0.5 Compiling phf_codegen v0.7.24 Compiling mime_guess v1.8.6 Compiling env_logger v0.6.0 Compiling multipart v0.15.4 Compiling idna v0.1.5 Compiling synstructure v0.10.1 Compiling serde_derive v1.0.84 Compiling failure v0.1.5 Compiling wasm-bindgen-threads-xform v0.2.31 Compiling wasm-bindgen-cli-support v0.2.31 Compiling docopt v1.0.2 Compiling url v1.7.2 Compiling tiny_http v0.6.2 Compiling rouille v3.0.0 Compiling wasm-bindgen-cli v0.2.31 Finished release [optimized] target(s) in 1m 47s Installing /Users/yuzhao/Library/Caches/.wasm_pack/.wasm-bindgen-cargo-install-0.2.31 Installing /Users/yuzhao/Library/Caches/.wasm_pack/.wasm-bindgen-cargo-install-0.2.31 Installing /Users/yuzhao/Library/Caches/.wasm_pack/.wasm-bindgen-cargo-install-0.2.31 warning: be sure to add `/Users/yuzhao/Library/Caches/.wasm_pack/.wasm-bindgen-cargo-in | [10/10] 🏃‍♀ī¸ Running WASM-bindgen... Well, this is embarrassing.

wasm-pack had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/var/folders/tc/7wl_q01x7zz6cpktgfs1dbjh0000gn/T/report-a8499ec2-5e83-4c87-a383-e8c77c2f0031.toml". Submit an issue or email with the subject of "wasm-pack Crash Report" and include the report as an attachment.

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!

🤔 Expected Behavior

What should have happened?

👟 Steps to reproduce

Clear steps describing how to reproduce the issue, including commands and flags run. If you are seeing an error, please include the full error message and stack trace.

🌍 Your environment

Mac OS X 18.2.0 Darwin Kernel Version 18.2.0: Fri Oct 5 19:41:49 PDT 2018; root:xnu-4903.221.2~2/RELEASE_X86_64 x86_64 Include the relevant details of your environment. wasm-pack version: 0.6.0 rustc version: rustc 1.33.0-nightly (d99a320cb 2018-12-18)

ashleygwilliams commented 5 years ago

hi! it looks like wasm-pack paniced during the wasm-bindgen stage. could you send me the code you were running it wasm-pack on by any chance? i'll dive into debugging this today, but as many details as you can provide will be useful!

ashleygwilliams commented 5 years ago

i've run this using rust nightly 1-10 and wasm-pack 0.6.0 on my MacOS machine and was not able to reproduce the issue- so if you're able to share the repo that will really help! thanks!

fitzgen commented 5 years ago

We have generated a report file at "/var/folders/tc/7wl_q01x7zz6cpktgfs1dbjh0000gn/T/report-a8499ec2-5e83-4c87-a383-e8c77c2f0031.toml". Submit an issue or email with the subject of "wasm-pack Crash Report" and include the report as an attachment.

@cmal, do you have the report file that was generated still? That would be useful for getting the backtrace and panic message. Thanks!

scaevola commented 5 years ago

Hi, I have the same issue as I was trying to build this code without any modification:

name = 'wasm-pack' operating_system = 'unix:Manjaro' crate_version = '0.6.0' explanation = ''' Panic occurred in file 'binary-install/src/lib.rs' at line 231 ''' method = 'Panic' backtrace = ''' stack backtrace: 0: backtrace::backtrace::trace_unsynchronized::he1d27e8b92e94a04 (0x8491a6) 1: backtrace::capture::Backtrace::create::h43aaae9b1576411f (0x8485c7) 2: backtrace::capture::Backtrace::new::h520d7233ea5cce4d (0x8484ed) 3: human_panic::report::Report::new::h839cde9df45b1308 (0x7a4bb2) 4: human_panic::handle_dump::h134ff11bed5e05e1 (0x7a4287) 5: wasm_pack::main::{{closure}}::h8c72e8f29a31a3e7 (0x408748) 6: std::panicking::rust_panic_with_hook::h3927f23cac16933b (0x8768a9) at src/libstd/panicking.rs:482 7: std::panicking::continue_panic_fmt::hf2eb4b7fbec2bc50 (0x876351) at src/libstd/panicking.rs:385 8: std::panicking::begin_panic_fmt::hf3a851d1ec2578b2 (0x87629e) at src/libstd/panicking.rs:340 9: binary_install::Download::binary::h3fe5a707e9048ec4 (0x4a15c7) 10: wasm_pack::bindgen::wasm_bindgen_build::hada59395949e052f (0x43cc9e) 11: wasm_pack::command::build::Build::step_run_wasm_bindgen::h57686dd5c3471621 (0x490828) 12: wasm_pack::command::build::Build::run::h2a0877cd0b323cd9 (0x48f355) 13: wasm_pack::command::run_wasm_pack::he9a1667742204c98 (0x40ec0f) 14: wasm_pack::main::h7d196ec5bc2839af (0x4082be) 15: std::rt::lang_start::{{closure}}::h021dcbffeaea1e4d (0x4091f2) 16: std::rt::lang_start_internal::{{closure}}::h36f064ec31842c10 (0x8761d2) at src/libstd/rt.rs:49 std::panicking::try::do_call::h5734c2c7b9290285 at src/libstd/panicking.rs:297 17: __rust_maybe_catch_panic (0x87fda9) at src/libpanic_unwind/lib.rs:92 18: std::panicking::try::h56a23a8ffce2643b (0x876c59) at src/libstd/panicking.rs:276 std::panic::catch_unwind::heb58e2bbe237901c at src/libstd/panic.rs:388 std::rt::lang_start_internal::h493cdeb796ce7e8a at src/libstd/rt.rs:48 19: main (0x4087c1)'''

scaevola commented 5 years ago

I was using nightly. I've tried to build with stable and it worked.

ashleygwilliams commented 5 years ago

@scaevola thank you for the details notes and repo to reproduce with! i'll check it out!

ashleygwilliams commented 5 years ago

likely related: https://github.com/rustwasm/wasm-pack/issues/503

ashleygwilliams commented 5 years ago

so i have run this on rustc 1.33.0-nightly (c2d381d39 2019-01-10) and it works. updating my nightly and trying again. will update.

ashleygwilliams commented 5 years ago

hrm. just ran on latest nightly (rustc 1.33.0-nightly (e2f221c75 2019-01-15)) and it also worked.

cmal commented 5 years ago

@ashleygwilliams a.zip Sorry for forgetting the file. I am using nix package manager. I think it not does work if rust toolchain was installed using nix. I say that because today I re-installed rust toolchain on my Mac by running the curl https://sh.rustup.rs -sSf | sh, and reinstall wasm-pack, everything works well now. (But still I hope that nix package manager can have a working rust toolchain. )