rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
95.1k stars 12.26k forks source link

dist-x86_64-linux doesn't build locally, tries to combine download-ci-llvm and thin-lto #112224

Open saethlin opened 1 year ago

saethlin commented 1 year ago

I tried this code:

(I do not have a config.toml)

$ bash src/ci/docker/run.sh dist-x86_64-linux

I expected to see this happen:

The compiler is built

Instead, this happened:

thread 'main' panicked at 'setting llvm.thin_lto is incompatible with download-ci-llvm.', config.rs:1351:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Building bootstrap
Build completed unsuccessfully in 0:00:21
make: *** [prepare] Error 1

Meta

This fixes the problem?

diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
index c2fd2e3a91a..fd50df94515 100644
--- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
+++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile
@@ -76,7 +76,6 @@ ENV RUST_CONFIGURE_ARGS \
       --set target.x86_64-unknown-linux-gnu.linker=clang \
       --set target.x86_64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \
       --set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \
-      --set llvm.thin-lto=true \
       --set llvm.ninja=false \
       --set rust.jemalloc \
       --set rust.use-lld=true \
nikic commented 1 year ago

You need to run it with DEPLOY=1.

saethlin commented 1 year ago

Ah! That should be documented on this page: https://rustc-dev-guide.rust-lang.org/tests/docker.html?highlight=docker#testing-with-docker

Maybe I'll do a PR later if nobody beats me to it.

ehuss commented 1 year ago

Sorry, I've been meaning to just fix it so that DEPLOY is not necessary for it to work correctly. There have been a few discussions about this, like https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/download-ci-llvm.20if-available/near/295647929 and https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Docker.20dist-x86_64-linux.3A.20thin-lto.20incompat.20download-ci-llvm/near/315610201. Would be happy to see someone take care of it 🙂.