Closed
Description
I am getting this on each x.py
invocation now, since very recently:
warning: unable to check if origin/master is old due to error: No such file or directory (os error 2)
warning: origin/master is used to determine if files have been modified
warning: if it is not updated, this may cause files to be needlessly reformatted
This is in my main checkout, not in a worktree, so I am not quite sure what could even be so unusual about my setup that causes an error here.
Cc @rust-lang/bootstrap
Activity
RalfJung commentedon Oct 5, 2024
A bisect points at
That's #129584. I am surprised about the date of this PR, I think I would have noticed this earlier if this happened for a month... so probably some other factor is also involved.
Cc @lolbinarycat
RalfJung commentedon Oct 5, 2024
It seems to try to read
.git/refs/remotes/origin/master
which indeed is not a file that exists here.I also noticed this line in
.git/packed-refs
So maybe checking these files is just futile since git doesn't always use a file to track these refs?
RalfJung commentedon Oct 5, 2024
I think what happened is that
git gc
has been run, and that indeed cleans up most of the files from.git/refs/remotes
.So the current approach in bootstrap of looking at these files is not reliable. IMO we should instead look at the commit date of the most recent commit in that branch. That also avoids having to directly mess with git's internal files.
lolbinarycat commentedon Oct 5, 2024
yeah, i'm gonna accept defeat on this one.
git log
is kinda slow on my device, but only if the relevant files aren't in the i/o cache, and building rust takes a good while anyways.onur-ozkan commentedon Oct 6, 2024
#129528 is not the case anymore since refactor merge base logic and fix x fmt PR. I am planning to revert #130121 and #129584 as they are not really required.
onur-ozkan commentedon Oct 6, 2024
Seems like it will still be the case if upstream was configured and too old. But that could be fixed in a much better way (e.g., we could ignore upstream commit and use merge commit in current branch) compare to #130121 and #129584.
Rollup merge of rust-lang#131331 - onur-ozkan:131296, r=Kobzol
Unrolled build for rust-lang#131331