Skip to content

Rollup of 7 pull requests#152876

Closed
jhpratt wants to merge 14 commits intorust-lang:mainfrom
jhpratt:rollup-MlcRd6F
Closed

Rollup of 7 pull requests#152876
jhpratt wants to merge 14 commits intorust-lang:mainfrom
jhpratt:rollup-MlcRd6F

Conversation

@jhpratt
Copy link
Member

@jhpratt jhpratt commented Feb 20, 2026

Successful merges:

r? @ghost

Create a similar rollup

haampie and others added 14 commits February 5, 2026 09:53
When bootstrapping Rust, the `-j N` flag was passed to CMake, which was
then forwarded to Ninja. This prevents the jobserver from being used,
and as a result leads to oversubscription when Rust is just one of the
many packages built as part of a larger software stack.

Since Cargo and the Rust compiler have long supported the jobserver, it
would be good if also bootstrapping Rust itself would participate in the
protocol, leading to composable parallelism.

This change allows bootstrapping to respect an existing FIFO based
jobserver. Old pipe based jobservers are not supported, because they are
brittle: currently the Python scripts in bootstrap do not inherit the
file descriptors, but do pass on `MAKEFLAGS`. Because Ninja only
supports FIFO based jobservers, it's better to focus on new jobservers
only.

In summary:

* Bootstrap Cargo passes `MAKEFLAGS` verbatim to subprocesses if it
  advertises a FIFO style jobserver, otherwise it unsets it.
* `llvm.rs` does not pass `-j` to `cmake` when a FIFO style jobserver is
  set in `MAKEFLAGS.
* Bootstrap Cargo no longer unsets `MKFLAGS`: from git blame, GNU Make
  considered it a historical artifact back in 1992, and it is never read
  by GNU Make, it's only set for backwards compatibility.

Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
And `install src` with `build.docs = false`.
`use _` is never valid, so it should not be suggested as a similar name.
…observer-protocol, r=clubby789

bootstrap: respect POSIX jobserver

When bootstrapping Rust, the `-j N` flag was passed to CMake, which was
then forwarded to Ninja. This prevents the jobserver from being used,
and as a result leads to oversubscription when Rust is just one of the
many packages built as part of a larger software stack.

Since Cargo and the Rust compiler have long supported the jobserver, it
would be good if also bootstrapping Rust itself would participate in the
protocol, leading to composable parallelism.

This change allows bootstrapping to respect an existing FIFO based
jobserver. Old pipe based jobservers are not supported, because they are
brittle: currently the Python scripts in bootstrap do not inherit the
file descriptors, but do pass on `MAKEFLAGS`, which has lead to errors
like "invalid file descriptor" in the past. Because Ninja only supports
FIFO based jobservers, it's better to focus on new jobservers only,
which shouldn't suffer from the "invalid file descriptor" issue.

In summary:

* Bootstrap Cargo passes `MAKEFLAGS` verbatim to subprocesses if it
  advertises a FIFO style jobserver, otherwise it unsets it. This ensures
  subprocesses respect the jobserver during bootstrap.
* `llvm.rs` does not pass `-j` to `cmake` when a FIFO style jobserver is
  set in `MAKEFLAGS`. This ensures Ninja respects the jobserver.
* Bootstrap Cargo no longer unsets `MKFLAGS`: from git blame, GNU Make
  considered it a historical artifact back in 1992, and it is never read
  by GNU Make, it's only set for backwards compatibility in case sub-Makefiles
  read it.

---

I've tested this with the [Spack package manager](https://github.com/spack/spack) starting the POSIX jobserver,
building node.js and rust in parallel with `-j16`, which looks like this:

```console
$ pstree 382710
python3─┬─python3
        └─python3─┬─python3─┬─make───make───6*[ccache───g++───cc1plus]
                  │         └─{python3}
                  └─python3─┬─python3.11───bootstrap───cmake───ninja-build───10*[sh───ccache───g++───cc1plus]
                            └─{python3}
```

As you can see there are 10 `g++` processes running for rust, and `6` for node.js, and
with a mix of `make` and `ninja` as build tools :).

(The only violation I see now is `rust-lld`, but I think that'll be fixed with the LLVM 23
release)
DOC: do not link to "nightly" in Iterator::by_ref() docstring

I happened to see that the link in the docstring https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.by_ref points to the "nightly" docs instead of "stable".

I'm not sure if my fix actually works because I didn't get `cargo doc` to run on my local computer.
…docs, r=clubby789

Add bootstrap snapshot tests for {`install`, `install src`}

And `install src` with `build.docs = false`.

This is mostly to get coverage for the baseline to make it easier to review rust-lang#150845.
…ercote

Clarify some variable names in the query proc-macro

These are some cleanups to the `rustc_macros::query`, extracted from rust-lang#152833.

r? nnethercote
Fix typo in doc for core::mem::type_info::Struct
…ort-suggestion, r=Kivooeo

resolve: do not suggest `_` for unresolved imports

Fix invalid unresolved-import suggestion when a module contains an item named `_`.

`use _` is never valid syntax, so `_` should not be suggested as a similar name.

Closes rust-lang#152812
std::ops::ControlFlow - use "a" before `Result`

Rather than "an"
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 20, 2026
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 20, 2026
@jhpratt
Copy link
Member Author

jhpratt commented Feb 20, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

📌 Commit f16f7d5 has been approved by jhpratt

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 Feb 20, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 20, 2026
Rollup of 7 pull requests

Successful merges:

 - #152057 (bootstrap: respect POSIX jobserver)
 - #152818 (DOC: do not link to "nightly" in Iterator::by_ref() docstring)
 - #152840 (Add bootstrap snapshot tests for {`install`, `install src`})
 - #152846 (Clarify some variable names in the query proc-macro)
 - #152858 (Fix typo in doc for core::mem::type_info::Struct)
 - #152861 (resolve: do not suggest `_` for unresolved imports)
 - #152873 (std::ops::ControlFlow - use "a" before `Result`)
@Zalathar
Copy link
Member

The current CI attempt has a cursed Apple runner (which might finish) and a cursed Linux runner (which seems unlikely to finish), so letting this go for the full six hours is probably not worthwhile.

@jhpratt
Copy link
Member Author

jhpratt commented Feb 20, 2026

Yeah. I'll kill this and replace it with a rollup encompassing the additional PR approved in the meantime.

@bors r-

@jhpratt jhpratt closed this Feb 20, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

📋 Only unclosed PRs can be unapproved.

@jhpratt jhpratt deleted the rollup-MlcRd6F branch February 20, 2026 06:07
@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 Feb 20, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 20, 2026

💔 Test for 8d765af failed: CI

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

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

Comments