BurtonQin / lockbud

Statically detect memory, concurrency bugs and possible panic locations for Rust.
BSD 3-Clause "New" or "Revised" License
445 stars 25 forks source link

fix: args behind `--` is not forwarded to cargo build #64

Closed zjp-CN closed 1 month ago

zjp-CN commented 1 month ago

As per the usage, stuff behind -- are passed to cargo build, so this commit fixes this.

cargo lockbud [options] [...] [--] [<program/test suite options>...]

Other [options] are the same as cargo build. Everything after the second "--" verbatim to the program.

zjp-CN commented 1 month ago

The usage is a bit confusing. It says

I think the usage makes sense as follows, and this PR is trying to achieve this

cargo lockbud [args for lockbud] [--] [args for cargo build]

e.g.

cargo +nightly-2024-05-21 lockbud -k all -- --target riscv64gc-unknown-none-elf
cargo +nightly-2024-05-21 lockbud -k all -- --target riscv64gc-unknown-none-elf -- args-to-the-compiled-binary

p.s. `cargo +nightly-2024-05-21` is from cargo, not from cargo lockbud. It demonstrates
the canonical command to be used as real detection on projects.
BurtonQin commented 1 month ago

Thanks for your fixing. There is indeed something wrong with my previous cargo parameter parsing logic.