Uh oh!
There was an error while loading. Please reload this page.
bootstrap.py: use git rev-list for robustness - #87532
Conversation
When determining which LLVM artifacts to download, bootstrap.py calls: `git log --author=bors --format=%H -n1 -m --first-parent -- src/llvm-project src/bootstrap/download-ci-llvm-stamp src/version`. However, the `-m` option has no effect, per the `git log` help: > -m > This option makes diff output for merge commits to be shown in the > default format. -m will produce the output only if -p is given as > well. The default format could be changed using log.diffMerges > configuration parameter, which default value is separate. Accordingly, this commit removes use of the -m option in favor of `--no-patch`, to make clear that this command should never output diff information, as the SHA-1 hash is the only desired output. Tested using git 2.32, this does not change the output of the command. The motivation for this change is that some patched versions of git change the behavior of the `-m` flag to imply `-p`, rather than to do nothing unless `-p` is passed. These patched versions of git lead to this script not working. Google's corp-provided git is one such example.
Use `git rev-list` instead of `git log` to be more robust against UI changes in git. Also, use the full email address for bors, because `--author` uses a substring match.
jyn514
commented
Jul 27, 2021
I don't see why we would. The reason to use
Hmm, the man page says:
I don't know why we use this in the LLVM download - I'm not confident that the first parent will always be the one with a bors author, and Either way I don't expect it to make a big difference, we say pretty clearly on https://rustc-dev-guide.rust-lang.org/git.html#no-merge-policy that you shouldn't use merge commits. |
Mark-Simulacrum
commented
Jul 27, 2021
author=bors is insufficient (in general) because clippy and potentially other repos also use bors but (obviously) don't upload the full set of rustc artifacts (or any artifacts at all today). I believe first parent means we traverse the chain of commits appropriately, always going along rust-lang/rust bors merges. |
tlyu
commented
Jul 28, 2021
I think bors might only run the CI on its auto-merge commits, not its non-merge commits? But I'd want to check with someone who knows bors/homu better.
I think that
Most of the non-bors merge commits that I see at a casual glance seem to be parts of rollup merges. Details on non-merge bors commits: but produces no output. Also, digging through So now I'm leaning towards yes on |
Only look for commits by bors that are merge commits, because those are the only ones with CI artifacts. Also, use `--first-parent` to avoid traversing stuff like rollup branches.
tlyu
commented
Jul 28, 2021
Pushed an update. Now both of them use |
tlyu
commented
Jul 28, 2021
Looks like #87513 has merged; should I rebase and/or squash? |
jyn514
commented
Aug 5, 2021
@tlyu I don't think you need to, there aren't conflicts. |
jyn514
commented
Aug 5, 2021
@bors r+ I'm not sure I buy that this is avoiding clippy commits, but it doesn't seem any worse than before, and we can fix it if something goes wrong. |
bors
commented
Aug 5, 2021
📌 Commit e0d7a59 has been approved by |
bors
commented
Aug 5, 2021
bors
commented
Aug 5, 2021
☀️ Test successful - checks-actions |
Use
git rev-listinstead ofgit logto be more robust againstUI changes in git. Also, use the full email address for bors,
because
--authoruses a substring match.Based on #87513, but is separate because it's less minimal and may require additional manual testing.
Open questions:Should themerge_basesearch also use--first-parent?Do we exclude non-merge commits from bors? There are a few, and I'm not sure what they have in common. Some of them look like squashes, and some look like they're in rollup branches.r? @jyn514
@rustbot label +A-rustbuild +C-cleanup