Skip to content

Rollup of 10 pull requests #139746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 13, 2025
Merged

Rollup of 10 pull requests #139746

merged 25 commits into from
Apr 13, 2025

Conversation

ChrisDenton
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

thaliaarchi and others added 25 commits April 5, 2025 12:05
Fix std build for all NuttX targets. It is the single largest set of
failures on <https://does-it-build.noratrieb.dev/>. Although, ESP-IDF
also requires these same gates, there are other issues for those
targets.

This can verified be running `x check library/std --target=` for all
NuttX targets.
The default s390x cpu(z10) does not have vector support. Setting
target-cpu at least to z13 enables vectorisation for s390x architecture
and makes the tests pass.
Passing a `Result<(), &dyn Any>` to `calc_result` requires awkward code at both
call sites, for no real benefit. It's much easier to just pass the payload as
`Option<&dyn Any>`.

No functional change, except that the owned payload is dropped slightly later.
0.8.7 can trigger a panic when debug assertions are enabled when used via flate2 in some cases
and further simplify its checking in runtest
and its use cases in more detail
LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds),
but `-l` expects a library name, not a path. After rust-lang#138273, this caused builds
to fail with a "could not find native static library" error.

This patch updates the build script to split the path into directory and
filename, using `cargo::rustc-link-search` for the directory and
`cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to
correctly link the static library even when an absolute path is provided.
Also add a WCStr type
…mulacrum

std: Fix build for NuttX targets

Fix std build for all NuttX targets. It is the single largest set of failures on <https://does-it-build.noratrieb.dev/>. Although, ESP-IDF also requires these same gates, there are other issues for those targets.

This can verified be running `x check library/std --target=` for all NuttX targets.

cc ``@no1wudi``
…Mark-Simulacrum

Use -C target-cpu=z13 on s390x vector test

currently we see a regression in the `dont-shuffle-bswaps.rs` on s390x. This is due to, the default s390x cpu is set to z10 [here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs#L9) which does not have vector instructions implemented. To make the test pass we need to create an extra test revision and set target-cpu at least to `z13`.
…ulacrum

libtest: Pass the test's panic payload as Option instead of Result

Passing a `Result<(), &dyn Any>` to `calc_result` requires awkward code at both call sites to build a fake result, for no real benefit. It's much easier to just pass the payload as `Option<&dyn Any>`.

No functional change.
…=Mark-Simulacrum

update ```miniz_oxide``` to 0.8.8

I would normally let the auto actions handle this but it turns out 0.8.7 can trigger a panic when debug assertions are enabled in a few cases so I feel it's important it gets sorted more quickly. (and I would ideally like to yank that version but was worried that could cause some issues had been pulled in as a dependency by this repo already before I discovered the problem)

As it can only happen when debug assertions are enabled (the overflow results in the intended result so it doesn't cause any issue in release mode) and using the wrapping buffer mode when decompressing it is very unlikely to cause any issues here but I would like to get it sorted just to be safe. ```miniz_oxide``` is used in the standard library (and some tools) via ```backtrace-rs ``` which doesn't use a wrapping buffer, and thus won't trigger this condition. There does however seem like there are some tools that do dependency on ```flate2``` which does use ```miniz_oxide``` decompression using a a wrapping buffer and could in theory trigger it if they are run when compiled with debug assertions enabled.

It's kinda unclear what version what tool uses though as several of them specify older versions of flate2 which depended on ```miniz_oxide``` 0.7.x in cargo.toml, and ```miniz_oxide```, and not all have a cargo.lock and due to an older version of ```backtrace``` being in the root Cargo.lock which still depended on ```miniz_oxide``` 0.7.4, so that version is also pulled in alongside the newer version.
compiletest: Make `SUGGESTION` annotations viral

If one of them is expected in a test file, then others should be annotated as well, in the same way as with `HELP`s and `NOTE`s.
This doesn't require much of an additional annotation burden, but simplifies the rules.

r? ```@jieyouxu```
…th-fix, r=kobzol

Fix profiler_builtins build script to handle full path to profiler lib

LLVM_PROFILER_RT_LIB may be set to an absolute path (e.g., in Fedora builds), but `-l` expects a library name, not a path. After rust-lang#138273, this caused builds to fail with a "could not find native static library" error.

This patch updates the build script to split the path into directory and filename, using `cargo::rustc-link-search` for the directory and `cargo::rustc-link-lib=+verbatim` for the file. This allows profiler_builtins to correctly link the static library even when an absolute path is provided.
…=tgross35,joboet

Use `with_native_path` for Windows

Ideally, each platform should use their own native path type internally. This will, for example, allow passing a UTF-16 string directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated wide string. However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this just does some of the Windows parts.

As with the previous Unix PR (rust-lang#138832) this is intended to be merely a refactoring so I've avoided anything that may require more substantial changes.
Move `args` into `std::sys`

Move platform definitions of `args` into `std::sys`, as part of rust-lang#117276.

cc ``@joboet``
End all lines in src/stage0 with trailing newline

Most tools that process text files prefer if every line ends in \n. Text files without the last newline are aberrant and usually not what you want.

**Before:**

```console
$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843$ ▌
```

**After:**

```console
$ cat src/stage0 src/stage0
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
dist_server=https://static.rust-lang.org
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
...
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.gz=986f6c594d37bcbd3833e053640ba8775f68d26a65c5618386654ef55d7b3542
dist/2025-04-02/rustc-nightly-x86_64-unknown-netbsd.tar.xz=c0d9a88c30d2ab38ec3a11fabb5515ed9bc3ac1a8e35a438d68bf7ff82f6b843
$ ▌
```
… r=dtolnay

Move `select_unpredictable` to the `hint` module

There has been considerable discussion in both the ACP (rust-lang/libs-team#468) and tracking issue (rust-lang#133962) about whether the `bool::select_unpredictable` method should be in `core::hint` instead.

I believe this is the right move for the following reasons:
- The documentation explicitly says that it is a hint, not a codegen guarantee.
- `bool` doesn't have a corresponding `select` method, and I don't think we should be adding one.
- This shouldn't be something that people reach for with auto-completion unless they specifically understand the interactions with branch prediction. Using conditional moves can easily make code *slower* by preventing the CPU from speculating past the condition due to the data dependency.
- Although currently `core::hint` only contains no-ops, this isn't a hard rule (for example `unreachable_unchecked` is a bit of a gray area). The documentation only status that the module contains "hints to compiler that affects how code should be emitted or optimized". This is consistent with what `select_unpredictable` does.
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc O-hermit Operating System: Hermit O-SGX Target: SGX labels Apr 13, 2025
@rustbot rustbot added O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows 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-infra Relevant to the infrastructure 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. T-release Relevant to the release subteam, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Apr 13, 2025
@ChrisDenton
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

📌 Commit f1d0b9c has been approved by ChrisDenton

It is now in the queue for this repository.

@bors bors 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 Apr 13, 2025
@bors
Copy link
Collaborator

bors commented Apr 13, 2025

⌛ Testing commit f1d0b9c with merge 092a284...

@bors
Copy link
Collaborator

bors commented Apr 13, 2025

☀️ Test successful - checks-actions
Approved by: ChrisDenton
Pushing 092a284 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 13, 2025
@bors bors merged commit 092a284 into rust-lang:master Apr 13, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 13, 2025
Copy link

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 53d4476 (parent) -> 092a284 (this PR)

Test differences

Show 22 test diffs

Stage 1

  • sys::args::windows::tests::empty: [missing] -> pass (J0)
  • sys::args::windows::tests::genius_quotes: [missing] -> pass (J0)
  • sys::args::windows::tests::official_examples: [missing] -> pass (J0)
  • sys::args::windows::tests::post_2008: [missing] -> pass (J0)
  • sys::args::windows::tests::single_words: [missing] -> pass (J0)
  • sys::args::windows::tests::whitespace_behavior: [missing] -> pass (J0)
  • sys::pal::windows::args::tests::empty: pass -> [missing] (J0)
  • sys::pal::windows::args::tests::genius_quotes: pass -> [missing] (J0)
  • sys::pal::windows::args::tests::official_examples: pass -> [missing] (J0)
  • sys::pal::windows::args::tests::post_2008: pass -> [missing] (J0)
  • sys::pal::windows::args::tests::single_words: pass -> [missing] (J0)
  • sys::pal::windows::args::tests::whitespace_behavior: pass -> [missing] (J0)
  • [codegen] tests/codegen/dont-shuffle-bswaps.rs#OPT3_S390X: [missing] -> ignore (only executed when the architecture is s390x) (J1)

Stage 2

  • [codegen] tests/codegen/dont-shuffle-bswaps.rs#OPT3_S390X: [missing] -> ignore (only executed when the architecture is s390x) (J2)

Additionally, 8 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Job duration changes

  1. dist-apple-various: 6651.2s -> 8408.9s (26.4%)
  2. x86_64-apple-2: 6619.8s -> 4930.6s (-25.5%)
  3. x86_64-apple-1: 7211.7s -> 7984.3s (10.7%)
  4. dist-x86_64-apple: 9709.6s -> 8848.4s (-8.9%)
  5. x86_64-rust-for-linux: 2789.6s -> 2653.8s (-4.9%)
  6. x86_64-msvc-ext1: 7215.8s -> 7533.8s (4.4%)
  7. dist-i686-msvc: 6803.2s -> 7085.3s (4.1%)
  8. dist-various-2: 3564.8s -> 3418.3s (-4.1%)
  9. dist-aarch64-apple: 4568.2s -> 4389.5s (-3.9%)
  10. i686-gnu-2: 6442.9s -> 6685.7s (3.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@ChrisDenton ChrisDenton deleted the rollup-eq08b2e branch April 13, 2025 18:08
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#138972 std: Fix build for NuttX targets 68f4246517f10d485bf686abc1ff032836274185 (link)
#139177 Use -C target-cpu=z13 on s390x vector test 53e75a58a016ff338a6199d80bdc4c32f1687185 (link)
#139511 libtest: Pass the test's panic payload as Option instead of… 017e55ae87d3e3acdb0721667d1170a96e8c2819 (link)
#139605 update miniz_oxide to 0.8.8 05126c7004fc761f7d5e335dd7c350545395c1a8 (link)
#139618 compiletest: Make SUGGESTION annotations viral 63cecde53a154a7f1775bbcc6d6adde0dbba4483 (link)
#139677 Fix profiler_builtins build script to handle full path to p… 71569efffb2ae8dd830e2b3cb9c36b521e1fd027 (link)
#139683 Use with_native_path for Windows 48e7cc57f3837d9af862547c3c2dd31bc29ef571 (link)
#139710 Move args into std::sys 1e7ca508fcc6a469d4a411c936b18902de8e6890 (link)
#139721 End all lines in src/stage0 with trailing newline 4420ae162f0702f01610e1d84008e8d8503b862c (link)
#139726 Move select_unpredictable to the hint module 7de1f5eaf83af4a4b9b9ff85a77b268c003c37db (link)

previous master: 53d4476111

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (092a284): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary -2.7%, secondary -2.3%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.2% [4.2%, 4.2%] 1
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
-4.5% [-8.0%, -2.6%] 3
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 780.32s -> 779.607s (-0.09%)
Artifact size: 365.51 MiB -> 365.51 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-hermit Operating System: Hermit O-SGX Target: SGX O-solid Operating System: SOLID O-unix Operating system: Unix-like O-wasi Operating system: Wasi, Webassembly System Interface O-wasm Target: WASM (WebAssembly), http://webassembly.org/ O-windows Operating system: Windows rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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-infra Relevant to the infrastructure 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. T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.