rust-lang / cargo-bisect-rustc

Bisects rustc, either nightlies or CI artifacts
https://rust-lang.github.io/cargo-bisect-rustc/
Apache License 2.0
178 stars 55 forks source link

Add `--regress` example to tutorial. #140

Closed orium closed 2 years ago

orium commented 2 years ago

~The script must exit with 0 if there is not problem and non-zero otherwise. Since grep exits with 0 if a line matches the pattern we need to negate its exit code.~

ehuss commented 2 years ago

I believe the original is correct. It is showing how to automate the previous example, which was trying to detect when E0642 stopped being produced. That is, emitting E0642 is "good" and not emitting it is "bad".

Perhaps you can add a short comment to the script explaining what it is doing?

orium commented 2 years ago

Maybe I can give a more clear example that doesn't require explanation (and also reflect a common case):

! cargo check 2>&1 | grep 'internal compiler error'

What do you think?

ehuss commented 2 years ago

I probably wouldn't include that as a specific example as it wouldn't be something we'd expect someone to ever write. Detecting ice's is already built in (via --regress=ice). Scripts are best suited for unusual situations, and I think illustrating a real-world example (examining issue https://github.com/rust-lang/rust/issues/55036) is a good way of demonstrating what a script would actually be used for.

orium commented 2 years ago

I probably wouldn't include that as a specific example as it wouldn't be something we'd expect someone to ever write.

I did :slightly_smiling_face:. Didn't know about --regress, so I've added an example to the tutorial.