WIP: Try to reuse PGO profiles in opt-dist by Kobzol · Pull Request #149808 · rust-lang/rust (original) (raw)



##[endgroup]
[2025-12-09T11:11:13.076Z INFO  opt_dist::timer] Section `Stage 5 (final build)` starts
[2025-12-09T11:11:13.076Z INFO  opt_dist::exec] Executing `RUST_BACKTRACE=full python3 ../x.py dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --include-default-paths build-manifest bootstrap --skip rust-docs --skip rustc-docs --skip rustc-dev --skip rust-dev --skip rust-docs-json --skip rust-analyzer --skip rustc-src --skip extended --skip clippy --skip miri --skip rustfmt --skip gcc --skip generate-copyright --skip bootstrap --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false cargo --llvm-profile-use pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/llvm-pgo.profdata --rust-profile-use pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/rustc-pgo.profdata [at /checkout/obj]`
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.06s
##[endgroup]
Skipping Set({dist::rust-docs}) because it is excluded
Skipping Set({dist::rustc-docs}) because it is excluded
---
CMAKE_x86_64-unknown-linux-gnu = None
CMAKE_x86_64_unknown_linux_gnu = None
HOST_CMAKE = None
CMAKE = None
running: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build" && CMAKE_PREFIX_PATH="" DESTDIR="" LC_ALL="C" "cmake" "/checkout/src/llvm-project/llvm" "-DLLVM_ENABLE_ASSERTIONS=OFF" "-DLLVM_UNREACHABLE_OPTIMIZE=OFF" "-DLLVM_ENABLE_PLUGINS=OFF" "-DLLVM_TARGETS_TO_BUILD=AArch64;AMDGPU;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86" "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR;M68k;CSKY;Xtensa" "-DLLVM_INCLUDE_EXAMPLES=OFF" "-DLLVM_INCLUDE_DOCS=OFF" "-DLLVM_INCLUDE_BENCHMARKS=OFF" "-DLLVM_INCLUDE_TESTS=OFF" "-DLLVM_ENABLE_LIBEDIT=OFF" "-DLLVM_ENABLE_BINDINGS=OFF" "-DLLVM_ENABLE_Z3_SOLVER=OFF" "-DLLVM_PARALLEL_COMPILE_JOBS=36" "-DLLVM_TARGET_ARCH=x86_64" "-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu" "-DLLVM_ENABLE_WARNINGS=OFF" "-DLLVM_INSTALL_UTILS=ON" "-DLLVM_PROFDATA_FILE=pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/llvm-pgo.profdata" "-DLLVM_ENABLE_ZLIB=ON" "-DLLVM_LINK_LLVM_DYLIB=ON" "-DLLVM_ENABLE_LIBXML2=OFF" "-DLLVM_VERSION_SUFFIX=-rust-1.94.0-nightly" "-DCMAKE_INSTALL_MESSAGE=LAZY" "-DCMAKE_C_COMPILER_LAUNCHER=sccache" "-DCMAKE_CXX_COMPILER_LAUNCHER=sccache" "-DCMAKE_C_COMPILER=clang" "-DCMAKE_CXX_COMPILER=clang++" "-DCMAKE_ASM_COMPILER=clang" "-DCMAKE_C_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu -fdebug-prefix-map=/checkout=/rustc/llvm" "-DCMAKE_CXX_FLAGS=-ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu -fdebug-prefix-map=/checkout=/rustc/llvm" "-DCMAKE_AR=/rustroot/bin/llvm-ar" "-DCMAKE_RANLIB=/rustroot/bin/llvm-ranlib" "-DCMAKE_SHARED_LINKER_FLAGS= -Wl,-Bsymbolic -static-libstdc++" "-DCMAKE_MODULE_LINKER_FLAGS= -Wl,-Bsymbolic -static-libstdc++" "-DCMAKE_EXE_LINKER_FLAGS= -Wl,-Bsymbolic -static-libstdc++" "-DLLVM_ENABLE_LTO=Thin" "-DLLVM_ENABLE_LLD=ON" "-DLLVM_ENABLE_ZSTD=FORCE_ON" "-DLLVM_USE_STATIC_ZSTD=TRUE" "-DCMAKE_INSTALL_PREFIX=/checkout/obj/build/x86_64-unknown-linux-gnu/llvm" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 --target=x86_64-unknown-linux-gnu" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is Clang 21.1.0
-- The CXX compiler identification is Clang 21.1.0
-- The ASM compiler identification is Clang
-- Found assembler: /rustroot/bin/clang
-- Detecting C compiler ABI info
---
##[group]Building stage2 compiler artifacts (stage1 -> stage2, x86_64-unknown-linux-gnu)
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc - --crate-name ___ --print=file-names --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zannotate-moves -Zunstable-options '--check-cfg=cfg(bootstrap)' -Zmacro-backtrace -Csplit-debuginfo=off -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Clinker-features=+lld -Clink-self-contained=-linker -Zunstable-options -Alinker-messages -Zon-broken-pipe=kill -Zdefault-visibility=protected -Zdylib-lto -Clto=thin -Cembed-bitcode=yes -Clink-args=-Wl,--icf=all -Cprofile-use=pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/rustc-pgo.profdata -Cllvm-args=-static-func-strip-dirname-prefix=2 --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg -Wwarnings` (exit status: 1)
  --- stdout
  ___
  lib___.rlib
  lib___.so
  lib___.so
---
  fmt_debug="full"
  overflow_checks
  panic="unwind"
  proc_macro
  relocation_model="pic"
  target_abi=""
  target_arch="x86_64"
  target_endian="little"
  target_env="gnu"
  target_family="unix"
  target_feature="fxsr"
  target_feature="sse"
  target_feature="sse2"
  target_feature="x87"
  target_has_atomic
  target_has_atomic="16"
  target_has_atomic="32"
  target_has_atomic="64"
  target_has_atomic="8"
  target_has_atomic="ptr"
  target_has_atomic_equal_alignment="16"
  target_has_atomic_equal_alignment="32"
  target_has_atomic_equal_alignment="64"
  target_has_atomic_equal_alignment="8"
  target_has_atomic_equal_alignment="ptr"
  target_has_atomic_load_store
  target_has_atomic_load_store="16"
  target_has_atomic_load_store="32"
  target_has_atomic_load_store="64"
  target_has_atomic_load_store="8"
  target_has_atomic_load_store="ptr"
  target_has_reliable_f128
  target_has_reliable_f16
  target_has_reliable_f16_math
  target_os="linux"
  target_pointer_width="64"
  target_thread_local
  target_vendor="unknown"
  ub_checks
  unix
  windows_raw_dylib

  --- stderr
  error: file `pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/rustc-pgo.profdata` passed to `-C profile-use` does not exist

  error: aborting due to 1 previous error

  [RUSTC-TIMING] ___ test:false 0.018
Bootstrap failed while executing `dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --include-default-paths build-manifest bootstrap --skip rust-docs --skip rustc-docs --skip rustc-dev --skip rust-dev --skip rust-docs-json --skip rust-analyzer --skip rustc-src --skip extended --skip clippy --skip miri --skip rustfmt --skip gcc --skip generate-copyright --skip bootstrap --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false cargo --llvm-profile-use pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/llvm-pgo.profdata --rust-profile-use pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/rustc-pgo.profdata`
Build completed unsuccessfully in 0:22:38
[2025-12-09T11:33:52.015Z INFO  opt_dist::timer] Section `Stage 5 (final build)` ended: FAIL (1358.94s)`
Error: Command RUST_BACKTRACE=full python3 ../x.py dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu --include-default-paths build-manifest bootstrap --skip rust-docs --skip rustc-docs --skip rustc-dev --skip rust-dev --skip rust-docs-json --skip rust-analyzer --skip rustc-src --skip extended --skip clippy --skip miri --skip rustfmt --skip gcc --skip generate-copyright --skip bootstrap --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false cargo --llvm-profile-use pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/llvm-pgo.profdata --rust-profile-use pgo-profiles/reproducible-artifacts-nightly-x86_64-unknown-linux-gnu/reproducible-artifacts/rustc-pgo.profdata [at /checkout/obj] has failed with exit code Some(1)

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc:🧵:String>
             at /rust/deps/anyhow-1.0.100/src/backtrace.rs:27:14
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/ccd98352c00c2f43a9eaf0b066172c6c86319949/src/tools/opt-dist/src/exec.rs:80:17
   2: <opt_dist::exec::Bootstrap>::run
             at /rustc/ccd98352c00c2f43a9eaf0b066172c6c86319949/src/tools/opt-dist/src/exec.rs:199:18
   3: opt_dist::main::{closure#2}
             at /rustc/ccd98352c00c2f43a9eaf0b066172c6c86319949/src/tools/opt-dist/src/main.rs:510:57
   4: <opt_dist::timer::TimerSection>::section::<opt_dist::main::{closure#2}, ()>
             at /rustc/ccd98352c00c2f43a9eaf0b066172c6c86319949/src/tools/opt-dist/src/timer.rs:111:22
   5: opt_dist::main
             at /rustc/ccd98352c00c2f43a9eaf0b066172c6c86319949/src/tools/opt-dist/src/main.rs:510:11
   6: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/ops/function.rs:250:5
   7: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/sys/backtrace.rs:158:18
   8: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/rt.rs:206:18
   9: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/ops/function.rs:287:21
  10: std::panicking::catch_unwind::do_call
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:590:40
  11: std::panicking::catch_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:553:19