RUST_BACKTRACE=full produces absolute paths, and RUST_BACKTRACE=1 produces crate-relative paths. When analyzing failure reports, working with tooling like IntelliJ, one needs working-directory or workspace-relative paths to avoid various portability issues. Does anything like this exist to help improve the developer experience?
I created the following as it's technically a compiler issue: Backtrace path usability issue · Issue #113805 · rust-lang/rust · GitHub
You can compile with the
--remap-path-prefix flag to remove the workspace path when used with
=1, the paths should already be relative to the current directory.
Can you share what kind of portability issues you are running into? I would assume any editor can open an absolute path. Are these from binaries that were built on another system?
To clarify this a bit, IntelliJ is fairly flexible here, and should be capable to properly linkify whatever, as long as it is at all possible.
The problem with Rust though is that it's not actually at all possible. In a workspace, Rust often produces ambiguous paths like
./src/lib.rs: which of the dozen lib.rs is that?
I'll give --remap-path-prefix a try, but for the record IntelliJ 2023 can't handle this at all, and I have issues opened with them about it too.