Rollup of 6 pull requests#159192
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
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.
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: 77cf889bc1 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 77cf889 (parent) -> d39561c (this PR) Test differencesShow 31 test diffsStage 0
Additionally, 28 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard d39561c2d2b55985d3b6331cc52403e038e7fc8b --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (d39561c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -3.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.838s -> 487.649s (-0.45%) |
Successful merges:
r? @ghost
Create a similar rollup