Skip to content

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

Open
petrochenkov wants to merge 1 commit into
rust-lang:mainfrom
petrochenkov:jobtweak
Open

rustc: Tweak the effect of --jobs on frontend parallelism#160697
petrochenkov wants to merge 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.)

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

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants