bootstrap: leverage cargo trim-paths - #161049
Conversation
|
@bors try |
This comment has been minimized.
This comment has been minimized.
[experiment] bootstrap: leverage cargo trim-paths
This comment has been minimized.
This comment has been minimized.
|
@bors try cancel |
|
Try build cancelled. Cancelled workflows: |
|
@bors try jobs=dist-x86_64-msvc,dist-x86_64-linux,dist-aarch64-apple |
This comment has been minimized.
This comment has been minimized.
[experiment] bootstrap: leverage cargo trim-paths try-job: dist-x86_64-msvc try-job: dist-x86_64-linux try-job: dist-aarch64-apple
This comment has been minimized.
This comment has been minimized.
|
💔 Test for bd743b7 failed: CI. Failed jobs:
|
b0b31e6 to
9981c62
Compare
This comment has been minimized.
This comment has been minimized.
|
@bors try jobs=dist-x86_64-msvc,dist-x86_64-linux,dist-aarch64-apple |
This comment has been minimized.
This comment has been minimized.
[experiment] bootstrap: leverage cargo trim-paths try-job: dist-x86_64-msvc try-job: dist-x86_64-linux try-job: dist-aarch64-apple
9981c62 to
21aed96
Compare
This comment has been minimized.
This comment has been minimized.
21aed96 to
80d0ecc
Compare
|
@bors try jobs=dist-x86_64-msvc,dist-x86_64-linux,dist-aarch64-apple |
This comment has been minimized.
This comment has been minimized.
[experiment] bootstrap: leverage cargo trim-paths try-job: dist-x86_64-msvc try-job: dist-x86_64-linux try-job: dist-aarch64-apple
|
Sure, I just installed the toolchain with And then tried to compile this dumb test program ( #![feature(rustc_private)]
extern crate rustc_session;
fn main() {
let sess = rustc_session::Session::timer(12u32);
} |
|
I manually looked at the debuginfo with There are however several leaks in compiler-builtins It also reproduces on nightly, so it's not a regression of this PR, and I don't think it's problematic, it's not like we are gonna try to un-remap C deps anyway. |
There was a problem hiding this comment.
Looks good to me.
Thanks for all the hard work, in particular on the Cargo side.
I will let @jieyouxu do his review as well, in particular the bootstrap part.
|
@bors r=Urgau,jieyouxu rollup=never note="path remapping logic" |
Replace `RUSTC_DEBUGINFO_MAP` and `RUSTC_CARGO_REGISTRY_SRC_TO_REMAP` with cargo trim-paths and `__CARGO_RUSTC_BOOTSTRAP_WS_REMAP` override (See cargo#17309). The `RUSTC_DEBUGINFO_MAP` into `-ffile-prefix-map` in rustc_llvm will be covered cc@1.3.0+ natively (which inherits and forwards `CARGO_TRIM_PATHS_REMAP`)
The current dwarfdump checks cannot see `.rmeta` leaks: * The compiler keeps unremapped local paths in metadata unless the remap scope is `all` (see issue 159621) * std ships metadata as separate `.rmeta` via `-Zembed-metadata=no` so the leak does not even appear in the rlibs This commit enhances to also check rmeta files.
Registry dependencies are now remapped by cargo trim-paths as
`/cargo/registry/{source-hash}/{pkg}-{ver}/`
The `-fdebug-prefix-map` flags in `cc_unhandled_cflags` served three kinds of consumers. * The cc-rs-driven C/C++ builds inside cargo: They now inherit the same remap pairs from cargo trim-paths so passing the flag through `CFLAGS` there is redundant. * The CMake-driven LLVM build: This is the one we need the remaps. * The remaining callers (`compiler_file` probing, cc detection, test fixtures): They never produce distributed artifacts.
|
This pull request was unapproved. |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@bors r=Urgau,jieyouxu rollup=never note="path remapping logic" |
This comment has been minimized.
This comment has been minimized.
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 824336a (parent) -> fb9a338 (this PR) Test differencesShow 3 test diffsStage 2
Additionally, 2 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard fb9a3389fdeb347c7658a422ed41b79499434452 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
The test diff is curious. Why would this PR cause compiletest think that LLVM doesn't have zstd or isn't the default codegen backend anymore 🤔 |
|
Ah, maybe that was just because the LLVM stamp was bumped, so the test used a locally built LLVM without zstd (because zstd isn't installed on the test runner), interesting. This is essentially the same issue that we had with GCC and binutils (CC @antoyo just to let you know that we also run into this issue with LLVM). |
|
Finished benchmarking commit (fb9a338): comparison URL. Overall result: no relevant changes - BENCHMARK(S) FAILED@rustbot label: -perf-regression ❗ ❗ ❗ ❗ ❗
❗ ❗ ❗ ❗ ❗ cc @rust-lang/wg-compiler-performance Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (primary 4.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.5%, secondary 2.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: missing data |
|
The failure is not caused by this PR.. sigh. |
|
Did the merge status on this PR... also get lost? |
|
What merge status? |

View all comments
What
Leverage Cargo's
-Ztrim-pathsto remap compiler and library. See rust-lang/cargo#17309. Bootstrap no longer needs custom remap.Changes in toolchain distributions:
/rustc/<sha>remap does not change for toolchain binaries/rustc-dev/<sha>remap does not change for toolchain private binaries/rustc/llvmremap does not change for LLVM we distributed/cargo/registry/<hash>from/rust/deps/cargo/depsfrom/rust/depsThis has some implicit dependencies:
1.3.0+in rustc_llvm and other packages that depend on cc-rs.__CARGO_RUSTC_BOOTSTRAP_WS_REMAPsupportreleaseanddevCargo profiles.try-jobs: dist-x86_64-msvc
try-jobs: dist-x86_64-linux
try-jobs: dist-aarch64-apple
🤖 LLM disclosure: I used LLM to do the first pass of bootstrap integration and temporary stage0 bump. The usage was signed off here on Zulip: #llm-reviews > Experiment with Cargo's trim-path in bootstrap. See #161049 (comment) for a more recent disclosure.