You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
remap-path-prefix will not re-compile properly in dev build #66955
Using remap-path-prefix in development builds has no effect.
I'm not sure if this is intended or not, but it's not documented.
Would write a documentation PR if this is intended.
Changing remap-path-prefix in dev mode will not properly cause re-compilation and the debug info will not change.
In release mode changing the flag will always cause proper re-compilation and update the debug info accordingly.
😞, I was just trying to reproduce it again, but couldn't.
Apparently the issue was that changing the flag wouldn't cause proper re-compilation, so cargo clean solved the problem.
Sorry!
So this is now a re-compilation issue!
For some reason in release it would always re-compile properly when changing this flag, but in development it wouldn't.
Is this due to debuginfo included in the binary?
I'm not sure how it behaves on other operating systems, but in windows both dev and release builds produce the debug info as a seperate file.
Obviously in release mode we have to define debug = true, otherwise there won't be any debuginfo to begin with.
Cargo.toml:
[profile.release]
debug = true
main.rs:
fnmain(){panic!("test");}
Both commands run with: RUSTFLAGS = "--remap-path-prefix WORKING_DIRECTORY=" RUST_BACKTRACE = "full"
cargo run:
thread 'main' panicked at 'test', src\main.rs:2:5
stack backtrace:
0: 0x7ff74bf77bb9 - backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator\.cargo\registry\src\github.life-white.uk-1ecc6299db9ec823\backtrace-0.3.40\src\backtrace\mod.rs:66
1: 0x7ff74bf77bb9 - std::sys_common::backtrace::_print_fmt
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:84
2: 0x7ff74bf77bb9 - std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:61
3: 0x7ff74bf86e8b - core::fmt::write
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libcore\fmt\mod.rs:1030
4: 0x7ff74bf75b94 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\io\mod.rs:1412
5: 0x7ff74bf7a269 - std::sys_common::backtrace::_print
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:65
6: 0x7ff74bf7a269 - std::sys_common::backtrace::print
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:50
7: 0x7ff74bf7a269 - std::panicking::default_hook::{{closure}}
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:188
8: 0x7ff74bf79ebc - std::panicking::default_hook
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:205
9: 0x7ff74bf7a99c - std::panicking::rust_panic_with_hook
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:464
10: 0x7ff74bf71ef1 - std::panicking::begin_panic<str*>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\src\libstd\panicking.rs:400
11: 0x7ff74bf71e4c - test-remap::main
at C:\Users\User\Documents\rust\test-remap\src\main.rs:2
12: 0x7ff74bf716d0 - std::rt::lang_start::{{closure}}<()>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\src\libstd\rt.rs:61
13: 0x7ff74bf7a3e7 - std::rt::lang_start_internal::{{closure}}
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\rt.rs:48
14: 0x7ff74bf7a3e7 - std::panicking::try::do_call<closure-0,i32>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:287
15: 0x7ff74bf7cd72 - panic_unwind::__rust_maybe_catch_panic
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libpanic_unwind\lib.rs:81
16: 0x7ff74bf7abc2 - std::panicking::try
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:265
17: 0x7ff74bf7abc2 - std::panic::catch_unwind
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panic.rs:395
18: 0x7ff74bf7abc2 - std::rt::lang_start_internal
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\rt.rs:47
19: 0x7ff74bf716ab - std::rt::lang_start<()>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\src\libstd\rt.rs:61
20: 0x7ff74bf71e70 - main
21: 0x7ff74bf89790 - invoke_main
at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
22: 0x7ff74bf89790 - __scrt_common_main_seh
at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
23: 0x7ff99d497974 - BaseThreadInitThunk
24: 0x7ff99f98a271 - RtlUserThreadStart
cargo run --release:
thread 'main' panicked at 'test', src\main.rs:2:5
stack backtrace:
0: 0x7ff797ab6959 - backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator\.cargo\registry\src\github.life-white.uk-1ecc6299db9ec823\backtrace-0.3.40\src\backtrace\mod.rs:66
1: 0x7ff797ab6959 - std::sys_common::backtrace::_print_fmt
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:84
2: 0x7ff797ab6959 - std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:61
3: 0x7ff797ac5afb - core::fmt::write
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libcore\fmt\mod.rs:1030
4: 0x7ff797ab4934 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\io\mod.rs:1412
5: 0x7ff797ab9009 - std::sys_common::backtrace::_print
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:65
6: 0x7ff797ab9009 - std::sys_common::backtrace::print
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\sys_common\backtrace.rs:50
7: 0x7ff797ab9009 - std::panicking::default_hook::{{closure}}
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:188
8: 0x7ff797ab8c5c - std::panicking::default_hook
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:205
9: 0x7ff797ab973c - std::panicking::rust_panic_with_hook
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:464
10: 0x7ff797ab1025 - std::panicking::begin_panic<str*>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\src\libstd\panicking.rs:400
11: 0x7ff797ab111c - test-remap::main
at \src\main.rs:2
12: 0x7ff797ab10d6 - std::rt::lang_start::{{closure}}<()>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\src\libstd\rt.rs:61
13: 0x7ff797ab9187 - std::rt::lang_start_internal::{{closure}}
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\rt.rs:48
14: 0x7ff797ab9187 - std::panicking::try::do_call<closure-0,i32>
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:287
15: 0x7ff797abbb12 - panic_unwind::__rust_maybe_catch_panic
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libpanic_unwind\lib.rs:81
16: 0x7ff797ab9962 - std::panicking::try
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panicking.rs:265
17: 0x7ff797ab9962 - std::panic::catch_unwind
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\panic.rs:395
18: 0x7ff797ab9962 - std::rt::lang_start_internal
at /rustc/412f43ac5b4ae8c3599e71c6972112e9be4758fa\/src\libstd\rt.rs:47
19: 0x7ff797ab1147 - main
20: 0x7ff797ac8400 - invoke_main
at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
21: 0x7ff797ac8400 - __scrt_common_main_seh
at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
22: 0x7ff99d497974 - BaseThreadInitThunk
23: 0x7ff99f98a271 - RtlUserThreadStart
changed the title [-]`remap-path-prefix` only effective in release builds[/-][+]`remap-path-prefix` will not re-compile properly in `dev` build[/+]on Dec 2, 2019
I haven't tested it out, but I believe changing remap_path_prefix to TRACKED will cause other problems, as it means the argument's value will be hashed. Then two builds in different directories that try to use that flag to get the same output will differ as they have different values for that argument.
Activity
jonas-schievink commentedon Dec 2, 2019
Can you provide an example of this? Is this due to debuginfo included in the binary?
daxpedda commentedon Dec 2, 2019
😞, I was just trying to reproduce it again, but couldn't.
Apparently the issue was that changing the flag wouldn't cause proper re-compilation, so
cargo cleansolved the problem.Sorry!
So this is now a re-compilation issue!
For some reason in
releaseit would always re-compile properly when changing this flag, but indevelopmentit wouldn't.I'm not sure how it behaves on other operating systems, but in windows both
devandreleasebuilds produce the debug info as a seperate file.Obviously in
releasemode we have to definedebug = true, otherwise there won't be any debuginfo to begin with.Cargo.toml:main.rs:Both commands run with:
RUSTFLAGS = "--remap-path-prefix WORKING_DIRECTORY="RUST_BACKTRACE = "full"cargo run:cargo run --release:[-]`remap-path-prefix` only effective in release builds[/-][+]`remap-path-prefix` will not re-compile properly in `dev` build[/+]jonas-schievink commentedon Dec 2, 2019
Perhaps the option needs to be TRACKED instead of UNTRACKED here?
rust/src/librustc/session/config.rs
Line 459 in 4af3ee8
daxpedda commentedon Dec 2, 2019
I wanted to try it out, but I'm kinda having trouble building
rustcit seems. So feel free to check it out.jgalenson commentedon Feb 6, 2020
I haven't tested it out, but I believe changing remap_path_prefix to TRACKED will cause other problems, as it means the argument's value will be hashed. Then two builds in different directories that try to use that flag to get the same output will differ as they have different values for that argument.
jyn514 commentedon Apr 15, 2021
Well yes, that's the whole point. Their inputs are different so the outputs need to be recomputed. Otherwise it will end up caching the wrong values.
Note that TRACKED can never break builds, or change the output compared to a non-incremental build, it can only make them slower.
Rollup merge of rust-lang#84233 - jyn514:track-path-prefix, r=michael…
Rollup merge of rust-lang#84233 - jyn514:track-path-prefix, r=michael…