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

Outdated master branch detection doesn't work with worktrees #130111

Closed
Noratrieb opened this issue Sep 8, 2024 · 1 comment · Fixed by #130121
Closed

Outdated master branch detection doesn't work with worktrees #130111

Noratrieb opened this issue Sep 8, 2024 · 1 comment · Fixed by #130121
Assignees
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@Noratrieb
Copy link
Member

When running any bootstrap command, it complains that it can't figure out whether my master branch is outdated.
Of course it does, as it just YOLOs into .git, which is just a file and not a directory for worktrees:

let branch_path = git_dir.join(".git/refs/remotes").join(&updated_master);

it should probably not do that (i don't have a suggestion on what to do instead)

regressed by #129584 @lolbinarycat @albertlarsan68

@Noratrieb Noratrieb added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-bug Category: This is a bug. labels Sep 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 8, 2024
@Noratrieb Noratrieb removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 8, 2024
@lolbinarycat
Copy link
Contributor

lolbinarycat commented Sep 8, 2024

it should probably not do that (i don't have a suggestion on what to do instead)

i would say adding a bit of error handling that checks if it's in a worktree doesn't sound too hard.

there's two options from there:

  1. never emit the warning in a worktree. this is basically trivial, but if someone does 100% of their work in a worktree, they may end up with an outdated upstream and not know it
  2. fall back to a more reliable method when in a worktree

@lolbinarycat lolbinarycat reopened this Sep 8, 2024
@lolbinarycat lolbinarycat self-assigned this Sep 8, 2024
lolbinarycat added a commit to lolbinarycat/rust that referenced this issue Sep 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 13, 2024
…ream-worktree, r=albertlarsan68

bootstrap: handle worktrees in warn_old_master_branch

fixes rust-lang#130111
@bors bors closed this as completed in 5a9b9a3 Sep 14, 2024
shrirambalaji pushed a commit to shrirambalaji/rust that referenced this issue Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants