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

All x.py commands fail in bootstrap: cannot find file "ci-llvm/builder-config" #130144

Closed
RalfJung opened this issue Sep 9, 2024 · 10 comments · Fixed by #130162
Closed

All x.py commands fail in bootstrap: cannot find file "ci-llvm/builder-config" #130144

RalfJung opened this issue Sep 9, 2024 · 10 comments · Fixed by #130162
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

@RalfJung
Copy link
Member

RalfJung commented Sep 9, 2024

Trying to run ./x.py check miri fails right now:

$ ./x.py check miri
Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.05s
warning: unable to check if origin/master is old due to error: Not a directory (os error 20)
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
thread 'main' panicked at src/core/config/config.rs:1237:13:
fs::read_to_string(file) failed with No such file or directory (os error 2) ("config file /home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/ci-llvm/builder-config not found")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:00

It works fine in other checkouts though. The error is correct, there is no such file -- so I guess some other part of bootstrap failed to create that file?

x.py test ui fails with the same error.

I am on commit 263a3ae, git status is clean.
Reverting back to 085744b fixes this, so seems like #129788 is the cause of the problem.

Cc @rust-lang/bootstrap

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 9, 2024
@Kobzol
Copy link
Contributor

Kobzol commented Sep 9, 2024

I think that this is the issue:

warning: unable to check if origin/master is old due to error: Not a directory (os error 20)
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

as bootstrap probably uses an old ci-llvm version in your checkout. Can you configure the remote? Otherwise you might be using an old/weird version of ci-llvm anyway, regardless of the new error.

@RalfJung
Copy link
Member Author

RalfJung commented Sep 9, 2024

The remote is configured. The warning just can't deal with worktrees (#130111). But I think that's orthogonal as I got the warning already before that most recent PR. I don't think #130111 also affects fetching the right LLVM version.

@Kobzol
Copy link
Contributor

Kobzol commented Sep 9, 2024

Ah, I see, it's the worktree issue. Well, it is orthogonal in a way, but the issue is that bootstrap now assumes that you have a recent-ish ci-llvm archive, because we have added some config file to it that is now being checked by bootstrap. Since in your case, bootstrap can't detect the master commit, is is probably also unable to download the correct (recent) ci-llvm archive. Therefore, it probably uses some old archive that misses the config file, and that causes bootstrap to fail.

When implementing the config checking, we assumed that if you are on a commit that includes the new checks, then you also have to use a recent ci-llvm. But if git detection is somehow not working, then it's possible to be on a new commit that performs the check, but also to have an old ci-llvm archive at the same time.

@RalfJung
Copy link
Member Author

RalfJung commented Sep 9, 2024

Bootstrap can detect the master commit just fine I think. ci-llvm has worked perfectly fine in worktrees for years. The warning has its own logic for checking whether the master commit is outdated, and only that logic is faulty.

@Kobzol
Copy link
Contributor

Kobzol commented Sep 9, 2024

Sorry, then I got it wrong, it was a red herring. I actually just checked that it also doesn't work for me (nor anyone else, probably). Let's quickly revert #129788 then.

@RalfJung
Copy link
Member Author

RalfJung commented Sep 9, 2024

That said, something also changed with remote branch logic recently that broke it in worktrees -- ./x.py fmt did the right thing on worktrees for years, but now it formats >5k files.

@onur-ozkan
Copy link
Member

How exactly can we reproduce this? Running x check miri on a fresh build works for me.

@onur-ozkan
Copy link
Member

I assume you have the old ci-llvm directory where it was unpacked with old bootstrap logic.

@Kobzol
Copy link
Contributor

Kobzol commented Sep 9, 2024

I see. It works when you newly extract ci-llvm, but not with an already extracted directory. So removing the build directory (or just doing x clean) is a workaround.

@lolbinarycat lolbinarycat 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 9, 2024
@onur-ozkan onur-ozkan added C-bug Category: This is a bug. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 9, 2024
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Sep 10, 2024
…obzol

bump download-ci-llvm-stamp

This should trigger the download and extraction of the ci-llvm tarball, which should resolve rust-lang#130144.
@RalfJung
Copy link
Member Author

rm build/host/ci-llvm/ -rf suffices and avoids having to re-download and re-build everything.

@bors bors closed this as completed in ca3f4ae Sep 10, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 10, 2024
Rollup merge of rust-lang#130162 - onur-ozkan:bump-ci-llvm-stamp, r=Kobzol

bump download-ci-llvm-stamp

This should trigger the download and extraction of the ci-llvm tarball, which should resolve rust-lang#130144.
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.

5 participants