rust icon indicating copy to clipboard operation
rust copied to clipboard

Overhaul filename handling for cross-compiler consistency

Open Urgau opened this issue 2 weeks ago • 19 comments

This PR overhauls the way we handle filenames in the compiler and rmeta in order to achieve achieve cross-compiler consistency (ie. having the same path no matter if the filename was created in the current compiler session or is coming from rmeta).

This is required as some parts of the compiler rely on consistent paths for the soundness of generated code (see rust-lang/rust#148328).

In order to achieved consistency multiple steps are being taken by this PR:

  • by making RealFileName immutable
  • by only having SourceMap::to_real_filename create RealFileName
    • currently RealFileName can be created from any Path and are remapped afterwards, which creates consistency issue
  • by also making RealFileName holds it's working directory, embeddable name and the remapped scopes
    • this removes the need for a Session, to know the current(!) scopes and cwd, which is invalid as they may not be equal to the scopes used when creating the filename

In order for SourceMap::to_real_filename to know which scopes to apply FilePathMapping now takes the current remapping scopes to apply, which makes FileNameDisplayPreference and company useless and are removed.

This PR is split-up in multiple commits (unfortunately not atomic), but should help review the changes.

Unblocks https://github.com/rust-lang/rust/pull/147611 Fixes https://github.com/rust-lang/rust/issues/148328

cc @RalfJung @oli-obk r? @davidtwco

Urgau avatar Dec 06 '25 11:12 Urgau

Some changes occurred in coverage instrumentation.

cc @Zalathar

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged. Otherwise, you can ignore this comment.

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

rustbot avatar Dec 06 '25 11:12 rustbot

The job tidy failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    ╭▸ compiler/rustc_span/src/lib.rs:270:12
    │
270 │ /// and by extention `RealFileName` to be consistent across compiler sessions.
    ╰╴           ━━━━━━━━━
error: `sufficiant` should be `sufficient`
    ╭▸ compiler/rustc_span/src/lib.rs:274:31
    │
274 │ /// As such this type is self-sufficiant and consistent in it's output.
    ╰╴                              ━━━━━━━━━━
error: `guarenteed` should be `guaranteed`
    ╭▸ compiler/rustc_span/src/lib.rs:277:9
    │
277 │ /// are guarenteed to always return the same output across compiler sessions.
    ╰╴        ━━━━━━━━━━
error: `Retriving` should be `Retrieving`
    ╭▸ compiler/rustc_span/src/lib.rs:283:5
    │
283 │ /// Retriving a path can be done in two main ways:
    ╰╴    ━━━━━━━━━
error: `prefered` should be `preferred`
    ╭▸ compiler/rustc_span/src/lib.rs:284:70
    │
284 │ ///  - by using [`RealFileName::path`] with a given scope (should be prefered)
    ╰╴                                                                     ━━━━━━━━
error: `happend` should be `happened`, `happens`, `happen`
    ╭▸ compiler/rustc_span/src/lib.rs:290:73
    │
290 │     /// The maybe remapped part. Correspond to `local` when no remapped happend.
    ╰╴                                                                        ━━━━━━━
error: `guarented` should be `guaranteed`
    ╭▸ compiler/rustc_span/src/lib.rs:347:36
    │
347 │     /// The embedabble path is not guarented to be an absolute path, nor is it garuenteed
    ╰╴                                   ━━━━━━━━━
error: `completly` should be `completely`
    ╭▸ compiler/rustc_span/src/lib.rs:407:42
    │
407 │     /// Returns a `RealFileName` that is completly remapped without any local components.
    ╰╴                                         ━━━━━━━━━
rerun tidy with `--extra-checks=spellcheck --bless` to fix typos
tidy [extra_checks]: checks with external tool 'typos' failed
tidy [extra_checks]: FAIL
tidy: The following check failed: extra_checks
Bootstrap failed while executing `test src/tools/tidy tidyselftest --extra-checks=py,cpp,js,spellcheck`
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/rust-tidy /checkout /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo /checkout/obj/build 4 /node/bin/yarn --extra-checks=py,cpp,js,spellcheck` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:1612:23
Executed at: src/bootstrap/src/core/build_steps/test.rs:1314:29

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:02:41
  local time: Sat Dec  6 11:21:14 UTC 2025
  network time: Sat, 06 Dec 2025 11:21:14 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

rust-log-analyzer avatar Dec 06 '25 11:12 rust-log-analyzer

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

rustbot avatar Dec 06 '25 12:12 rustbot

@bors try @rust-timer queue

RalfJung avatar Dec 06 '25 12:12 RalfJung

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

rust-timer avatar Dec 06 '25 12:12 rust-timer

:hourglass: Trying commit 2dc3531ebb6ec48aa54c5fe8056e72a0cafa39f2 with merge 98a0a373b0fdb827cfadd374735aef0fef8b1901…

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/19988364169

rust-bors[bot] avatar Dec 06 '25 12:12 rust-bors[bot]

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_public test:true 4.622
   Compiling rustc_passes v0.0.0 (/checkout/compiler/rustc_passes)
[RUSTC-TIMING] rustc_passes test:true 4.622
   Compiling rustc_resolve v0.0.0 (/checkout/compiler/rustc_resolve)
error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
  --> compiler/rustc_resolve/src/rustdoc/tests.rs:12:48
   |
12 |     sm.new_source_file(PathBuf::from("foo.rs").into(), r#"#[doc = "`"] fn foo() {}"#.to_string());
   |                                                ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
   |
   = note: required for `PathBuf` to implement `Into<FileName>`

error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
  --> compiler/rustc_resolve/src/rustdoc/tests.rs:35:48
   |
35 |     sm.new_source_file(PathBuf::from("foo.rs").into(), r#"#[doc = "⚠"] fn foo() {}"#.to_string());
   |                                                ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
   |
   = note: required for `PathBuf` to implement `Into<FileName>`

[RUSTC-TIMING] rustc_hir_typeck test:true 14.748
   Compiling rustc_borrowck v0.0.0 (/checkout/compiler/rustc_borrowck)

rust-log-analyzer avatar Dec 06 '25 12:12 rust-log-analyzer

@bors try cancel

RalfJung avatar Dec 06 '25 13:12 RalfJung

Try build cancelled. Cancelled workflows:

  • https://github.com/rust-lang/rust/actions/runs/19988364169

rust-bors[bot] avatar Dec 06 '25 13:12 rust-bors[bot]

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
    Checking rustc_codegen_gcc v0.1.0 (/checkout/compiler/rustc_codegen_gcc)
error: the borrowed expression implements the required traits
   --> compiler/rustc_codegen_gcc/src/debuginfo.rs:301:17
    |
301 |                 &name.path(rustc_span::RemapPathScopeComponents::DEBUGINFO).to_string_lossy(),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `name.path(rustc_span::RemapPathScopeComponents::DEBUGINFO).to_string_lossy()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
    = note: `-D clippy::needless-borrows-for-generic-args` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::needless_borrows_for_generic_args)]`

rust-log-analyzer avatar Dec 06 '25 14:12 rust-log-analyzer

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] rustc_ast_lowering test:true 3.855
   Compiling rustc_parse v0.0.0 (/checkout/compiler/rustc_parse)
[RUSTC-TIMING] rustc_expand test:true 4.518
   Compiling rustc_mir_dataflow v0.0.0 (/checkout/compiler/rustc_mir_dataflow)
error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
  --> compiler/rustc_parse/src/parser/tests.rs:36:35
   |
36 |         PathBuf::from("bogofile").into(),
   |                                   ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
   |
   = note: required for `PathBuf` to implement `Into<FileName>`

error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
   --> compiler/rustc_parse/src/parser/tests.rs:103:35
    |
103 |         PathBuf::from("bogofile").into(),
    |                                   ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
    |
    = note: required for `PathBuf` to implement `Into<FileName>`

error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
   --> compiler/rustc_parse/src/parser/tests.rs:198:66
    |
198 |                 .new_source_file(Path::new("test.rs").to_owned().into(), file_text.to_owned());
    |                                                                  ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
    |
    = note: required for `PathBuf` to implement `Into<FileName>`

error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
    --> compiler/rustc_parse/src/parser/tests.rs:2528:34
     |
2528 |             PathBuf::from("foo").into(),
     |                                  ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
     |
     = note: required for `PathBuf` to implement `Into<FileName>`

error[E0277]: the trait bound `FileName: From<PathBuf>` is not satisfied
    --> compiler/rustc_parse/src/parser/tests.rs:2892:34
     |
2892 |             PathBuf::from("foo").into(),
     |                                  ^^^^ the trait `From<PathBuf>` is not implemented for `FileName`
     |
     = note: required for `PathBuf` to implement `Into<FileName>`

[RUSTC-TIMING] rustc_mir_dataflow test:true 4.475
   Compiling rustc_traits v0.0.0 (/checkout/compiler/rustc_traits)

rust-log-analyzer avatar Dec 06 '25 15:12 rust-log-analyzer

The job x86_64-gnu-gcc failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/reproducible-build stdout ----

error: rmake recipe failed to complete
status: exit status: 101
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/reproducible-build/rmake_out" && env -u RUSTFLAGS -u __RUSTC_DEBUG_ASSERTIONS_ENABLED -u __STD_DEBUG_ASSERTIONS_ENABLED AR="ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="cc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" CXX="c++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m64" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="x86_64-unknown-linux-gnu" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/reproducible-build/rmake"
stdout: none
--- stderr -------------------------------
smoke_test => None
smoke_test => SmokeFlag::Debug
smoke_test => SmokeFlag::Opt
paths_test => PathsFlag::Link
paths_test => PathsFlag::Remap
diff_dir_test => Bin, Path
diff_dir_test => Rlib, Path

thread 'main' (52904) panicked at /checkout/tests/run-make/reproducible-build/rmake.rs:256:17:
assertion failed: rfs::read(rust_lib_name("foo")) ==
    rfs::read(rust_lib_name("reproducible_build"))
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f/library/core/src/panicking.rs:80:14

For more information how to resolve CI failures of this job, visit this link.

rust-log-analyzer avatar Dec 06 '25 17:12 rust-log-analyzer

The job pr-check-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
 Documenting rustc_span v0.0.0 (/checkout/compiler/rustc_span)
error: unresolved link to `SourceMap::to_real_filename`
   --> compiler/rustc_span/src/lib.rs:281:59
    |
281 | /// Creation of a [`RealFileName`] SHOULD be done using [`SourceMap::to_real_filename`].
    |                                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the struct `SourceMap` has no field or associated item named `to_real_filename`
    |
    = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(rustdoc::broken_intra_doc_links)]`

error: could not document `rustc_span`
warning: build failed, waiting for other jobs to finish...
Bootstrap failed while executing `doc compiler --stage 1`
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo doc --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout --locked --color always --release --features llvm --manifest-path /checkout/compiler/rustc/Cargo.toml -Zskip-rustdoc-fingerprint --no-deps -Zrustdoc-map -p rustc-main -p rustc_abi -p rustc_arena -p rustc_ast -p rustc_ast_ir -p rustc_ast_lowering -p rustc_ast_passes -p rustc_ast_pretty -p rustc_attr_parsing -p rustc_baked_icu_data -p rustc_borrowck -p rustc_builtin_macros -p rustc_codegen_llvm -p rustc_codegen_ssa -p rustc_const_eval -p rustc_data_structures -p rustc_driver -p rustc_driver_impl -p rustc_error_codes -p rustc_error_messages -p rustc_errors -p rustc_expand -p rustc_feature -p rustc_fluent_macro -p rustc_fs_util -p rustc_graphviz -p rustc_hashes -p rustc_hir -p rustc_hir_analysis -p rustc_hir_id -p rustc_hir_pretty -p rustc_hir_typeck -p rustc_incremental -p rustc_index -p rustc_index_macros -p rustc_infer -p rustc_interface -p rustc_lexer -p rustc_lint -p rustc_lint_defs -p rustc_llvm -p rustc_log -p rustc_macros -p rustc_metadata -p rustc_middle -p rustc_mir_build -p rustc_mir_dataflow -p rustc_mir_transform -p rustc_monomorphize -p rustc_next_trait_solver -p rustc_parse -p rustc_parse_format -p rustc_passes -p rustc_pattern_analysis -p rustc_privacy -p rustc_proc_macro -p rustc_public -p rustc_public_bridge -p rustc_query_impl -p rustc_query_system -p rustc_resolve -p rustc_sanitizers -p rustc_serialize -p rustc_session -p rustc_span -p rustc_symbol_mangling -p rustc_target -p rustc_thread_pool -p rustc_trait_selection -p rustc_traits -p rustc_transmute -p rustc_ty_utils -p rustc_type_ir -p rustc_type_ir_macros -p rustc_windows_rc [workdir=/checkout]` failed with exit code 101
Created at: src/bootstrap/src/core/build_steps/doc.rs:916:25
Executed at: src/bootstrap/src/core/build_steps/doc.rs:976:26

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:04:15
  local time: Sat Dec  6 18:45:15 UTC 2025
  network time: Sat, 06 Dec 2025 18:45:15 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

