Unremap file - #97
Closed
weihanglo wants to merge 29 commits into
Closed
Unremap file#97weihanglo wants to merge 29 commits into
weihanglo wants to merge 29 commits into
Conversation
…-lang#17293) cargo-miri (and every other cargo wrapper) will apparently need to learn to deal with argfiles. As part of that it would be really nice if we had any way of testing argfiles that does not involve having to add a gigantic amount of dependencies (I don't even know how many I'd have to add on my Linux system). So if we could have an env var to force argfile usage that'd be great. I'm happy to restrict this to nightly builds if you tell me how. ;) Context: rust-lang/miri#5234
### What does this PR try to resolve? Remove unnecessary `return` keyword at the end of two functions where the expression form `Ok(())` is idiomatic Rust style. ### How to test and review this PR? It is a stylistic change — `return Ok(())` and `Ok(())` are semantically identical at the end of a function. Existing tests pass unchanged.
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://redirect.github.com/actions/checkout) | action | minor | `v6.0.3` → `v6.1.0` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.1.0`](https://redirect.github.com/actions/checkout/compare/v6.0.3...v6.1.0) [Compare Source](https://redirect.github.com/actions/checkout/compare/v6.0.3...v6.1.0) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 5am on the first day of the month" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/cargo). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zLjIiLCJ1cGRhdGVkSW5WZXIiOiI0NC4zLjIiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOltdfQ==-->
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [cargo-semver-checks](https://redirect.github.com/obi1kenobi/cargo-semver-checks) | minor | `0.49.0` → `0.50.0` | --- ### Release Notes <details> <summary>obi1kenobi/cargo-semver-checks (cargo-semver-checks)</summary> ### [`v0.50.0`](https://redirect.github.com/obi1kenobi/cargo-semver-checks/releases/tag/v0.50.0) [Compare Source](https://redirect.github.com/obi1kenobi/cargo-semver-checks/compare/v0.49.0...v0.50.0) #### In this release - Support for rustdoc JSON v61 for the latest nightly Rust - One new lint: `auto_trait_impl_added` - Bugfix in `constructible_struct_adds_field` to properly account for existing `pub` but `#[doc(hidden)]` fields. - Support for parsing rustdocflags from `.cargo/config.toml` and some minor bugfixes - Thanks to [@&rust-lang#8203;taiki-e](https://redirect.github.com/taiki-e) [for accepting](https://redirect.github.com/taiki-e/cargo-config2/pull/67) [our upstream](https://redirect.github.com/taiki-e/cargo-config2/pull/66) [patches](https://redirect.github.com/taiki-e/cargo-config2/pull/68) and promptly releasing them in `cargo-config2` so we can use them!  ✨ *This adorable animation was made by [@&rust-lang#8203;dekirisu](https://redirect.github.com/dekirisu)* ✨ This release requires Rust 1.93+ both to install (MSRV) and at runtime. #### All merged PRs - Fix publishing workflow not being triggered because of optional job. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1679](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1679) - Make Rust 1.93 the MSRV and remove old fixtures. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1680](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1680) - Update to `trustfall_rustdoc` v0.40.0, dropping rustdoc JSON v56. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1682](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1682) - Weekly `cargo update` of dependencies by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1684](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1684) - Fix lints about constructible structs to account for non-pub-API fields. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1685](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1685) - Weekly `cargo update` of dependencies by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1686](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1686) - Add minor lint: auto trait impl added to pub type by [@&rust-lang#8203;ivelieu](https://redirect.github.com/ivelieu) in [#&rust-lang#8203;1683](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1683) - Upgrade `trustfall_rustdoc` to v0.41.0 adding support for rustdoc v61. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1687](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1687) - Bump `cargo-config2` to pick up rustdocflags parsing and bugfixes. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1688](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1688) - Bump mozilla-actions/sccache-action from 0.0.10 to 0.0.11 by [@&rust-lang#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in [#&rust-lang#8203;1689](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1689) - Weekly `cargo update` of dependencies by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1690](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1690) - Release v0.50.0 supporting rustdoc v61 and parsing config rustdocflags. by [@&rust-lang#8203;obi1kenobi](https://redirect.github.com/obi1kenobi) in [#&rust-lang#8203;1691](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1691) #### New Contributors - [@&rust-lang#8203;ivelieu](https://redirect.github.com/ivelieu) made their first contribution in [#&rust-lang#8203;1683](https://redirect.github.com/obi1kenobi/cargo-semver-checks/pull/1683) **Full Changelog**: <obi1kenobi/cargo-semver-checks@v0.49.0...v0.50.0> </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Every minute (`* * * * *`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/cargo). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zLjIiLCJ1cGRhdGVkSW5WZXIiOiI0NC4zLjIiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOltdfQ==-->
### What does this PR try to resolve? Remove unnecessary `.to_path_buf()` call before `.join()` in `layout.rs`. ### How to test and review this PR? Single-line change removing an unnecessary heap allocation. Behavior is identical and produces the same result.
### What does this PR try to resolve? Previously, checking an unchanged lockfile with `--locked` or `--frozen` deserialized both lockfiles and rebuilt their resolution graphs before checking whether their contents already matched. For large workspaces, this repeats expensive work on the common unchanged-lockfile path. This PR moves the existing line-by-line equality check ahead of the semantic comparison. The existing line-ending behavior is preserved, and differing lockfiles still fall back to the full deserialization and resolution comparison. On my M4, with 15 interleaved runs of `cargo metadata --offline --locked --format-version 1` per workspace: | Workspace | Before | After | Improvement | | --------- | -----: | ----: | ----------: | | Cargo | 157.209 ms | 152.477 ms | 3.01% | | Ruff | 161.157 ms | 156.841 ms | 2.68% | | uv | 208.884 ms | 201.747 ms | 3.42% | | Codex | 458.177 ms | 442.278 ms | 3.47% | ### How to test and review this PR? The change only reorders the existing equality checks. All 24 lockfile compatibility integration tests pass, including coverage for frozen lockfile preservation and `--locked` errors.
weihanglo
force-pushed
the
unremap-file
branch
2 times, most recently
from
August 3, 2026 11:55
9e04902 to
db2c040
Compare
) ### What does this PR try to resolve? Part of <rust-lang#12137>. This was discussed during 2026 all-hands rust-lang/all-hands-2026#38 (comment) Every remap rule now substitutes a distinct prefix instead of stripping the source prefix to an empty string. This makes the source remap more unambiguous and reversible. | Category | From | To | |---------------------|----------------------------------------------|------------------------------------| | Sysroot | `<sysroot>/lib/rustlib/src/rust` | `/rustc/<commit-hash>` | | Registry dep | `~/cargo/registry/src/<registry-dir>` | `/cargo/registry/<registry-id>` | | Git dep | `~/cargo/git/checkouts/<repo-dir>/<rev-dir>` | `/cargo/git/<git-source-id>/<rev>` | | Workspace | `<workspace-root>` | `.` (workspace-relative) | | Path dep outside ws | `<pkg-root>` | `/cargo/path/<name>-<version>` | | Vendored | `<pkg-root>` (by file location) | workspace or path rules above | | Build directory | `<build-dir>` | `/cargo/build-dir` | ### How to test and review this PR? Commit by commit. * Old tests show the remap behavior changes. * New tests verify vendored dependencies are covered. * Docs are updated.
The move to passing in a Rustc rather than a Workspace was necessary as a 2nd Rustc is unable to update the rustc info cache.
…orkspace.lints]` instead
### What does this PR try to resolve? I split this out from a refactor of rust-lang#16675, as part of work on [build-std=always](rust-lang/rust#155363). In this PR, and in other build-std work I have in progress, it's useful to know the sysroot path earlier than the `compiler/` stage of Cargo. Because there's one rustc instance per Cargo invocation, and because the sysroot path remains fixed per rustc and isn't dependent on the target, this should be safe to move out of TargetInfo. ### How to test and review this PR? The first commit shows the logic being moved, and the second commit shows updating all the users of this logic. The third removes the actual `--print` lookup in `TargetInfo`, which necessitated some test changes and a refactor to ensure the rustc info cache can be written to. Getting the sysroot is already heavily tested in Cargo, hence why I didn't add a new test for just this.
…ust-lang#17291) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [EmbarkStudios/cargo-deny-action](https://redirect.github.com/EmbarkStudios/cargo-deny-action) | action | minor | `v2.0.20` → `v2.1.1` | --- ### Release Notes <details> <summary>EmbarkStudios/cargo-deny-action (EmbarkStudios/cargo-deny-action)</summary> ### [`v2.1.1`](https://redirect.github.com/EmbarkStudios/cargo-deny-action/releases/tag/v2.1.1): Release 2.1.1 - cargo-deny 0.20.2 [Compare Source](https://redirect.github.com/EmbarkStudios/cargo-deny-action/compare/v2.1.0...v2.1.1) #### Fixed - [PR#116](https://redirect.github.com/EmbarkStudios/cargo-deny-action/pull/116) fixed in issue introduced in the 2.1.0 release due the deprecation of the `use-git-cli` argument. Thanks [@&rust-lang#8203;Firestar99](https://redirect.github.com/Firestar99)! ### [`v2.1.0`](https://redirect.github.com/EmbarkStudios/cargo-deny-action/releases/tag/v2.1.0): Release 2.1.0 - cargo-deny 0.20.2 [Compare Source](https://redirect.github.com/EmbarkStudios/cargo-deny-action/compare/v2.0.20...v2.1.0) ##### Changed - [PR#881](https://redirect.github.com/EmbarkStudios/cargo-deny/pull/881) refactored the CLI, moving some duplicated options/flags into the root and removing several deprecated options/flags/values. See the PR for a full list of changes. ##### Added - [PR#879](https://redirect.github.com/EmbarkStudios/cargo-deny/pull/879) resolved [#&rust-lang#8203;873](https://redirect.github.com/EmbarkStudios/cargo-deny/issues/873) by adding a new [`bans.std-replacements`](https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html#the-std-replacements-field-optional) lint which checks the graph for crates.io sourced crates that have been partially or fully replaced in `std` and/or `core`. ##### Fixed - [PR#880](https://redirect.github.com/EmbarkStudios/cargo-deny/pull/880) resolved [#&rust-lang#8203;765](https://redirect.github.com/EmbarkStudios/cargo-deny/issues/765) by respecting non-default build script paths in manifests. - [PR#881](https://redirect.github.com/EmbarkStudios/cargo-deny/pull/881) resolved [#&rust-lang#8203;874](https://redirect.github.com/EmbarkStudios/cargo-deny/issues/874) by cleaning up the CLI, deduplicating some options/flags that caused bug in the `list` subcommand. </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - "before 5am on the first day of the month" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rust-lang/cargo). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zLjIiLCJ1cGRhdGVkSW5WZXIiOiI0NC4zLjIiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOltdfQ==-->
…ace.lints]` instead (rust-lang#17300) ### What does this PR try to resolve? A minor nitpick involving lints. If you add a `[lints.<something>]` table to a workspace's Cargo.toml, cargo will reject it outright when `[workspace.lints.<something>]` would have worked as the user (me :sweat_smile:) probably expected. ### How to test and review this PR? I added a test case (also generalized for any future similar changes, I hope cargo's multi-project functionality gets better over time \:3) and updated the previous test case to exclude this specific change. in short, `cargo test ws_err_similar_suggest,ws_err_unused` should pass.
Validate `package.build` during `normalize_build()` so invalid build script paths are rejected before target construction. Fixes rust-lang#17261.
Split remap rule logic into its `(<from>, <to>)` pair as return values. This is meant to be used in unremap file generation.
This implements the unremap file discussed in 2026 All-Hands. The logic basically follows the unstable SBOM file generation. See <rust-lang/all-hands-2026#38 (comment)> for the concept of the unremap file. See the doc update commit for more about the file format. An example of the unremap file: ```json {"v":1} {"rust_version":"1.96.0-nightly","workspace_root":"/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"} ```
adamgemmell
pushed a commit
to adamgemmell/cargo
that referenced
this pull request
Aug 4, 2026
…7303) *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/cargo/pull/17303)* ### What does this PR try to resolve? Part of <rust-lang#12137>. This was discussed during 2026 all-hands rust-lang/all-hands-2026#38 (comment) This implements the unremap file discussed in 2026 All-Hands. The logic basically follows the unstable SBOM file generation. See <rust-lang/all-hands-2026#38 (comment)> for the concept of the unremap file. See the doc update commit for more about the file format. An example of the unremap file: ```json {"v":1} {"rust_version":"1.96.0-nightly","workspace_root":"/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"} ``` ### How to test and review this PR? Commit by commit. The doc update should have the most descriptive information for the format. ### Note Stacked PR doesn't work with cross-forks stacks 😭😭😭 > Stacked pull requests require all branches to be in the same repository. Cross-fork stacks are not supported. https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/creating-stacked-pull-requests (work on my fork btw weihanglo#97)
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.
No description provided.