-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add shell scripts for use with cargo-bisect-rustc #47
Conversation
NEEDLE="E0642" | ||
|
||
! cargo build 2>&1 | grep "$NEEDLE" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to change this to use parameter expansion and let the variable set from the outer world, so this script would be more generic and you can do stuff like:
env NEEDLE="E0600" scripts/find.sh
instead of manually changing the script.
So something like:
! cargo build 2>&1 | grep "${NEEDLE:-E0642}"
should do the trick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! Thoughts about using a regex for any compiler error code as the default? Is that a common enough task or is there a better generally useful default fallback when env var is not set?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Holding on edits until #47 (comment) is settled.
The discussion about this PR forked into a few different threads... :) My understanding of the consensus is that the ideal approach is through implementation in the Rust source rather than through external scripts. I think that we all agree on this point. It sounds like @pnkfelix plans to tackle the changes in the tool. I'd be happy to pitch in on the effort if there is anything that I can do. |
@chrissimpkins FYI I finally posted my PR for ICE support (and more) in PR #53 |
@pnkfelix ty! |
This PR adds three shell scripts in a new
scripts
directory. They support the following during bisections with this tool:deicer.sh
- automate ICE identification during bisection withcargo build
, returns exit status code 1 when the stderr substring"error: internal compiler error"
is identified and ignores all other non-zero exit status code build fails (script workaround for Flag to check for internal compiler errors #34). "regression" = ICE (only)find.sh
- stdout/err stream substring search, returns exit status code 1 when stdout/err substring is identified. "regression" = identified substring in stdout/err stream.findfix.sh
- reverses the logic of the cargo build exit status to locate fixes - when build exits with 1, script exits with 0 and when build exits with 0, script exits with 1 (script workaround for feature request: Invert status #28 as recommended by kennytm). "regression" = fixIf these are appropriate upstream, I'd be happy to add documentation in the tutorial or README.