rust-lang / cargo-bisect-rustc

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

Use debug printing for anyhow errors to show the full cause and context #237

Closed ngc0202 closed 1 year ago

ngc0202 commented 1 year ago

The top-level anyhow context is often not enough for the user to fully diagnose the issue that's occurring, such as in issue #233. This changes from Display to Debug printing to show the full context and backtrace if available.

ngc0202 commented 1 year ago

As an example of the difference this makes, here's the before and after stderr output from when the commit isn't from bors as is expected:

Before:

ERROR: failed during attempt to create/access local git repository

After:

ERROR: failed during attempt to create/access local git repository

Caused by:
    Expected author Brian Anderson to be bors for beb9a0dfc52ebda4f8db4e5d439e08e4f3a43a39.
     Make sure specified commits are on the master branch!
ngc0202 commented 1 year ago

On a side not related to the error I posted as an example, it seems like this merge request was accidentally merged by someone other than bors which breaks the assumption that this tool makes about merges, meaning you seemingly can't bisect across this boundary. Should there by an exception made in the code here?

oli-obk commented 1 year ago

We should just ignore those merge commits instead of erroring on them I think.