bootstrap: forward -fdebug-prefix-map when using cc#159673
bootstrap: forward -fdebug-prefix-map when using cc#159673paradoxicalguy wants to merge 1 commit into
Conversation
| if cc.ends_with("clang") || cc.ends_with("gcc") { | ||
| if cc.ends_with("clang") | ||
| || cc.ends_with("gcc") | ||
| || cc.file_name().is_some_and(|f| f == "cc") |
There was a problem hiding this comment.
On my system, cc is just a symlink to gcc. Could we maybe resolve the symlink and check for clang/gcc?
There was a problem hiding this comment.
i instrumented it, and self.cc(target) is just cc rather than an absolute path (/usr/bin/cc.). so fs::canonicalize won't resolve it directly since it doesn't search PATH. do you have a preferred way to resolve the compiler first,
or is there already a helper in bootstrap that does this?
my shell:
which cc
# /usr/bin/cc
readlink -f "$(which cc)"
# /usr/bin/x86_64-linux-gnu-gcc-13There was a problem hiding this comment.
Hum, that's annoying. Not sure what to do.
|
I'm not sure I'm the best reviewer for this bootstrap change. r? bootstrap |
| let map = format!("{}={}", self.src.display(), map_to); | ||
| let cc = self.cc(target); | ||
| if cc.ends_with("clang") || cc.ends_with("gcc") { | ||
| if cc.ends_with("clang") |
There was a problem hiding this comment.
This check is wrong anyway, you can have e.g. clang-18 or something. What about calling cc_tool instead and checking is_like_clang and is_like_gnu?
There was a problem hiding this comment.
if let Some(map_to) = self.debuginfo_map_to(which, RemapScheme::NonCompiler) {
let map = format!("{}={}", self.src.display(), map_to);
let cc = self.cc_tool(target);
if cc.is_like_clang() || cc.is_like_gnu() {
base.push(format!("-fdebug-prefix-map={map}"));
} else if cc.is_like_clang_cl() {
base.push("-Xclang".into());
base.push(format!("-fdebug-prefix-map={map}"));
}
}
base
passes locally in stage 2 also :)
7c90cef to
99ff7d2
Compare
|
Even regardless of reproducibility, this is a good cleanup, thanks! @bors r+ |
|
yay :D |
This comment has been minimized.
This comment has been minimized.
…, r=Kobzol bootstrap: forward -fdebug-prefix-map when using cc the existing `clang/gcc` checks don't match on systems where `self.cc(target)` resolves to `cc`, so `-fdebug-prefix-map` isn't forwarded to the `C` compiler. this leaves local checkout paths in `compiler-builtins DWARF`. recognize cc as well so the remapping flag is forwarded. confirmed `remap-path-prefix-std passes`, and inspecting the generated `DWARF` to verify that checkout paths are remapped. r? @Urgau cc @bjorn3
|
@bors retry Actions outage |
|
⌛ Testing commit 99ff7d2 with merge b9f688a... Workflow: https://github.com/rust-lang/rust/actions/runs/30161634838 |
…, r=Kobzol bootstrap: forward -fdebug-prefix-map when using cc the existing `clang/gcc` checks don't match on systems where `self.cc(target)` resolves to `cc`, so `-fdebug-prefix-map` isn't forwarded to the `C` compiler. this leaves local checkout paths in `compiler-builtins DWARF`. recognize cc as well so the remapping flag is forwarded. confirmed `remap-path-prefix-std passes`, and inspecting the generated `DWARF` to verify that checkout paths are remapped. r? @Urgau cc @bjorn3
…p-detection, r=Kobzol bootstrap: forward -fdebug-prefix-map when using cc the existing `clang/gcc` checks don't match on systems where `self.cc(target)` resolves to `cc`, so `-fdebug-prefix-map` isn't forwarded to the `C` compiler. this leaves local checkout paths in `compiler-builtins DWARF`. recognize cc as well so the remapping flag is forwarded. confirmed `remap-path-prefix-std passes`, and inspecting the generated `DWARF` to verify that checkout paths are remapped. r? @Urgau cc @bjorn3
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #159905. |
Rollup of 23 pull requests Successful merges: - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159411 ([rustdoc] Correctly handle output options with --show-coverage) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`) - #159810 (Add tuple never coercion collection regression test) - #159826 (Remove redundant `#[rustc_paren_sugar]` feature gate) - #159853 (Updated expect messages for `CString` struct and method documentation) - #159878 (bootstrap: Remove obsolete option `build.compiletest-use-stage0-libtest`) - #159882 (Update expect messages in library/alloc/boxed.rs and library/alloc/string.rs to follow the style guide) - #159891 (Split multiline derives into std/rustc macros) - #159895 (rustc-dev-guide subtree update)
…p-detection, r=Kobzol bootstrap: forward -fdebug-prefix-map when using cc the existing `clang/gcc` checks don't match on systems where `self.cc(target)` resolves to `cc`, so `-fdebug-prefix-map` isn't forwarded to the `C` compiler. this leaves local checkout paths in `compiler-builtins DWARF`. recognize cc as well so the remapping flag is forwarded. confirmed `remap-path-prefix-std passes`, and inspecting the generated `DWARF` to verify that checkout paths are remapped. r? @Urgau cc @bjorn3
…uwer Rollup of 25 pull requests Successful merges: - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159785 (Share _Unwind_Exception definition between native and wasm) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
…uwer Rollup of 25 pull requests Successful merges: - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159785 (Share _Unwind_Exception definition between native and wasm) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
…uwer Rollup of 25 pull requests Successful merges: - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159785 (Share _Unwind_Exception definition between native and wasm) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
…p-detection, r=Kobzol bootstrap: forward -fdebug-prefix-map when using cc the existing `clang/gcc` checks don't match on systems where `self.cc(target)` resolves to `cc`, so `-fdebug-prefix-map` isn't forwarded to the `C` compiler. this leaves local checkout paths in `compiler-builtins DWARF`. recognize cc as well so the remapping flag is forwarded. confirmed `remap-path-prefix-std passes`, and inspecting the generated `DWARF` to verify that checkout paths are remapped. r? @Urgau cc @bjorn3
…uwer Rollup of 25 pull requests Successful merges: - #159825 (codegen: handle OperandValue::Uninit in codegen_return_terminator) - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
…uwer Rollup of 25 pull requests Successful merges: - #159825 (codegen: handle OperandValue::Uninit in codegen_return_terminator) - #138618 (Support using const pointers in asm `const` operand) - #157962 (Lower paths to functions in const args as ConstKind::Error) - #158404 (trait_solver: normalize next-gen region constraints) - #158709 (rustdoc: warn on improperly interleaved HTML/MD) - #159174 (Fix implicit_provenance_casts warnings on Xous) - #159179 (enable `unreachable_cfg_select_predicates` lint as part of `unused` lint group) - #159518 (iter: extend step_by specialization to cover StepBy<RangeIter<{integer}>>) - #159673 (bootstrap: forward -fdebug-prefix-map when using cc) - #159700 (Split non-local `semicolon_in_expressions_from_macros` into a separate lint) - #159720 (document #[global_allocator] constraints) - #159732 (optimization: don't look for diagnostic/canonical items without rustc_attrs enabled) - #159738 (implement `CovariantUnsafeCell`) - #159740 (reuse regular exported_non_generic_symbols logic in Miri) - #159780 (check `extern "custom"` function pointers) - #159786 (rustdoc-js: ignore editor temp files in test folder discovery) - #159819 (std::sync::poison: disable auto_cfg on PoisonError::new) - #155388 (stepping into where-clauses during normalization may be productive) - #155914 (when bailing on ambiguity, don't force other results to ambig) - #159204 (Add support to caller_location to rustc_public) - #159439 (Fix(lib/fs/win): Fall back on Win32 delete for `Dir::remove_file`) - #159676 (Update wasm-component-ld to 0.5.27) - #159695 (proc_macro: Fix cfg_attr inner attrs in file modules) - #159730 (allow accessing the contents of UnsafeCell without going through get) - #159809 (Avoid `#[target_features]`)
the existing
clang/gccchecks don't match on systems whereself.cc(target)resolves tocc, so-fdebug-prefix-mapisn't forwarded to theCcompiler.this leaves local checkout paths in
compiler-builtins DWARF.recognize cc as well so the remapping flag is forwarded. confirmed
remap-path-prefix-std passes, and inspecting the generatedDWARFto verify that checkout paths are remapped.r? @Urgau
cc @bjorn3