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

Bump walrus to v0.20 #3483

Merged
merged 1 commit into from Nov 10, 2023
Merged

Bump walrus to v0.20 #3483

merged 1 commit into from Nov 10, 2023

Conversation

daxpedda
Copy link
Collaborator

@daxpedda daxpedda commented Jun 15, 2023

Just checking what CI says for now.

Fixes #2389.

@daxpedda
Copy link
Collaborator Author

Thank you @Liamolucko for solving the discovered issue in rustwasm/walrus#245.

@daxpedda
Copy link
Collaborator Author

daxpedda commented Jun 16, 2023

So I did try the new DWARF debugging support, but it fails pretty fast for me:

fn main() {
    panic!("test");
}

cargo build --target wasm32-unknown-unknown
wasm-bindgen target/wasm32-unknown-unknown/debug/test.wasm --target web --keep-debug

thread 'main' panicked at 'assertion failed: self.row.address_offset >= self.prev_row.address_offset', /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gimli-0.26.2/src/write/line.rs:469:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
   2: core::panicking::panic
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:117:5
   3: gimli::write::line::LineProgram::op_advance
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gimli-0.26.2/src/write/line.rs:469:9
   4: gimli::write::line::LineProgram::end_sequence
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gimli-0.26.2/src/write/line.rs:338:26
   5: walrus::module::debug::dwarf::ConvertContext<R>::convert_line_program
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/walrus-0.20.1/src/module/debug/dwarf.rs:210:33
   6: walrus::module::debug::dwarf::ConvertContext<R>::convert_attributes
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/walrus-0.20.1/src/module/debug/dwarf.rs:47:36
   7: <walrus::module::debug::ModuleDebugData as walrus::emit::Emit>::emit
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/walrus-0.20.1/src/module/debug/mod.rs:217:17
   8: walrus::module::Module::emit_wasm
             at /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/walrus-0.20.1/src/module/mod.rs:368:13
   9: wasm_bindgen_cli_support::Output::_emit
             at /home/user/rust/wasm-bindgen/crates/cli-support/src/lib.rs:655:26
  10: wasm_bindgen_cli_support::Output::emit
             at /home/user/rust/wasm-bindgen/crates/cli-support/src/lib.rs:648:9
  11: wasm_bindgen_cli_support::Bindgen::generate
             at /home/user/rust/wasm-bindgen/crates/cli-support/src/lib.rs:306:9
  12: wasm_bindgen::rmain
             at /home/user/rust/wasm-bindgen/crates/cli/src/bin/wasm-bindgen.rs:155:5
  13: wasm_bindgen::main
             at /home/user/rust/wasm-bindgen/crates/cli/src/bin/wasm-bindgen.rs:87:21
  14: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5

@daxpedda
Copy link
Collaborator Author

Took me some time to figure out how exactly Wasm DWARF debugging in the browser works in general, but got it to work.
The bug described before can just be skipped by running in release mode, because it's just a debug_assert!.

@daxpedda
Copy link
Collaborator Author

daxpedda commented Jun 17, 2023

I did some more research on this today and I think this generally works out.
Chrome doesn't require source maps but Firefox does, which was part of the initial confusion I had at first.

I'm concerned about the debug_assert! we are hitting above, but I don't know much about the details here.
@guybedford would you mind taking a look at that?
Let me know if I can do anything to help.

@daxpedda
Copy link
Collaborator Author

Currently stuck on rustwasm/walrus#247.

@d3lm
Copy link
Contributor

d3lm commented Sep 8, 2023

Any updates on this? CC @guybedford

@guybedford
Copy link

Walrus 0.20.2 has just been released thanks to @nokotan which looks like it should now resolve this issue.

@daxpedda daxpedda force-pushed the walrus-0.20 branch 2 times, most recently from 2abffb3 to 1819de8 Compare November 10, 2023 21:34
@daxpedda daxpedda marked this pull request as ready for review November 10, 2023 21:42
@daxpedda daxpedda merged commit 9fb3bca into rustwasm:main Nov 10, 2023
23 checks passed
@daxpedda
Copy link
Collaborator Author

Thanks @guybedford for the ping!
Thanks @nokotan for fixing this!

@d3lm
Copy link
Contributor

d3lm commented Nov 15, 2023

Thank you all! This is awesome 🔥

@d3lm
Copy link
Contributor

d3lm commented Nov 15, 2023

Is there a chance to get a new version published with this?

@daxpedda
Copy link
Collaborator Author

Currently waiting for an outcome on #3709, then I'm happy to push for a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We could use some help fixing this issue!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support DWARF in wasm-bindgen
3 participants