Skip to content

Use PGO for Cargo#159149

Draft
Kobzol wants to merge 7 commits into
rust-lang:mainfrom
Kobzol:bootstrap-pgo-cargo
Draft

Use PGO for Cargo#159149
Kobzol wants to merge 7 commits into
rust-lang:mainfrom
Kobzol:bootstrap-pgo-cargo

Conversation

@Kobzol

@Kobzol Kobzol commented Jul 11, 2026

Copy link
Copy Markdown
Member

Based on #159091.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Jul 11, 2026
@Kobzol

Kobzol commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 11, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 11, 2026
@rust-bors

rust-bors Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 0109abd failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@Kobzol Kobzol force-pushed the bootstrap-pgo-cargo branch from 5b7c55c to 6fc8fbe Compare July 11, 2026 21:31
@Kobzol

Kobzol commented Jul 11, 2026

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 11, 2026
@rust-bors

rust-bors Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 7353424 failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-x86_64-linux-quick failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1`
[2026-07-11T21:44:16.825Z INFO  opt_dist::timer] Section `Stage 1 (Rustc + rustdoc PGO)` starts
[2026-07-11T21:44:16.825Z INFO  opt_dist::timer] Section `Stage 1 (Rustc + rustdoc PGO) > Build PGO instrumented rustc and LLVM` starts
##[endgroup]
[2026-07-11T21:44:16.825Z INFO  opt_dist::exec] Executing `RUST_BACKTRACE=full python3 /checkout/x.py build --target x86_64-unknown-linux-gnu --host x86_64-unknown-linux-gnu --stage 2 library/std rustdoc cargo --set rust.llvm-bitcode-linker=false --set build.extended=false --set rust.codegen-backends=['llvm'] --set rust.deny-warnings=false --set pgo.rustc.generate="/tmp/tmp-multistage/opt-artifacts/rustc-pgo" --set pgo.cargo.generate="/tmp/tmp-multistage/opt-artifacts/rustc-pgo" --set pgo.rustdoc.generate="/tmp/tmp-multistage/opt-artifacts/rustc-pgo" --set llvm.thin-lto=false --set llvm.link-shared=true [at /checkout/obj]`
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.06s
##[endgroup]
[TIMING:start] compile::Assemble { target_compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false } }
[TIMING:start] builder::Libdir { compiler: Compiler { stage: 2, host: x86_64-unknown-linux-gnu, forced_compiler: false }, target: x86_64-unknown-linux-gnu }
---
   7: std::sys::backtrace::__rust_begin_short_backtrace::<fn(), ()>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/sys/backtrace.rs:166:18
   8: std::rt::lang_start::<()>::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:206:18
   9: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:287:21
  10: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
  11: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:544:19
  12: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panic.rs:359:14
  13: std::rt::lang_start_internal::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:175:24
  14: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
---

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
             at /rust/deps/anyhow-1.0.102/src/backtrace.rs:10:14
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/exec.rs:81:17
   2: opt_dist::training::gather_pgo_profiles::{closure#0}
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/training.rs:181:14
   3: opt_dist::utils::with_log_group::<opt_dist::training::gather_pgo_profiles::{closure#0}, core::result::Result<(), anyhow::Error>>
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/utils/mod.rs:68:22
   4: opt_dist::training::gather_pgo_profiles
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/training.rs:178:5
   5: opt_dist::training::gather_rustc_profiles
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/training.rs:152:5
   6: opt_dist::execute_pipeline::{closure#1}::{closure#1}
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/main.rs:267:17
   7: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/timer.rs:111:22
   8: opt_dist::execute_pipeline::{closure#1}
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/main.rs:266:39
   9: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}, (opt_dist::training::RustcPGOProfile, opt_dist::training::RustdocPGOProfile)>
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/timer.rs:111:22
  10: opt_dist::execute_pipeline
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/main.rs:243:15
  11: opt_dist::main
             at /rustc/735342468e0566d88544968347cc4d9c52847b18/src/tools/opt-dist/src/main.rs:485:18
  12: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:250:5
  13: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/sys/backtrace.rs:166:18
  14: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:206:18
  15: <&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe as core::ops::function::FnOnce<()>>::call_once
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/core/src/ops/function.rs:287:21
  16: std::panicking::catch_unwind::do_call::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40
  17: std::panicking::catch_unwind::<i32, &dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:544:19
  18: std::panic::catch_unwind::<&dyn core::ops::function::Fn<(), Output = i32> + core::marker::Sync + core::panic::unwind_safe::RefUnwindSafe, i32>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panic.rs:359:14
  19: std::rt::lang_start_internal::{closure#0}
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/rt.rs:175:24
  20: std::panicking::catch_unwind::do_call::<std::rt::lang_start_internal::{closure#0}, isize>
             at /rustc/0417c25868d6dfbd1c291dfeae950504faa6f790/library/std/src/panicking.rs:581:40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants