You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The LLVM we ship in rust-dev doesn't match the LLVM we ship in the rustc component #110474
Instead, this happened: rustc fails to load the LLVM specification:
; rustc +stage2 --print=target-spec-json --target loongarch64-unknown-linux-gnu -Zunstable-options
error: could not create LLVM TargetMachine for triple: loongarch64-unknown-linux-gnu: No available targets are compatible with triple "loongarch64-unknown-linux-gnu"
Note that this is different from the error we emit for an unrecognized target:
; rustc +stage2 --print=target-spec-json --target unknown -Zunstable-options
error: Error loading target specification: Could not find specification for target "unknown". Run `rustc --print target-list` for a list of built-in targets
Also, this only happens for local builds, because we don't use the LLVM in the rust-dev component in rustup, only when building rustc from source.
@jyn514 Thank you for bringing this to my attention. It is possible that the locally builds has enabled llvm.download-ci-llvm, and that prebuilt LLVM does not support LoongArch architecture. It would be great if you could provide specific steps to reproduce. Thank you.
Yes, that's exactly what's happened, I have download-ci-llvm enabled and the prebuilt LLVM differs.
Here's steps to reproduce:
rm config.toml # download-ci-llvm is on by default
x build --stage 0 rustc
build/host/stage1/bin/rustc --print=target-spec-json --target loongarch64-unknown-linux-gnu -Zunstable-options
@heiher no worries :) it updates every six weeks when we make a new release, or if the submodule is updated, but it's cached until then so it's not constantly re-uploaded on every change to bootstrap.
Is there any way CI could help prevent such problems? Like, complain if compiler/rustc_llvm gets changed but the stamp file does not, or something like that?
@RalfJung we can use heuristics, but they're only heuristics and I wouldn't want to fail CI on them. That said, having rustbot leave a comment if you touch rustc_llvm or src/bootstrap/llvm.rs seems reasonable, so the PR author can make a judgement call but also doesn't forget about the stamp.
Activity
jyn514 commentedon Apr 18, 2023
cc @zhaixiaojuan @heiher, do you know what could be going wrong here?
heiher commentedon Apr 18, 2023
@jyn514 Thank you for bringing this to my attention. It is possible that the locally builds has enabled
llvm.download-ci-llvm, and that prebuilt LLVM does not support LoongArch architecture. It would be great if you could provide specific steps to reproduce. Thank you.jyn514 commentedon Apr 18, 2023
Yes, that's exactly what's happened, I have download-ci-llvm enabled and the prebuilt LLVM differs.
Here's steps to reproduce:
jyn514 commentedon Apr 18, 2023
The RustDev component builds LLVM here:
rust/src/bootstrap/dist.rs
Line 2239 in 276fa29
but I'm not sure how that differs from the
Rustccomponent?rust/src/bootstrap/dist.rs
Lines 456 to 461 in 276fa29
heiher commentedon Apr 18, 2023
I think the difference is that the
llvm.targetsof ci-llvm does not contain LoongArch, but locally it does. Is it time to update ci-llvm?nikic commentedon Apr 18, 2023
Maybe need to bump download-ci-llvm-stamp to pick up the LoongArch enablement?
Rollup merge of rust-lang#110490 - jyn514:bump-llvm, r=nikic
heiher commentedon Apr 18, 2023
@jyn514 @nikic Thank you for catching that. I was mistaken to think that the cached prebuilt ci-llvm would automatically update over time.
jyn514 commentedon Apr 18, 2023
@heiher no worries :) it updates every six weeks when we make a new release, or if the submodule is updated, but it's cached until then so it's not constantly re-uploaded on every change to bootstrap.
RalfJung commentedon Apr 20, 2023
Is there any way CI could help prevent such problems? Like, complain if
compiler/rustc_llvmgets changed but the stamp file does not, or something like that?jyn514 commentedon Apr 20, 2023
@RalfJung we can use heuristics, but they're only heuristics and I wouldn't want to fail CI on them. That said, having rustbot leave a comment if you touch rustc_llvm or src/bootstrap/llvm.rs seems reasonable, so the PR author can make a judgement call but also doesn't forget about the stamp.
Rollup merge of rust-lang#112619 - jyn514:llvm-reminder, r=Mark-Simul…
Rollup merge of rust-lang#112619 - jyn514:llvm-reminder, r=Mark-Simul…
Rollup merge of rust-lang#112619 - jyn514:llvm-reminder, r=Mark-Simul…
Rollup merge of #112619 - jyn514:llvm-reminder, r=Mark-Simulacrum