Skip to content
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

Closed
wants to merge 3 commits into from

Conversation

chrissimpkins
Copy link
Member

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 with cargo 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" = fix

If these are appropriate upstream, I'd be happy to add documentation in the tutorial or README.

Comment on lines +9 to +11
NEEDLE="E0642"

! cargo build 2>&1 | grep "$NEEDLE"
Copy link
Contributor

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

Copy link
Member Author

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?

Copy link
Member Author

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.

@chrissimpkins
Copy link
Member Author

The discussion about this PR forked into a few different threads... :)

https://rust-lang.zulipchat.com/#narrow/stream/217417-t-compiler.2Fcargo-bisect-rustc/topic/Scripts.20for.20use.20with.20cargo-bisect-rustc

#34 (comment)

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.

@pnkfelix
Copy link
Member

@chrissimpkins FYI I finally posted my PR for ICE support (and more) in PR #53

@chrissimpkins
Copy link
Member Author

@pnkfelix ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants