pacak / cargo-show-asm

cargo subcommand showing the assembly, LLVM-IR and MIR generated for Rust code
Apache License 2.0
712 stars 35 forks source link

`cargo-asm` panics with `No cdylib?` when called in a `["lib", "cdylib"]` wasm project #292

Closed alexfertel closed 4 months ago

alexfertel commented 4 months ago

Hey! I wanted to try using this project to inspect the compiled wasm in this project, however, I get this error when I run cargo asm -p openzeppelin-stylus --wasm -vvv:

Artifact files: ["/Users/alexfertel/work/openzeppelin/rust-contracts-stylus/target/wasm32-unknown-unknown/release/libopenzeppelin_stylus.rlib", "/Users/alexfertel/work/openzeppelin/rust-contracts-stylus/target/wasm32-unknown-unknown/release/openzeppelin_stylus.wasm"]
thread 'main' panicked at /Users/alexfertel/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-show-asm-0.2.37/src/main.rs:432:14:
No cdylib?

I took a look at https://github.com/pacak/cargo-show-asm/issues/203, but it doesn't seem there's much to do on my side.

I also tried compiling the examples of that same project to no avail.

pacak commented 4 months ago

Thanks for the bugreport. Proper fix is blocked upstream https://github.com/rust-lang/cargo/issues/13672, but I made detecting mechanism a bit smarter so it's no longer crashing for me locally on your code.

alexfertel commented 4 months ago

Thank you very much! It seems to be working well now.