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 9 pull requests #138994

Closed
wants to merge 24 commits into from
Closed

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Mar 26, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

m-ou-se and others added 24 commits March 19, 2025 12:49
The collection is limited to full debuginfo builds to match behavior of
FunctionCx::compute_per_local_var_debug_info.
This currently works because it's part of expansion, and that isn't yet
tracked by the query system. But we want to ensure it continues working,
even if that is changed.
Along with `TyCtx::env_var` helper. These can be used to track
environment variable accesses in the query system.

Since `TyCtx::env_var_os` uses `OsStr`, this commit also adds the
necessary trait implementations for that to work.
This won't work with Cargo's change tracking, but it should work with incremental.
Add environment variable query

Generally, `rustc` prefers command-line arguments, but in some cases, an environment variable really is the most sensible option. We should make sure that this works properly with the compiler's change-tracking mechanisms, such that changing the relevant environment variable causes a rebuild.

This PR is a first step forwards in doing that.

Part of the work needed to do rust-lang#118204, see rust-lang#129342 for some discussion.

r? `@petrochenkov`
…handler, r=oli-obk

Avoiding calling queries when collecting active queries

This PR changes active query collection to no longer call queries. Instead the fields needing queries have their computation delayed to when an cycle error is emitted or when printing the query backtrace in a panic.

This is done by splitting the fields in `QueryStackFrame` needing queries into a new `QueryStackFrameExtra` type. When collecting queries `QueryStackFrame` will contain a closure that can create `QueryStackFrameExtra`, which does make use of queries. Calling `lift` on a `QueryStackFrame` or `CycleError` will convert it to a variant containing `QueryStackFrameExtra` using those closures.

This also only calls queries needed to collect information on a cycle errors, instead of information on all active queries.

Calling queries when collecting active queries is a bit odd. Calling queries should not be done in the deadlock handler at all.

This avoids the out of memory scenario in rust-lang#124901.
…mulacrum

Allow spawning threads after TLS destruction

Fixes rust-lang#138696
…config, r=lqd

Update wg-prio triagebot config

This completes the Zulip channel renaming after rust-lang/compiler-team#848

Just nits: fixed a documentation link and the name of the Zulip channel for prioritization alerts.

r? `@davidtwco`
…ieyouxu

Un-bury chapters from the chapter list in rustc book

This PR moves the "Platform Support" section to the bottom of rustc chapter book, as to un-burry chapters from the chapter list, which where hidden by the wall of targets.

| Before | After |
|--------|-------|
| ![image](https://github.com/user-attachments/assets/92769307-eadb-4d9d-bdbb-9e610207eb79) | ![image](https://github.com/user-attachments/assets/1834f5c5-a1e6-4674-9be2-1094d1376eda) |

r? `@jieyouxu`
… r=lcnr

Implement lint against using Interner and InferCtxtLike in random compiler crates

Often `Interner` defines similar methods to `TyCtxt` (but often simplified due to the simpler API surface of the type system layer for the new solver), which people will either unintentionally or intentionally import and use. Let's discourage that.

r? lcnr
…ed, r=compiler-errors

Don't deaggregate InvocationParent just to reaggregate it again

Also makes it easier to add more things to it in the future (which I am doing in some local experiments, so not really a reason to do this just now, but I think this PR stands on its own).
…compiler-errors

Collect items referenced from var_debug_info

The collection is limited to full debuginfo builds to match behavior of FunctionCx::compute_per_local_var_debug_info.

Fixes rust-lang#138942.
…ler-errors

Use the correct binder scope for elided lifetimes in assoc consts

Beyond diagnostics this has no real effect, and it's also just about a future incompat lint. But it causes ICEs in some refactorings that I'm doing, so trying to get it out of the way
@rustbot rustbot added A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Mar 26, 2025
@rustbot rustbot added the rollup A PR which is a rollup label Mar 26, 2025
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Mar 26, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Mar 26, 2025

📌 Commit ff60436 has been approved by TaKO8Ki

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 Mar 26, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 26, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang#130883 (Add environment variable query)
 - rust-lang#138672 (Avoiding calling queries when collecting active queries)
 - rust-lang#138702 (Allow spawning threads after TLS destruction)
 - rust-lang#138935 (Update wg-prio triagebot config)
 - rust-lang#138946 (Un-bury chapters from the chapter list in rustc book)
 - rust-lang#138964 (Implement lint against using Interner and InferCtxtLike in random compiler crates)
 - rust-lang#138977 (Don't deaggregate InvocationParent just to reaggregate it again)
 - rust-lang#138980 (Collect items referenced from var_debug_info)
 - rust-lang#138985 (Use the correct binder scope for elided lifetimes in assoc consts)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Mar 26, 2025

⌛ Testing commit ff60436 with merge 5ff4b03...

@rust-log-analyzer
Copy link
Collaborator

The job test-various failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui/thread-local/spawn-hook-atexit.rs stdout ----

error: test run failed!
status: exit status: 134
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local/spawn-hook-atexit" && RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUST_TEST_THREADS="4" "/wasmtime-v19.0.0-x86_64-linux/wasmtime" "run" "-C" "cache=n" "--dir" "." "--env" "RUSTC_BOOTSTRAP" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local/spawn-hook-atexit/a.wasm"
stdout: none
--- stderr -------------------------------

thread 'main' panicked at /rustc/FAKE_PREFIX/library/std/src/thread/mod.rs:729:29:
failed to spawn thread: Error { kind: Unsupported, message: "operation not supported on this platform" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: failed to run main module `/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/thread-local/spawn-hook-atexit/a.wasm`

Caused by:
    0: failed to invoke command default
    1: error while executing at wasm backtrace:
           0: 0x731d - a.wasm!__rustc[e71bbdf1327cd442]::__rust_start_panic
           1: 0x711a - a.wasm!__rustc[e71bbdf1327cd442]::rust_panic
           2: 0x70ed - a.wasm!std::panicking::rust_panic_with_hook::hf7253cc1326481e4
           3: 0x618f - a.wasm!std::panicking::begin_panic_handler::{{closure}}::he12880ca3e35ef7a
           4: 0x60fb - a.wasm!std::sys::backtrace::__rust_end_short_backtrace::h5892030c5e958e1f
           5: 0x6a80 - a.wasm!__rustc[e71bbdf1327cd442]::rust_begin_unwind
           6: 0xb81b - a.wasm!core::panicking::panic_fmt::hfecdcbf9788721e5
           7: 0xd3a8 - a.wasm!core::result::unwrap_failed::h0cf8ff721cbe3fe3
           8:  0xa88 - a.wasm!std::thread::spawn::h6b69bdde073e2268
           9: 0x1802 - a.wasm!spawn_hook_atexit::main::h872f7eff79614d37
          10:  0x5c6 - a.wasm!std::sys::backtrace::__rust_begin_short_backtrace::h0654a70c6c569708
          11:  0x5b9 - a.wasm!std::rt::lang_start::{{closure}}::h53d8d7c9849aa50e
          12: 0x37bb - a.wasm!std::rt::lang_start_internal::h824b1b60e0c6fb40
          13: 0x183b - a.wasm!__main_void
          14:  0x325 - a.wasm!_start
    2: wasm trap: wasm `unreachable` instruction executed
------------------------------------------



failures:

@bors
Copy link
Collaborator

bors commented Mar 26, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 26, 2025
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Mar 27, 2025

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 27, 2025
@TaKO8Ki TaKO8Ki closed this Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-meta Area: Issues & PRs about the rust-lang/rust repository itself A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.