Skip to content

rustc: Tweak the effect of --jobs on frontend parallelism - #160697

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
petrochenkov:jobtweak
Sep 16, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
petrochenkov:jobtweak

Conversation

@petrochenkov

Copy link
Copy Markdown
Contributor

We need to be able to express both of these things for the frontend parallelism:

  • "Use exactly N threads", --jobs-frontend=N does this.
  • "Use some default number of threads, but not larger than N", --jobs=N will do it after this PR.
    The "default number" may be 1 now, or 2 during the upcoming nightly testing, or 4 or 8 after the stabilization if we decide to cap the parallelism.

Part of rust-lang/compiler-team#1005.
r? @bjorn3

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 7, 2026
- otherwise if `jobs` is passed, then it is used as the limit,
- otherwise `32` is used as the limit or there's no limit in case of an inherited jobserver,
this default may change.
- otherwise the number of available logical CPUs is used as the limit, this default may change.

@petrochenkov petrochenkov Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to update this in #160387.

View changes since the review

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/pass-dep/libc/libc-time.rs ... ok
tests/pass-dep/libc/libc-time.rs (revision `run`) ... ok

FAILED TEST: tests/pass-dep/libc/libc-epoll-blocking.rs (revision `edge_triggered.run`)
command: MIRI_BE_RUSTC="host" MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-skf8TS" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass-dep/libc/libc-epoll-blockingedge_triggered"

error: test got exit status: 101, but expected 0
##[error]   --> tests/pass-dep/libc/libc-epoll-blocking.rs:316:58
    |
316 |                 let data = read_exact_array::<4>(fds[0]).unwrap();
    |                                                          ^^^^^^^^^ called `Result::unwrap()` on an `Err` value: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" }
    |

full stderr:

---
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close::{closure#0}
   4: std::thread::scoped::scope::<libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close::{closure#0}, ()>::{closure#0}
   5: <core::panic::unwind_safe::AssertUnwindSafe<std::thread::scoped::scope<libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close::{closure#0}, ()>::{closure#0}> as core::ops::function::FnOnce<()>>::call_once
   6: std::panicking::catch_unwind::do_call::<core::panic::unwind_safe::AssertUnwindSafe<std::thread::scoped::scope<libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close::{closure#0}, ()>::{closure#0}>, ()>
   7: __rust_try
   8: std::panicking::catch_unwind::<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::scoped::scope<libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close::{closure#0}, ()>::{closure#0}>>
   9: std::thread::scoped::scope::<libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close::{closure#0}, ()>
  10: libc_epoll_blocking::waiting_threads_unblocked_after_socketpair_close
  11: libc_epoll_blocking::main
  12: <fn() as core::ops::function::FnOnce<()>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

full stdout:
---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.7/src/lib.rs:365

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/miri/855274d73082e308/out/ui-855274d73082e308` (exit status: 1)
Bootstrap failed while executing `Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:197:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:770:19

Command has failed. Rerun with -v to see more details.
test --stage 2 miri cargo-miri`
Currently active steps:
test::Miri { target: x86_64-unknown-linux-gnu } at src/bootstrap/src/core/build_steps/test.rs:696
Build completed unsuccessfully in 0:46:29
  local time: Fri Aug  7 13:23:19 UTC 2026

@petrochenkov

Copy link
Copy Markdown
Contributor Author

(Unrelated failure in libc tests.)

@petrochenkov

Copy link
Copy Markdown
Contributor Author

ping @bjorn3, it's been 3.5 weeks

@bjorn3

bjorn3 commented Sep 15, 2026

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3e034b3 has been approved by bjorn3

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 15, 2026
rustc: Tweak the effect of `--jobs` on frontend parallelism

We need to be able to express both of these things for the frontend parallelism:
- "Use exactly `N` threads", `--jobs-frontend=N` does this.
- "Use some default number of threads, but not larger than `N`", `--jobs=N` will do it after this PR.
  The "default number" may be 1 now, or 2 during the upcoming nightly testing, or 4 or 8 after the stabilization if we decide to cap the parallelism.

Part of rust-lang/compiler-team#1005.
r? @bjorn3
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 15, 2026
@rust-bors

rust-bors Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

💔 Test for a6a189b failed: CI. Failed job:

@petrochenkov

Copy link
Copy Markdown
Contributor Author

@bors retry

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 16, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
Rollup of 10 pull requests

Successful merges:

 - #156216 (implement const Iterator for Range)
 - #160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism)
 - #162748 (Enable LLVM Thin LTO for LoongArch64)
 - #162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`))
 - #162794 (Simplify `ast::UseTreeKind`)
 - #162800 (Cleanups related to RefDecodable)
 - #162826 (wasm: fix ABI for enums with integer layout and ZST fields)
 - #159359 ([rustc_public] Enhance PassMode API)
 - #162196 (Offload cmake cleanups)
 - #162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
@rust-bors
rust-bors Bot merged commit 75721d1 into rust-lang:main Sep 16, 2026
6 of 14 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 16, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 16, 2026
Rollup merge of #160697 - petrochenkov:jobtweak, r=bjorn3

rustc: Tweak the effect of `--jobs` on frontend parallelism

We need to be able to express both of these things for the frontend parallelism:
- "Use exactly `N` threads", `--jobs-frontend=N` does this.
- "Use some default number of threads, but not larger than `N`", `--jobs=N` will do it after this PR.
  The "default number" may be 1 now, or 2 during the upcoming nightly testing, or 4 or 8 after the stabilization if we decide to cap the parallelism.

Part of rust-lang/compiler-team#1005.
r? @bjorn3
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Sep 17, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#156216 (implement const Iterator for Range)
 - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism)
 - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64)
 - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`))
 - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`)
 - rust-lang/rust#162800 (Cleanups related to RefDecodable)
 - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields)
 - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API)
 - rust-lang/rust#162196 (Offload cmake cleanups)
 - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
pull Bot pushed a commit to asukaminato0721/rust-clippy that referenced this pull request Sep 17, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#156216 (implement const Iterator for Range)
 - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism)
 - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64)
 - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`))
 - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`)
 - rust-lang/rust#162800 (Cleanups related to RefDecodable)
 - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields)
 - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API)
 - rust-lang/rust#162196 (Offload cmake cleanups)
 - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Sep 17, 2026
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#156216 (implement const Iterator for Range)
 - rust-lang/rust#160697 (rustc: Tweak the effect of `--jobs` on frontend parallelism)
 - rust-lang/rust#162748 (Enable LLVM Thin LTO for LoongArch64)
 - rust-lang/rust#162769 (Yeet the `DeepRegionResolver` (earlier called `OpportunisticRegionResolver`))
 - rust-lang/rust#162794 (Simplify `ast::UseTreeKind`)
 - rust-lang/rust#162800 (Cleanups related to RefDecodable)
 - rust-lang/rust#162826 (wasm: fix ABI for enums with integer layout and ZST fields)
 - rust-lang/rust#159359 ([rustc_public] Enhance PassMode API)
 - rust-lang/rust#162196 (Offload cmake cleanups)
 - rust-lang/rust#162818 (Add regression test for malformed RPITIT bound ICE with the new solver)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants