japaric / cargo-call-stack

Whole program static stack analysis
Apache License 2.0
558 stars 50 forks source link

`error: missing `--crate-name` argument` #110

Open PureWhiteWu opened 2 months ago

PureWhiteWu commented 2 months ago

Encounter the error as title describes when calling:

cargo call-stack --bin my_bin --target x86_64-unknown-linux-gnu

The output is:

error: process didn't exit successfully: `/home/purewhite/.cargo/bin/cargo-call-stack /home/purewhite/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc -vV` (exit status: 1)
--- stderr
error: missing `--crate-name` argument

Does anyone have some ideas about this?

bauen1 commented 1 month ago

Appears to have been caused by https://github.com/rust-lang/cargo/commit/8a7ba8f8d93760f1aeeac9a0b33c641cb177cc31 where the initial rustc -vV invocation is now also passed through the wrapper specified by cargo-call-stack.

I made a very rough fix on https://github.com/bauen1/cargo-call-stack/tree/fix-missing-crate-name .

Ideally I'd like to not use the wrapper at all, e.g. something similar to https://github.com/mvertescher/cargo-call-stack/commit/7c383955a43363e9e01f04edd31ba44d99f0a2ff , and integrate this tool directly into the build, so the analyzed code is actually the code that will run.