Tips for using cargo-bisect-rustc and "--release"

I've got a program that compiles fine with the nightly from 2021-12-06 (v1.59.0), but that fails with the nightly from 2022-01-29 (1.60.0). The catch is that it only fails when compiled with --release. (this is using the wasm-unknown-emscripten target).

After a little searching, I found cargo-bisect-rustc, which seems like it should be a useful tool for narrowing down the regression. But
when I try to use it, it complains about not liking the --release argument:

$ cargo bisect-rustc -vv --start=2021-12-06 -- --release
installing nightly-2021-12-06
cargo for x86_64-unknown-linux-gnu: 6.20 MB / 6.20 MB [====================================] 100.00 % 11.83 MB/s testing...
error: Found argument '--release' which wasn't expected, or isn't valid in this context

USAGE:
    cargo [+toolchain] [OPTIONS] [SUBCOMMAND]

For more information try --help
RESULT: nightly-2021-12-06, ===> Yes
uninstalling nightly-2021-12-06

ERROR: the start of the range (nightly-2021-12-06) must not reproduce the regression

...is there a different way to invoke that command, so that it uses "--release"? Maybe a way to specify the "--release" in .cargo/config?

Thanks,
Greg

It wants a cargo subcommand, so try: cargo bisect-rustc ... -- build --release

That does seem to allow progress...

$ cargo bisect-rustc -vv --start=2021-12-06 -- build --releaseinstalling nightly-2021-12-06
cargo for x86_64-unknown-linux-gnu: 6.20 MB / 6.20 MB [====================================] 100.00 % 13.48 MB/s testing...
error: "/home/greg/.rustup/toolchains/bisector-nightly-2021-12-06-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
        rustup component add rust-src --toolchain bisector-nightly-2021-12-06-x86_64-unknown-linux-gnu
RESULT: nightly-2021-12-06, ===> Yes
uninstalling nightly-2021-12-06

ERROR: the start of the range (nightly-2021-12-06) must not reproduce the regression

...but then trying:

$ rustup component add rust-src --toolchain bisector-nightly-2021-12-06-x86_64-unknown-linux-gnu
error: bisector-nightly-2021-12-06-x86_64-unknown-linux-gnu is a custom toolchain

...has that error. Maybe this is because I need build-std = ["panic_abort", "std"] as part of the build (in the .cargo/config)?

In order to see the error message of the compiler better, interactive mode can help (i think that's -i, but feel free to double check in the --help).

Also, as a side note, you might want to specify --access=github because last time I checked that wasn't default yet, but you definitely want that.

Thanks everyone. The key was using --with-src:

cargo bisect-rustc -vv --start=2021-12-06 --with-src -- build --release

Totally misremembered, I checked the --help now and the thing I meant was --prompt :sweat_smile:

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.