download-ci-llvm depends on the repo clone depth
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Summary
When using llvm.download-ci-llvm (the default), the hash that gets downloaded depends on the clone depth of the rust repo. This can cause confusing behavior because the LLVM_INVALIDATION_PATHS do not entirely capture what can change LLVM, and different hashes can have different behavior.
Command used
Working on aarch64 macOS. Current main is bb779a91568ac1ee0b8a9dcb6b69219ef30b18a3.
> git clone https://github.com/rust-lang/rust.git
> cd rust
> ./x build library
....
Downloads llvm-1ed488274bec5bf5cfe6bf7a1cc089abcc4ebd68, last modified from LLVM_INVALIDATION_PATHS.
....
--- stderr
llvm-config: error: libLLVM-22-rust-1.95.0-nightly.dylib is missing
(This failure is related to https://github.com/rust-lang/rust/issues/153077, which is now fixed, but this is still picking up an old commit.)
However, doing a clone of depth 1 has different behavior:
> git clone --depth=1 https://github.com/rust-lang/rust.git
> cd rust
> ./x build library
....
Downloads llvm-bb779a91568ac1ee0b8a9dcb6b69219ef30b18a3, the current main commit.
....
Build completed successfully in 0:04:30
Expected behaviour
I don't know. Preferably always "just works", but maybe some warnings or something to at least provide some hints that a shallow clone works differently? That would probably be a lot of false positives, though.
Perhaps also LLVM_INVALIDATION_PATHS could include more things like the CI configuration, since those change the resulting LLVM build.
Actual behaviour
Build mysteriously fails and requires a lot of investigation.
Bootstrap configuration (bootstrap.toml)
# empty
Operating system
aarch64 macOS
HEAD
bb779a91568ac1ee0b8a9dcb6b69219ef30b18a3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the llvm.download-ci-llvm path used by ./x build library and inspect how clone depth selects the LLVM hash. Read the handling of LLVM_INVALIDATION_PATHS and the bootstrap configuration, then reproduce the difference between a full and depth-1 clone on aarch64 macOS. Done means the behavior is defined and the confusing failure or warning is addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100