Rollup of 7 pull requests#159187
Closed
JonathanBrouwer wants to merge 20 commits into
Closed
Conversation
The small-buffer path in Stdin::read allocates a one-element UTF-16 scratch buffer. When a pending surrogate exists, read_u16s_fixup_surrogates requires temporary storage for both the buffered surrogate and one newly read UTF-16 code unit. Increase the scratch buffer to two UTF-16 code units so the surrogate path can complete without panicking.
std resolves environ through dlsym on FreeBSD so that shared libraries can link, but a statically linked executable has no dynamic symbol table: the lookup returns null and the env iteration dereferences it. Take a weak reference instead: it binds at link time in any executable, and in a shared library the runtime linker resolves it against the environ the executable exports. Treat a null environ as an empty environment instead of dereferencing it.
When bootstrap runs a step by default, without explicit paths, it will normally act as though the user had explicitly requested all of the paths and aliases that the step registered through `ShouldRun`. For the coverage test suite, that gives the wrong outcome. Running a command like `./x test --skip=tests` or `./x test --skip=coverage` should skip the coverage tests, but instead the coverage tests would run anyway, due to the `coverage-map` and `coverage-run` aliases being treated as implied command-line arguments. This commit fixes that problem by adding a special flag to `ShouldRun`. When creating pathsets for a step that is being run by default, if the step has set the `default_to_suites_only` flag, all non-suite pathsets are discarded. That gives the desired behavior for skipping coverage tests, without affecting other steps, since other steps don't set the flag.
… `error_helper.rs` into the `diagnostics` folder in `rustc_resolve`
… r=JonathanBrouwer Apply MCP 1003 and move diagnostics.rs into its own module Part of rust-lang#158699. r? @JonathanBrouwer
…ulacrum Simplify the unwind crate Use cfg_select! and unify type definitions.
bootstrap: Allow path-based skipping of the coverage test suite - Alternative to rust-lang#159079 --- When bootstrap runs a step by default, without explicit paths, it will normally act as though the user had explicitly requested all of the paths and aliases that the step registered through `ShouldRun`. For the coverage test suite, that gives the wrong outcome. Running a command like `./x test --skip=tests` or `./x test --skip=coverage` should skip the coverage tests, but instead the coverage tests would run anyway, due to the `coverage-map` and `coverage-run` aliases being treated as implied command-line arguments. This PR fixes that problem by adding a special flag to `ShouldRun`. When creating pathsets for a step that is being run by default, if the step has set the `default_to_suites_only` flag, all non-suite pathsets are discarded. That gives the desired behaviour for skipping coverage tests, without affecting other steps, since other steps don't set the flag. The end result is that `./x test --skip=tests` should now skip the coverage tests, as intended. This lets us remove some `--skip` arguments from CI scripts, which were only required by the previous incorrect behaviour. --- The `default_to_suites_only` flag is a bit of a hack, but to me it seems like the cleanest way to resolve this problem without having to completely overhaul how CLI paths work, which is a much bigger task. And I think being able to remove the weird extra `--skip` arguments from CI scripts makes this a net positive. r? jieyouxu
…, r=Darksonn std: fix panic in Windows Stdin::read_vectored with pending surrogate Fixes rust-lang#158096. The small-buffer path in `Stdin::read_vectored` allocates a one-element UTF-16 scratch buffer before calling `read_u16s_fixup_surrogates`. When a pending surrogate exists, `read_u16s_fixup_surrogates` needs temporary storage for both the buffered surrogate and one newly read UTF-16 code unit. The one-element buffer causes an out-of-bounds slice before `ReadConsoleW` is called. Increase the scratch buffer to two UTF-16 code units, matching the function's requirements while leaving the normal read path unchanged.
Print duration of BOLT instrumentation and optimization steps The opt-dist pipeline has been on the longer side again recently, I want to make it easier to see where the time is being spent.
… r=clarfonthey Fix segfault in env access in statically linked FreeBSD binaries On FreeBSD `environ` is provided by the startup object linked into every executable (crt1.o) rather than by libc.so, so rust-lang#153718 switched std to a dlsym lookup to keep shared libraries linkable with `-Wl,--no-undefined` (rust-lang#153451). But dlsym needs a dynamic symbol table, which statically linked executables do not have: it returns null, and both `env::vars_os` and the `Command` spawn paths dereference it (rust-lang#158939). Resolve `environ` through a weak reference first: crt1.o defines it in every executable, statically linked ones included, and a weak undefined symbol does not break shared library links. Fall back to dlsym only when the weak reference is null, i.e. inside a shared library, where the dynamic lookup is available. Also stop dereferencing a null table pointer in `env()`, so an unresolvable `environ` degrades to an empty environment instead of a crash. The `extern_weak` reference is the same mechanism std already uses for `__dso_handle` and `__cxa_thread_atexit_impl` in `sys/thread_local/destructors/linux_like.rs`. ## Testing CI cannot execute FreeBSD tests (the target is cross-compiled only), so: - `./x check library/std --target x86_64-unknown-freebsd` and a host check pass. - The reproduction from rust-lang#158939, built with `-C target-feature=+crt-static`, was executed on FreeBSD 14.4-RELEASE (amd64): built with stock 1.96.0 it segfaults on `vars_os()` (SIGSEGV, exit 139); built against std from this branch it iterates the environment, spawns a child with an inherited environment, and exits cleanly. - Downstream, the crash was originally isolated and worked around in a production daemon whose CI runs the exact affected configuration (static, LTO) on a real FreeBSD kernel per commit; that harness stands ready to validate a nightly containing this fix. This is a regression from stable to stable (1.95 -> 1.96) and may be worth a beta backport. Fixes rust-lang#158939
…f, r=jieyouxu compiletest: use VecDeque::pop_front_if `VecDeque::pop_front_if` has been stable since Rust 1.93 and is now available to bootstrap. Replace compiletest's local compatibility helper with the standard library method and remove the obsolete FIXME.
Contributor
Author
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 12, 2026
Rollup of 7 pull requests try-job: dist-various-1 try-job: test-various try-job: x86_64-gnu-aux try-job: x86_64-gnu-llvm-21-3 try-job: x86_64-msvc-1 try-job: aarch64-apple try-job: x86_64-mingw-1 try-job: i686-msvc-*
Contributor
|
⌛ Testing commit 6e2afdd with merge f128af3... Workflow: https://github.com/rust-lang/rust/actions/runs/29206023734 |
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 12, 2026
…uwer Rollup of 7 pull requests Successful merges: - #158732 (Apply MCP 1003 and move diagnostics.rs into its own module) - #159010 (Simplify the unwind crate) - #159131 (bootstrap: Allow path-based skipping of the coverage test suite) - #159134 (std: fix panic in Windows Stdin::read_vectored with pending surrogate) - #159178 (Print duration of BOLT instrumentation and optimization steps) - #159112 (Fix segfault in env access in statically linked FreeBSD binaries) - #159124 (compiletest: use VecDeque::pop_front_if)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
PR #159010, which is a member of this rollup, was unapproved. This rollup was thus unapproved. Auto build was cancelled due to unapproval. Cancelled workflows: |
Contributor
|
💔 Test for 030b0f6 failed: CI. Failed job:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
r? @ghost
Create a similar rollup