1
Fork 0
rust/compiler
bors 936eba3b34 Auto merge of #96867 - michaelwoerister:path-prefix-fixes-2, r=davidtwco
--remap-path-prefix: Fix duplicated path components in debuginfo

This PR fixes an issue with `--remap-path-prefix` where path components could appear twice in the remapped version of the path (e.g. https://github.com/rust-lang/rust/issues/78479). The underlying problem was that `--remap-path-prefix` is often used to map an absolute path to something that looks like a relative path, e.g.:

```
--remap-path-prefix=/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823=crates.io",
```

and relative paths in debuginfo are interpreted as being relative to the compilation directory. So if Cargo invokes the compiler with `/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/some_crate-0.1.0/src/lib.rs` as input and `/home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/some_crate-0.1.0` as the compiler's working directory, then debuginfo will state that the working directory was `crates.io/some_crate-0.1.0` and the file is question was `crates.io/some_crate-0.1.0/src/lib.rs`, which combined gives the path:

```
crates.io/some_crate-0.1.0/crates.io/some_crate-0.1.0/src/lib.rs
```

With this PR the compiler will detect this situation and set up debuginfo in LLVM in a way that makes it strip the duplicated path components when emitting DWARF.

The PR also extracts the logic for making remapped paths absolute into a common helper function that is now used by debuginfo too (instead of just during crate metadata generation).
2022-05-18 12:45:44 +00:00
..
rustc
rustc_apfloat
rustc_arena
rustc_ast ast: Introduce some traits to get AST node properties generically 2022-05-11 12:43:27 +03:00
rustc_ast_lowering Auto merge of #96770 - flip1995:fix-trait-type-in-bounds, r=cjgillot 2022-05-08 14:10:12 +00:00
rustc_ast_passes rustc: Stricter checking for #[link] attributes 2022-05-15 02:45:47 +03:00
rustc_ast_pretty ast: Introduce some traits to get AST node properties generically 2022-05-11 12:43:27 +03:00
rustc_attr only_local: always check for misuse 2022-05-10 12:07:35 +02:00
rustc_borrowck Change Successors to impl Iterator<Item = BasicBlock> 2022-05-17 08:41:01 +08:00
rustc_builtin_macros ast: Introduce some traits to get AST node properties generically 2022-05-11 12:43:27 +03:00
rustc_codegen_cranelift Merge commit '63734fcdd7' into sync_cg_clif-2022-05-15 2022-05-15 12:32:19 +02:00
rustc_codegen_gcc Handle tmm_reg in rustc_codegen_gcc 2022-05-17 06:34:58 -04:00
rustc_codegen_llvm Properly apply path prefix remapping paths emitted into debuginfo. 2022-05-18 12:19:01 +02:00
rustc_codegen_ssa Change Successors to impl Iterator<Item = BasicBlock> 2022-05-17 08:41:01 +08:00
rustc_const_eval Rollup merge of #97116 - RalfJung:ref-validity, r=oli-obk 2022-05-18 07:41:01 +09:00
rustc_data_structures Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errors 2022-05-07 06:30:29 +00:00
rustc_driver errors: lazily load fallback fluent bundle 2022-04-13 02:44:59 +01:00
rustc_error_codes rustc: Stricter checking for #[link] attributes 2022-05-15 02:45:47 +03:00
rustc_error_messages migrate maybe_recover_from_bad_type_plus diagnostic 2022-05-16 17:16:27 -05:00
rustc_errors errors: set_arg takes IntoDiagnosticArg 2022-05-12 07:21:51 +01:00
rustc_expand Use pluralize in one instance 2022-05-13 08:48:35 +02:00
rustc_feature change some attrs to only_local 2022-05-10 12:07:36 +02:00
rustc_fs_util
rustc_graphviz update graphviz links 2022-05-12 18:31:42 +09:00
rustc_hir rename visit item-like methods 2022-05-13 11:46:06 -04:00
rustc_hir_pretty Store all generic bounds as where predicates. 2022-04-30 13:55:13 +02:00
rustc_incremental rename visit item-like methods 2022-05-13 11:46:06 -04:00
rustc_index optimize insert_range method of IntervalSet 2022-05-10 19:27:40 +08:00
rustc_infer Rollup merge of #97080 - lcnr:relate-sus, r=oli-obk 2022-05-17 19:01:33 +09:00
rustc_interface only_local: always check for misuse 2022-05-10 12:07:35 +02:00
rustc_lexer
rustc_lint Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwco 2022-05-17 09:39:26 +00:00
rustc_lint_defs Allow the unused_macro_rules lint for now 2022-05-14 12:31:14 +02:00
rustc_llvm Add LLVM based mingw-w64 targets 2022-05-13 20:14:15 +02:00
rustc_log rustc_log: add env var to set verbose entry/exit behavior 2022-05-11 09:14:31 +02:00
rustc_macros errors: set_arg takes IntoDiagnosticArg 2022-05-12 07:21:51 +01:00
rustc_metadata Properly apply path prefix remapping paths emitted into debuginfo. 2022-05-18 12:19:01 +02:00
rustc_middle Rollup merge of #95979 - lcnr:coherence-docs, r=compiler-errors 2022-05-18 08:41:14 +02:00
rustc_mir_build Auto merge of #96883 - jackh726:early-binder-2, r=oli-obk 2022-05-14 23:53:11 +00:00
rustc_mir_dataflow Auto merge of #97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitor 2022-05-17 12:01:12 +00:00
rustc_mir_transform Auto merge of #97111 - JohnTitor:rollup-x3vjf6u, r=JohnTitor 2022-05-17 12:01:12 +00:00
rustc_monomorphize only_local: always check for misuse 2022-05-10 12:07:35 +02:00
rustc_parse keep bounds where they were 2022-05-16 22:23:32 -05:00
rustc_parse_format Make rustc_parse_format compile on stable 2022-05-03 11:26:58 +02:00
rustc_passes Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwco 2022-05-17 09:39:26 +00:00
rustc_plugin_impl
rustc_privacy Rollup merge of #97096 - tmiasko:reachable-constructor, r=petrochenkov 2022-05-18 07:40:58 +09:00
rustc_query_impl Move lint expectation checking into a separate query (RFC 2383) 2022-05-08 14:37:14 +02:00
rustc_query_system Auto merge of #96094 - Elliot-Roberts:fix_doctests, r=compiler-errors 2022-05-07 06:30:29 +00:00
rustc_resolve Rollup merge of #96651 - ken-matsui:omit-unnecessary-help-to-add-cfg-test, r=cjgillot 2022-05-18 07:40:56 +09:00
rustc_save_analysis [save-analysis] Reference the variant not enum at struct-literal construction. 2022-05-12 16:34:02 -07:00
rustc_serialize Remove unused macro rules 2022-04-18 23:28:06 +02:00
rustc_session rustc: Stricter checking for #[link] attributes 2022-05-15 02:45:47 +03:00
rustc_span Properly apply path prefix remapping paths emitted into debuginfo. 2022-05-18 12:19:01 +02:00
rustc_symbol_mangling Auto merge of #96883 - jackh726:early-binder-2, r=oli-obk 2022-05-14 23:53:11 +00:00
rustc_target Add ABI clobbers 2022-05-17 06:48:03 -04:00
rustc_trait_selection Rollup merge of #97123 - ricked-twice:issue-96223-clean-fix, r=jackh726 2022-05-18 08:41:18 +02:00
rustc_traits Add bound_impl_trait_ref 2022-05-13 18:27:40 -04:00
rustc_ty_utils Auto merge of #97012 - oli-obk:🦀_intrinsics, r=davidtwco 2022-05-17 09:39:26 +00:00
rustc_type_ir fix most compiler/ doctests 2022-05-02 17:40:30 -07:00
rustc_typeck Rollup merge of #96378 - compiler-errors:trait-upcast-error, r=nagisa 2022-05-18 08:41:15 +02:00