rust-lang / cargo-bisect-rustc

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

Add support for git tags in `--start` and `--end` #147

Closed Kobzol closed 2 years ago

Kobzol commented 2 years ago

First I tried to add new Bound (Version), but that required a lot of changes in the code.

I think that just adding support for arbitrary tags is more general and should hopefully work out of the box. I changed the GH resolver to use the compare API, which allows us to get commit information together with merge-base ancestor.

ehuss commented 2 years ago

Nice!

Can you add some text to the CLI help for the --start and --end flags that documents the kinds of values they support? Maybe something like [a YYYY-MM-DD date or git tag or nightly git SHA] at the end?

Kobzol commented 2 years ago

Added CLI help. Maybe we should also rename Bound::Commit to something like Bound::GitReference?

ehuss commented 2 years ago

I don't feel a particular need to rename it. However, it looks like the new code needs to be formatted.

Kobzol commented 2 years ago

Done.

ehuss commented 2 years ago

@Kobzol This seems to have broken bisecting by hash. Can you take a look at fixing it? For example:

cargo-bisect-rustc --start e08d5693609a659e45025b8ea4dbd9efa342fa68 --end ec667fbcfcd29e2b5080f6be04e229356b27e600

will error with:

bisecting ci builds
starting at e08d5693609a659e45025b8ea4dbd9efa342fa68, ending at ec667fbcfcd29e2b5080f6be04e229356b27e600
refreshing repository at "/Users/eric/Proj/rust/rust-upstream"
From https://github.com/rust-lang/rust
 * branch                    HEAD       -> FETCH_HEAD
opening existing repository at "/Users/eric/Proj/rust/rust-upstream"
fetching (via local git) commits from e08d5693609a659e45025b8ea4dbd9efa342fa68 to 175b8db73bfd078b4bcd3c28c8d6f51d5895ebf3
refreshing repository at "/Users/eric/Proj/rust/rust-upstream"
From https://github.com/rust-lang/rust
 * branch                    HEAD       -> FETCH_HEAD
opening existing repository at "/Users/eric/Proj/rust/rust-upstream"
looking up first commit
looking up second commit
checking that commits are by bors and thus have ci artifacts...
finding bors merge commits
ERROR: failed during attempt to create/access local git repository: Expected author Brian Anderson to be bors for beb9a0dfc52ebda4f8db4e5d439e08e4f3a43a39.
 Make sure specified commits are on the master branch!

I notice that the end commit has shifted from ec667fbcfcd29e2b5080f6be04e229356b27e600 to 175b8db73bfd078b4bcd3c28c8d6f51d5895ebf3.

Kobzol commented 2 years ago

It seems that the problem is that origin/master is not updated when performing merge-base. A temporary workaround is to delete the rust.git directory (or rust-upstream in your case). I will send a PR that will update origin/master before calculating merge-base ancestor.