Skip to content

Rollup of 7 pull requests #141331

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 22 commits into from
May 21, 2025
Merged

Rollup of 7 pull requests #141331

merged 22 commits into from
May 21, 2025

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

onur-ozkan and others added 22 commits May 14, 2025 07:31
…hild process

This adds a `chroot` method to the `CommandExt` extension trait for the
`Command` builder, to set a directory to chroot into. This will chroot
the child process into that directory right before calling chdir for the
`Command`'s working directory.

To avoid allowing a process to have a working directory outside of the
chroot, if the `Command` does not yet have a working directory set,
`chroot` will set its working directory to "/".
This taints the typeck results with errors if a `continue` is found not
pointing to a loop, which fixes an ICE.

A few things were going wrong here. First, since this wasn't caught in
typeck, we'd end up building the THIR and then running liveness lints on
ill-formed HIR. Since liveness assumes all `continue`s point to loops,
it wasn't setting a live node for the `continue`'s destination. However,
the fallback for this was faulty; it would create a new live node to
represent the erroneous state after the analysis's RWU table had already
been built. This would ICE if the new live node was used in operations,
such as merging results from the arms of a match. I've removed this
error-recovery since it was buggy, and we should really catch bad labels
before liveness.

I've also replaced an outdated comment about when liveness lints are
run. At this point, I think the call to `check_liveness` could be moved
elsewhere, but if it can be run when the typeck results are tainted by
errors, it'll need some slight refactoring so it can bail out in that
case. In lieu of that, I've added an assertion.
Signed-off-by: onur-ozkan <[email protected]>
Link `Command::current_dir`.

Co-authored-by: Amanieu d'Antras <[email protected]>
Because that causes an assertion failure in debug builds.

Fixes rust-lang#140884.
…nieu

Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process

This adds a `chroot` method to the `CommandExt` extension trait for the
`Command` builder, to set a directory to chroot into. This will chroot
the child process into that directory right before calling chdir for the
`Command`'s working directory.

To avoid allowing a process to have a working directory outside of the
chroot, if the `Command` does not yet have a working directory set,
`chroot` will set its working directory to "/".

---

ACP: rust-lang/libs-team#551

This PR currently has the tracking issue set to "none"; if the ACP is approved,
I'll file a tracking issue and update the PR.
…larsan68

replace `cc_detect::cc2ar` with `cc::try_get_archiver`

~~Awaiting new release of [cc](https://crates.io/crates/cc) version with rust-lang/cc-rs#1456 to bump the version.~~

~~Blocked by rust-lang/cc-rs#1456

Kind a self-explanatory.

try-job: dist-android
Suggest use "{}", self.x instead of {self.x} when resolve x as field of `self`

Fixes rust-lang#141136

Changes can be seen in the second commit: rust-lang@9de7fff

r? compiler
…s, r=Kobzol

Allow `x perf` to find rustc.exe on Windows

Related issue: rust-lang#141281
Allow trailing comma after argument in query definition

Don't catastrophically fail the query macro if you put a comma after your query key!

r? oli-obk
…r=compiler-errors

typeck: catch `continue`s pointing to blocks

This taints the typeck results with errors if a `continue` is found not pointing to a loop.

A few things were going wrong here. First, since this wasn't caught in typeck, we'd end up building the THIR and then running liveness lints on ill-formed HIR. Since liveness assumes all `continue`s point to loops, it wasn't setting a live node for the `continue`'s destination. There was a fallback for if it couldn't retrieve that live node, but it was faulty; it would create a new live node to represent an erroneous state after the analysis's RWU table had already been built. This would ICE if the new live node was used in operations, such as merging results from the arms of a match. I've removed this error-recovery since it was buggy, and we should really catch bad labels before liveness.

I've also replaced an outdated comment about when liveness lints are run. At this point, I think the call to `check_liveness` could be moved elsewhere, but if it can be run when the typeck results are tainted by errors, it'll need some slight refactoring so it can bail out in that case. In lieu of that, I've added an assert.

Fixes rust-lang#113379
Fixes rust-lang#121623
…-errors

Avoid creating an empty identifer in `Symbol::to_ident_string`.

Because that causes an assertion failure in debug builds.

Fixes rust-lang#140884.

r? `@oli-obk`
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc O-unix Operating system: Unix-like 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. labels May 21, 2025
@rustbot rustbot added the rollup A PR which is a rollup label May 21, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented May 21, 2025

📌 Commit 5b150e3 has been approved by matthiaskrgr

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 May 21, 2025
@bors
Copy link
Collaborator

bors commented May 21, 2025

⌛ Testing commit 5b150e3 with merge c43786c...

@bors
Copy link
Collaborator

bors commented May 21, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing c43786c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 21, 2025
@bors bors merged commit c43786c into rust-lang:master May 21, 2025
1 check passed
@rustbot rustbot added this to the 1.89.0 milestone May 21, 2025
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#137759 Add std::os::unix::process::CommandExt::chroot to safely … 3a0bcde72d9159e100a12ef855199323e9105ca3 (link)
#140994 replace cc_detect::cc2ar with cc::try_get_archiver e1402a1508184e4d7343a1cac721102f8aad7655 (link)
#141213 Suggest use "{}", self.x instead of {self.x} when resolve x… fae3b155699f1e9fb4ba1469ab44df5cf201f0a6 (link)
#141283 Allow x perf to find rustc.exe on Windows beffdd211875ed1cc956f60aed110661403dec35 (link)
#141284 Allow trailing comma after argument in query definition 71dbb8840b5d4dc9fac94e1bf71ff89628103663 (link)
#141317 typeck: catch continues pointing to blocks 9177a39d1c138ac816d5ff5f5962a840c3b20455 (link)
#141318 Avoid creating an empty identifer in `Symbol::to_ident_stri… 8cec56eee8c14ed198ad7c8b9ca725c964ce5a53 (link)

previous master: bbd3a5ada4

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

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 bbd3a5a (parent) -> c43786c (this PR)

Test differences

Show 29 test diffs

Stage 0

  • utils::cc_detect::tests::test_cc2ar_env_specific: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_musl: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_nto_aarch64: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_nto_i586: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_nto_unknown: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_nto_x86_64: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_openbsd: pass -> [missing] (J3)
  • utils::cc_detect::tests::test_cc2ar_vxworks: pass -> [missing] (J3)

Stage 1

  • [crashes] tests/crashes/113379.rs: pass -> [missing] (J0)
  • [crashes] tests/crashes/121623.rs: pass -> [missing] (J0)
  • [crashes] tests/crashes/140884.rs: pass -> [missing] (J0)
  • [ui] tests/ui/extern/extern-empty-string-issue-140884.rs: [missing] -> pass (J0)
  • [ui] tests/ui/label/continue-pointing-to-block-ice-113379.rs: [missing] -> pass (J0)
  • [ui] tests/ui/label/continue-pointing-to-block-ice-121623.rs: [missing] -> pass (J0)
  • [ui] tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs: [missing] -> pass (J0)

Stage 2

  • [crashes] tests/crashes/140884.rs: pass -> [missing] (J1)
  • [ui] tests/ui/extern/extern-empty-string-issue-140884.rs: [missing] -> pass (J2)
  • [ui] tests/ui/label/continue-pointing-to-block-ice-113379.rs: [missing] -> pass (J2)
  • [ui] tests/ui/label/continue-pointing-to-block-ice-121623.rs: [missing] -> pass (J2)
  • [ui] tests/ui/resolve/suggestions/sugg-field-in-format-string-issue-141136.rs: [missing] -> pass (J2)
  • [crashes] tests/crashes/113379.rs: pass -> [missing] (J4)
  • [crashes] tests/crashes/121623.rs: pass -> [missing] (J4)
  • [crashes] tests/crashes/140884.rs: ignore (ignored if rustc wasn't built with debug assertions) -> [missing] (J5)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard c43786c9b7b8d8dcc3f9c604e0e3074c16ed69d3 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-linux: 5369.0s -> 8624.7s (60.6%)
  2. dist-apple-various: 6793.9s -> 8789.2s (29.4%)
  3. x86_64-apple-1: 7281.2s -> 8836.0s (21.4%)
  4. dist-arm-linux-musl: 5790.2s -> 6358.2s (9.8%)
  5. aarch64-apple: 4123.8s -> 3725.1s (-9.7%)
  6. dist-i586-gnu-i586-i686-musl: 5540.0s -> 5078.0s (-8.3%)
  7. dist-x86_64-musl: 7321.2s -> 7871.1s (7.5%)
  8. dist-aarch64-apple: 5311.0s -> 5708.1s (7.5%)
  9. dist-powerpc64le-linux-musl: 5517.1s -> 5909.2s (7.1%)
  10. dist-x86_64-apple: 8687.6s -> 9244.9s (6.4%)
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.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c43786c): 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 6.4%, secondary -0.9%)

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)
6.4% [6.4%, 6.4%] 1
Regressions ❌
(secondary)
0.4% [0.4%, 0.4%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.4% [-3.0%, -0.4%] 3
All ❌✅ (primary) 6.4% [6.4%, 6.4%] 1

Cycles

Results (secondary 0.2%)

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)
1.1% [0.9%, 1.3%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-0.8%, -0.7%] 3
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 776.541s -> 775.543s (-0.13%)
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-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-unix Operating system: Unix-like 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.