Repository navigation
Rollup of 9 pull requests - #166671
Closed
JonathanBrouwer wants to merge 23 commits into
Closed
Rollup of 9 pull requests#166671JonathanBrouwer wants to merge 23 commits into
JonathanBrouwer wants to merge 23 commits into
Conversation
## Stabilization report
### What is stabilized
With trim-paths `object` scope and debuginfo on,
Cargo writes `<artifact>.trim-paths.json` beside each final artifact.
The "unremap" file maps the remapped paths back to local ones.
This stabilizes debugger script changes:
`rust-gdb` and `rust-lldb` by default load `{gdb,lldb}_trim_paths.py`,
which read the unremap files and apply them
through GDB `substitute-path` or LLDB `target.source-map`
to set up source file path substitutions.
### What changes
* After stabilization, set `RUST_{GDB,LLDB}_TRIM_PATHS=0` to opt out.
Before, this needed `RUST_{GDB,LLDB}_TRIM_PATHS=unstable`.
* After stabilization, both scripts are shipped on all channels.
Before, they were shipped only on nightly.
### Why we don't want to stabilize
* This makes debugger scripts relying on Cargo-specific file format,
inversing the dependency relation.
* There is no integration test for them.
(and debugger scripts actually don't have many tests)
### Docs
See Cargo's the "Unremap files" section:
<https://github.com/rust-lang/cargo/blob/ac74ae3c603b9efce95b07383b46d3103e834d9a/doc/book/src/reference/profiles.md?plain=1#L337-L386>
I guess things got renamed and there were some editing mishaps.
…ustdoc, r=GuillaumeGomez Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope # Stabilization report of `--remap-path-scope` in rustdoc and the `documentation` scope ## Summary `rustc` supports remapping source paths prefixes as a best effort in all compiler generated output, including compiler diagnostics, debugging information, macro expansions, documentation, doctests, etc. This is useful for normalizing build products, for example, by removing the current directory out of the paths emitted into object files. This stabilization stabilize the same flag used by `rustc` to control which generted output has remapped paths in `rustdoc`. Cargo is starting to use the `rustc` flag with rust-lang/cargo#17488. Tracking issue: rust-lang#155451. It's the last major part of the trim-paths feature. ### What is stabilized The rustdoc `--remap-path-scope` flag is being stabilized by this PR. It's equivalent to [the rustc flag](https://doc.rust-lang.org/rustc/remap-source-paths.html#--remap-path-scope). It permits defines which scopes should be remapped by `-–remap-path-prefix`: `macro,diagnostics,documentation,debuginfo,coverage,object,all`. #### Example ```sh rustdoc src/lib.rs --remap-path-prefix="$PWD=/foo" --remap-path-prefix=documentation ``` #### The `documentation` In addition to the [other scopes](https://doc.rust-lang.org/rustc/remap-source-paths.html#--remap-path-scope) (`diagnostics`, `debuginfo`, ...). `rustdoc` uses the `documentation` scope, it's a new scope to be shared with `rustc` (T-compiler [FCP here](rust-lang#163896)). ## Implementation ### Major parts - rust-lang#155357 - rust-lang#151589 - rust-lang#163956 - rust-lang#164278 - rust-lang#164279 ### Coverage - [`tests/rustdoc-ui/remap-path-prefix.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/rustdoc-ui/remap-path-prefix.rs) - [`tests/rustdoc-ui/remap-path-prefix-doctest.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/rustdoc-ui/remap-path-prefix-doctest.rs) - [`tests/ui/errors/remap-path-prefix-macro.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/ui/errors/remap-path-prefix-macro.rs) - [`tests/ui/errors/remap-path-prefix-diagnostics.rs`](https://github.com/rust-lang/rust/blob/b57eb9a5fd94f30697f51fc88fbe898e67c7aae6/tests/ui/errors/remap-path-prefix-diagnostics.rs) ### Outstanding bugs There are no outstanding bugs regarding `--remap-path-scope` in `rustdoc`. There are [caveats and limitation](https://doc.rust-lang.org/nightly/rustc/remap-source-paths.html#caveats-and-limitations) in `rustc`, but they mostly concern generated object files, which we don't really have. ### Outstanding FIXMEs There are no FIXME regarding `--remap-path-scope` (in rustc or rustdoc). Fixes rust-lang#163896 Fixes rust-lang#155451
…, r=Urgau debugger: stabilize trim-paths unremap file loading ## Stabilization report ### What is stabilized With trim-paths `object` scope and debuginfo on, Cargo writes `<artifact>.trim-paths.json`[^1] beside each final artifact. This "unremap" file, maps the remapped paths back to local ones. The file format and remapping rules are stabilized as part of FCP on Cargo side: rust-lang/cargo#17488 This stabilizes debugger script changes: `rust-gdb` and `rust-lldb` by default load `{gdb,lldb}_trim_paths.py`, which read the unremap files and apply them through GDB `substitute-path` or LLDB `target.source-map` to set up source file path substitutions. Note that we already apply an unremap for `/rustc/$RUSTC_COMMIT_HASH` paths, so it wouldn't be a new capability per se, just an extension of it. ### What changes * After stabilization, set `RUST_{GDB,LLDB}_TRIM_PATHS=0` to opt out. Before, it required `RUST_{GDB,LLDB}_TRIM_PATHS=unstable` to enable. * After stabilization, both scripts are shipped on all channels. Before, they were shipped only on nightly. ### Why we don't want to stabilize * This makes debugger scripts relying on Cargo-specific file format, inversing the dependency relation. * There is no integration test for them. (and debugger scripts actually don't have many tests) ### Docs See Cargo's the "Unremap files" section: <https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#unremap-files>. > The unremap file is in JSON format: > > * `v` carries the format version. > * `rust_version` and `workspace_root` are file-level metadata, namely the toolchain version and the workspace root. > * `remaps` is an array of records. Each record maps a sanitized path prefix in the artifact (`from`) back to the local path it replaced (`to`), ordered by the `from` prefix. Note that this follows the debugger substitution direction, which is the inverse of `--remap-path-prefix`. > > An example of the unremap file: > > ```json > { > "v": 1, > "rust_version": "1.96.0-nightly", > "workspace_root": "/home/me/app", > "remaps": [ > { "from": ".", "to": "/home/me/app" }, > { "from": "/cargo/build-dir", "to": "/home/me/app/target" }, > { "from": "/cargo/registry/6f17d22d3f0a95d1", "to": "/home/me/.cargo/registry/src/index.crates.io-6f17d22d3f0a95d1" }, > { "from": "/rustc/abc123", "to": "/home/me/.rustup/toolchains/nightly/lib/rustlib/src/rust" } > ] > } > ``` > > Since it is meant to be a debugging aid, it includes absolute paths of your system, so there is no artifact privacy guarantee. You might want to exclude `*.trim-paths.json` files when distributing artifacts. --- Should be shipped after <rust-lang#163881> (or along with that)
…nthey Use `__fastfail()` for `crash()` on Windows [`__fastfail`](https://learn.microsoft.com/en-us/cpp/intrinsics/fastfail?view=msvc-180) is the preferred way to quickly abort the process on this platform. Unlike `ud2`, it won't go through SEH. See previously rust-lang#149780 @rustbot label O-windows
…3898-clean, r=petrochenkov fix: ignore format literal source availability in stable hashes fixes [rust-lang#153898](rust-lang#153898). installing rust-src could change a crate's strict version hash (SVH) due to source-dependent format-string desugaring. this change excludes the diagnostic-only FormatLiteral.source field from stable hashing while preserving diagnostic behavior. adds a regression test covering unimplemented!, todo!, unreachable!, and generic functions. verifies metadata with and without rust-src using identical compiler flags. r? compiler
…eetrees add c-variadic support for `x87_f80` tracking issue: rust-lang#163982 The default paths already have the right behavior. Validated with abi-cafe.
…t, r=folkertdev
Don't round the number of bits passed to `{Size,Align}::from_bits`
The current behaviour is more likely to mask typos than be the intended behaviour, and can give the misleading impression that `Size` can store sizes that are a non-whole-number of bytes. This is particularly nonsensical for `Align::from_bits` where `Align::from_bits(24)` has always been an error whereas `Align::from_bits(25)` was rounded up to a 32-bit alignment before this PR. The only places where the current rounding behaviour is relied upon are a few places where `Size::from_bits(1)` is used as a constant to represent the size of a `bool` (1 byte) - this PR replaces those with the more explicit `Size::from_bytes(1)`/`Size::from_bits(8)`. If the rounding behaviour is needed in the future, a dedicated `Size::ceil_from_bits` method can be added.
r? @folkertdev
… r=clarfonthey Remove `T: Send + Sync` bound from `Arc::downcast` [Discussion](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Why.20the.20.60T.3A.20Send.20.2B.20Sync.60.20bound.20in.20.60Arc.3A.3Adowncast.60.3F/with/617793925) on zulip Implements the change described in rust-lang/libs-team#859. T-libs can pick if they want to skip the ACP or not. @rustbot label needs-fcp T-libs
…-dir-override, r=Kobzol fix: bootstrap build directory handling with --set fixes rust-lang#166607 handle `--set build.build-dir` in python bootstrap using the existing toml parser, so both bootstrap implementations use the same directory. added unit tests and verified the original repro. cc @Kobzol
Submodule update of rustc-perf Mostly to land rust-lang/rustc-perf#2650 r? Kobzol
Member
Author
|
@bors r+ p=5 force |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Nov 27, 2026
…uwer Rollup of 9 pull requests Successful merges: - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope) - #163910 (debugger: stabilize trim-paths unremap file loading) - #166175 (Use `__fastfail()` for `crash()` on Windows) - #166377 (fix: ignore format literal source availability in stable hashes) - #166510 (add c-variadic support for `x87_f80`) - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`) - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`) - #166641 (fix: bootstrap build directory handling with --set) - #166655 (Submodule update of rustc-perf)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for cca35f5 failed: CI. Failed job:
|
Contributor
|
PR #166175, which is a member of this rollup, was unapproved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
--remap-path-scopein rustdoc and thedocumentationscope #163895 (Stabilize--remap-path-scopein rustdoc and thedocumentationscope)__fastfail()forcrash()on Windows #166175 (Use__fastfail()forcrash()on Windows)x87_f80#166510 (add c-variadic support forx87_f80){Size,Align}::from_bits#166650 (Don't round the number of bits passed to{Size,Align}::from_bits)T: Send + Syncbound fromArc::downcast#161531 (RemoveT: Send + Syncbound fromArc::downcast)r? @ghost
Create a similar rollup