"local crate" detection does not work any more #3643
Labels
A-cargo
Area: affects the cargo wrapper (cargo miri)
C-bug
Category: This is a bug.
E-good-first-issue
A good way to start contributing, mentoring is available
When splitting a package into multiple crates, backtraces only show underlined code for frames in the binary crate but not for the library crate or workspace members:
Example
src/main.rs
:src/lib.rs
:Backtrace:
Workspace example
Workspace members
a
(binary crate) andb
(library crate):a/src/main.rs
:b/src/lib.rs
:Backtrace:
The relevant code fragments in
entry_point
,a
, andb
are not shown in the backtrace, even though they’re in a local crate (MIRI_LOCAL_CRATES
contains the crateb
). Onlynote: inside [...]
is printed.AFAIU, this is the same issue that was solved in #2024, so I tested the examples with
nightly-2022-04-01
(a few weeks after #2024 was merged), and all code fragments are properly shown. Also, the contents ofMIRI_LOCAL_CRATES
are different:`cargo +nightly-2022-04-01 miri run`
Apparently, the format of
cargo metadata
was changed:cargo
PR that changed.workspace_members
: rust-lang/cargo#12914Issue about this change: rust-lang/cargo#13528
The fix seems to be to use the strings from
.workspace_members
to look up the packagename
in.packages
by theirid
here:miri/cargo-miri/src/util.rs
Lines 242 to 247 in 46cdac0
Rust version:
The text was updated successfully, but these errors were encountered: