Skip to content
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

Rollup of 6 pull requests #128002

Merged
merged 24 commits into from
Jul 20, 2024
Merged

Rollup of 6 pull requests #128002

merged 24 commits into from
Jul 20, 2024

Conversation

matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

momvart and others added 24 commits July 15, 2024 19:54
Signed-off-by: onur-ozkan <work@onurozkan.dev>
sometimes a safety comment is a prayer.
avoid fuzzy provenance casts after deref.

Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
This is technically "not necessary", as we will "just" segfault instead
if we e.g. arrive inside the handler fn with the null altstack. However,
it seems incorrect to go about this hoping that segfaulting is okay,
seeing as how our purpose here is to mitigate stack overflow problems.

Make sure NEED_ALTSTACK syncs with PAGE_SIZE when we do.

Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
Editorialize on the wisdom of this as we do.
Note that current_guard is probably not unsafe for future work.
Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
Only the last candidate can possibly have more match pairs, so this can be
separate from the main or-candidate postprocessing loop.
When CI rustc is enabled and rustdoc sources are unchanged, we can use
the precompiled rustdoc from the CI rustc's sysroot. This speeds up
bootstrapping quite a lot by avoiding unnecessary rustdoc compilation.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
…Kobzol

 use precompiled rustdoc with CI rustc

When CI rustc is enabled and rustdoc sources are unchanged, we can use the precompiled rustdoc from the CI rustc's sysroot. This speeds up bootstrapping quite a lot by avoiding unnecessary rustdoc compilation.
…illot

Add a hook for `should_codegen_locally`

This PR lifts the module-local function `should_codegen_locally` to `TyCtxt` as a hook.
In addition to monomorphization, this function is used for checking the dependency of `compiler_builtins` on other libraries. Moving this function to the hooks also makes overriding it possible for the tools that use the rustc interface.
…ack-overflow-fn, r=joboet

unix: document unsafety for std `sig{action,altstack}`

I found many surprising elements here while trying to wrap a measly 5 functions with `unsafe`. I would rather not "just" mindlessly wrap this code with `unsafe { }`, so I decided to document it properly.

On Unix, this code covers the "create and setup signal handler" part of the stack overflow code, and serves as the primary safety boundary for the signal handler. It is rarely audited, very gnarly, and worth extra attention. It calls other unsafe functions defined in this module, but "can we correctly map the right memory, or find the right address ranges?" are separate questions, and get increasingly platform-specific. The question here is the more general "are we doing everything in the correct order, and setting up the handler in the correct way?"

As part of this audit, I noticed that we do some peculiar things that we should probably refrain from. However, I avoided making changes that I deemed might have a different final result in Rust programs. I did, however, reorder some events so that the signal handler is installed _after_ we install the alternate stack. We do not run much code between these events, but it is probably best if the timespan between the handler being available and the new stack being installed is 0 nanoseconds.
…or-kmc-solid, r=Amanieu

kmc-solid: `#![forbid(unsafe_op_in_unsafe_fn)]`

The path logic _should_ handle the forbiddance in the itron sources correctly, despite them being an "out-of-line" module.
match lowering: Split `finalize_or_candidate` into more coherent methods

I noticed that `finalize_or_candidate` was responsible for several different postprocessing tasks, making it difficult to understand.

This PR aims to clean up some of the confusion by:
- Extracting `remove_never_subcandidates` from `merge_trivial_subcandidates`
- Extracting `test_remaining_match_pairs_after_or` from `finalize_or_candidate`
- Taking what remains of `finalize_or_candidate`, and inlining it into its caller

---
Reviewing individual commits and ignoring whitespace is recommended.

Most of the large-looking changes are just moving existing code around, mostly unaltered.

r? ``@Nadrieril``
…thercote

run_make_support: skip rustfmt for lib.rs

To avoid them getting reordered once rust-lang#125443 goes through.

r? ``@nnethercote`` (since you were working on this)
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs O-solid Operating System: SOLID 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. labels Jul 20, 2024
@rustbot rustbot added T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 20, 2024
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Jul 20, 2024

📌 Commit 8963855 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 Jul 20, 2024
@bors
Copy link
Contributor

bors commented Jul 20, 2024

⌛ Testing commit 8963855 with merge 2e6fc42...

@bors
Copy link
Contributor

bors commented Jul 20, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 20, 2024
@bors bors merged commit 2e6fc42 into rust-lang:master Jul 20, 2024
7 checks passed
@rustbot rustbot added this to the 1.81.0 milestone Jul 20, 2024
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#127463 use precompiled rustdoc with CI rustc bf4b4b4992d3bc3efbc209dd5dd0a4834cf652f3 (link)
#127779 Add a hook for should_codegen_locally a7f2cc329fd443d51386ae45ab4eabf81f1d98ab (link)
#127843 unix: document unsafety for std sig{action,altstack} 9ac7f052e1d8e5ddd9549fe77faada9c98207556 (link)
#127873 kmc-solid: #![forbid(unsafe_op_in_unsafe_fn)] 1798509e60392f558a1dfb1c5bc3be6eac14ad59 (link)
#127917 match lowering: Split finalize_or_candidate into more coh… 5a7aa0952358b8c1d0aeceb63678ae8d1931ff23 (link)
#127964 run_make_support: skip rustfmt for lib.rs f5140d7c30193ae44d3bf14f96e7d9fb27016247 (link)

previous master: 73a228116a

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 (2e6fc42): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.3%, 0.3%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

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

Cycles

Results (primary -1.6%)

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)
- - 0
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.6% [-1.6%, -1.6%] 2

Binary size

Results (secondary 0.0%)

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)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 771.898s -> 771.36s (-0.07%)
Artifact size: 328.86 MiB -> 328.85 MiB (-0.00%)

@matthiaskrgr matthiaskrgr deleted the rollup-21p0cue branch September 1, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. O-solid Operating System: SOLID 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-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