rust-log-analyzer avatar Dec 06 '25 18:12 rust-log-analyzer

@bors try

Urgau avatar Dec 06 '25 21:12 Urgau

:hourglass: Trying commit 62464ef0d926da075825fe381d7a5e84f8f9bd93 with merge 05b33656fd9ded2829b42521378e6fa37f788cc6…

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/19994278534

rust-bors[bot] avatar Dec 06 '25 21:12 rust-bors[bot]

:sunny: Try build successful (CI) Build commit: 05b33656fd9ded2829b42521378e6fa37f788cc6 (05b33656fd9ded2829b42521378e6fa37f788cc6, parent: ba86c0460b0233319e01fd789a42a7276eade805)

rust-bors[bot] avatar Dec 06 '25 23:12 rust-bors[bot]

Queued 05b33656fd9ded2829b42521378e6fa37f788cc6 with parent ba86c0460b0233319e01fd789a42a7276eade805, future comparison URL. There is currently 1 preceding artifact in the queue. It will probably take at least ~2.1 hours until the benchmark run finishes.

rust-timer avatar Dec 06 '25 23:12 rust-timer

Finished benchmarking commit (05b33656fd9ded2829b42521378e6fa37f788cc6): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

@bors rollup=never @rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.7% [0.2%, 1.1%] 7
Regressions ❌
(secondary)
0.6% [0.0%, 2.2%] 32
Improvements ✅
(primary)
-0.6% [-1.6%, -0.2%] 12
Improvements ✅
(secondary)
-0.3% [-0.7%, -0.2%] 4
All ❌✅ (primary) -0.2% [-1.6%, 1.1%] 19

