getsentry / symbolicator

Native Symbolication as a Service
https://getsentry.github.io/symbolicator/
MIT License
362 stars 51 forks source link

wasm-split documentation is incorrect #1482

Closed TonyGiorgio closed 5 months ago

TonyGiorgio commented 5 months ago

Environment

I'm trying to follow the instructions for wasm-split, in both sentry wasm docs and the README and it's incorrect in both places

docs: https://docs.sentry.io/platforms/native/guides/wasm/debug-information/ readme: https://github.com/getsentry/symbolicator/tree/master/crates/wasm-split

Steps to Reproduce

cargo build --release 

$ wasm-split file_wasm_bg.wasm -d file.debug.wasm --strip
Unknown option '--strip'

$ wasm-split file_wasm_bg.wasm -d file.debug.wasm
error: Cannot have more than one input file.
Fatal: Invalid command line arguments

$ wasm-split file_wasm_bg.wasm -o file.debug.wasm
error: Option --output cannot be used in split mode.
Fatal: Invalid command line arguments

Expected Result

I expect one of these instructions to work.

Actual Result

I get multiple CLI level errors due to documentation being incorrect in multiple places.

loewenheim commented 5 months ago

Thank you for the report and apologies for the inconvenience, we'll correct it.

loewenheim commented 5 months ago

Actually, as far as I can tell the documentation in both places is correct. Can you describe exactly how you are building and running wasm-split?

TonyGiorgio commented 5 months ago

I've done a cargo install and then I've done a built from source from master and run into those errors both times.

loewenheim commented 5 months ago

Can you post the output of wasm-split --version?

TonyGiorgio commented 5 months ago

Oops, sorry. I have a nix setup and did not realize that wasm-split was being install with binaryen which I often include in my nix setups. I was using that instead of what I was self building.

$ wasm-split --version
wasm-split version 116

$ ./wasm-split --version
wasm-split 24.5.1

After changing that, confirmed it works. Thank you!

./wasm-split my_wasm_bg.wasm -o file.debug.wasm
1a8d5699110b4bf3b8cf52aef9416632
loewenheim commented 5 months ago

Ah, the pleasures and troubles of nix. Glad I could help!