Max RSS (memory usage)

Results (primary 0.7%, secondary 1.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
3.2% [2.3%, 6.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.8% [-4.4%, -3.1%] 2
All ❌✅ (primary) 0.7% [0.7%, 0.7%] 1

Cycles

Results (primary -2.6%, secondary -0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
4.0% [4.0%, 4.0%] 1
Improvements ✅
(primary)
-2.6% [-2.6%, -2.6%] 1
Improvements ✅
(secondary)
-2.4% [-2.7%, -2.0%] 3
All ❌✅ (primary) -2.6% [-2.6%, -2.6%] 1

Binary size

Results (primary 0.1%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 96
Regressions ❌
(secondary)
0.1% [0.0%, 0.4%] 54
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 4
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 2
All ❌✅ (primary) 0.1% [-0.0%, 0.3%] 100

Bootstrap: 470.7s -> 471.092s (0.08%) Artifact size: 388.87 MiB -> 388.90 MiB (0.01%)

rust-timer avatar Dec 07 '25 01:12 rust-timer

Those perf results seems to be mostly noise.

Instruction count saw a lot of variability but is overall positive for primary, but more interestingly Max RSS, Cycles and Wall Time are within noise level.

The only metric that shows a really change is Binary size since we now encode more metadata. Before we encoded two PathBuf max, now we encode six PathBuf max (two * (name, working dir, embeddable name)).

We could potentially de-duplicate the encoding of the working directory but that seems like a lot of work for not much gain.

Urgau avatar Dec 07 '25 12:12 Urgau

:umbrella: The latest upstream changes (presumably #149455) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Dec 08 '25 14:12 bors

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.

rustbot avatar Dec 08 '25 16:12 rustbot

:umbrella: The latest upstream changes (presumably #149776) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Dec 09 '25 03:12 bors

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.

rustbot avatar Dec 09 '25 06:12 rustbot

@bors r+

davidtwco avatar Dec 09 '25 11:12 davidtwco

:pushpin: Commit 06ff58da2cae5bda2e82f6e4d927f34b5096ff77 has been approved by davidtwco

It is now in the queue for this repository.

bors avatar Dec 09 '25 11:12 bors

:hourglass: Testing commit 06ff58da2cae5bda2e82f6e4d927f34b5096ff77 with merge 632265e7438e3b82bd21b0816ad52e3a6ecb924a...

bors avatar Dec 09 '25 14:12 bors

The job armhf-gnu failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests/run-make/remap-path-prefix-consts stdout ----

error: rmake recipe failed to complete
status: exit status: 1
command: cd "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/remap-path-prefix-consts/rmake_out" && env -u RUSTFLAGS AR="arm-linux-gnueabihf-ar" BUILD_ROOT="/checkout/obj/build/x86_64-unknown-linux-gnu" CC="arm-linux-gnueabihf-gcc" CC_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -mfpu=vfp" CXX="arm-linux-gnueabihf-g++" CXX_DEFAULT_FLAGS="-ffunction-sections -fdata-sections -fPIC -march=armv6 -marm -mfpu=vfp" HOST_RUSTC_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" LD_LIB_PATH_ENVVAR="LD_LIBRARY_PATH" LLVM_BIN_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin" LLVM_COMPONENTS="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgputargetmca amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo cfguard cgdata codegen codegentypes core coroutines coverage csky cskyasmparser cskycodegen cskydesc cskydisassembler cskyinfo debuginfobtf debuginfocodeview debuginfodwarf debuginfodwarflowlevel debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarfcfichecker dwarflinker dwarflinkerclassic dwarflinkerparallel dwp engine executionengine extensions filecheck frontendatomic frontenddirective frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo hipstdpar instcombine instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker loongarch loongarchasmparser loongarchcodegen loongarchdesc loongarchdisassembler loongarchinfo lto m68k m68kasmparser m68kcodegen m68kdesc m68kdisassembler m68kinfo mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvtargetmca runtimedyld sandboxir scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target targetparser telemetry textapi textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86targetmca xray xtensa xtensaasmparser xtensacodegen xtensadesc xtensadisassembler xtensainfo" LLVM_FILECHECK="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" PYTHON="/usr/bin/python3" REMOTE_TEST_CLIENT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-client" RUSTC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" RUSTC_LINKER="arm-linux-gnueabihf-gcc" RUSTDOC="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" SOURCE_ROOT="/checkout" TARGET="arm-unknown-linux-gnueabihf" TARGET_EXE_DYLIB_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/arm-unknown-linux-gnueabihf/lib" __RUSTC_DEBUG_ASSERTIONS_ENABLED="1" __STD_DEBUG_ASSERTIONS_ENABLED="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/remap-path-prefix-consts/rmake"
stdout: none
--- stderr -------------------------------
command failed at line 16
Command { cmd: LD_LIBRARY_PATH="/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/remap-path-prefix-consts/rmake_out:/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib:/checkout/obj/build/x86_64-unknown-linux-gnu/bootstrap-tools/x86_64-unknown-linux-gnu/release/deps:/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/remap-path-prefix-consts/rmake_out" "--crate-type" "bin" "runner.rs" "-o" "runner-no-remap-rel-paths" "--target=arm-unknown-linux-gnueabihf", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc", defused: true, armed_location: Location { file: "/checkout/tests/run-make/remap-path-prefix-consts/rmake.rs", line: 14, column: 26 } }, already_executed: true }
output status: `exit status: 1`
=== STDOUT ===



=== STDERR ===
error: linking with `cc` failed: exit status: 1
  |
  = note:  "cc" "/tmp/rustcAHe1y7/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/remap-path-prefix-consts/rmake_out/liblocation_caller.rlib" "<sysroot>/lib/rustlib/arm-unknown-linux-gnueabihf/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,libcfg_if-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcAHe1y7/raw-dylibs" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make/remap-path-prefix-consts/rmake_out" "-L" "<sysroot>/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "-o" "runner-no-remap-rel-paths" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: /usr/bin/ld: runner-no-remap-rel-paths.runner.ce536bab613362ab-cgu.0.rcgu.o: relocations in generic ELF (EM: 40)
          /usr/bin/ld: runner-no-remap-rel-paths.runner.ce536bab613362ab-cgu.0.rcgu.o: relocations in generic ELF (EM: 40)
          /usr/bin/ld: runner-no-remap-rel-paths.runner.ce536bab613362ab-cgu.0.rcgu.o: relocations in generic ELF (EM: 40)
          /usr/bin/ld: runner-no-remap-rel-paths.runner.ce536bab613362ab-cgu.0.rcgu.o: relocations in generic ELF (EM: 40)

rust-log-analyzer avatar Dec 09 '25 16:12 rust-log-analyzer

:broken_heart: Test failed - checks-actions

bors avatar Dec 09 '25 16:12 bors

@bors try jobs=armhf-gnu

Urgau avatar Dec 09 '25 17:12 Urgau

:hourglass: Trying commit b43d24b4cde4a0eac149ba26fe50afb584b56db5 with merge 9e0d905deadea6b3043e15889ddbb0a45e2d464b…

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/20073402766

rust-bors[bot] avatar Dec 09 '25 17:12 rust-bors[bot]