Description
Using an empty string for remap_path_prefix breaks debug info on macOS. Remapping to empty string causes paths to become relative paths, which is not supported in all situations for all binary info on all platforms (e.g. OSO stabs in debug info on macOS). For more background on exactly how this breaks debug info, see rust-lang/rust#132143.
Default value for construct_arguments
, see:
rules_rust/rust/private/rustc.bzl
Line 832 in 0cb272d
Remapping of pwd
here:
rules_rust/rust/private/rustc.bzl
Line 995 in 0cb272d
This can be fixed in rules_rust
by not using an empty string for remapping here, at least on macOS, or for all platforms.
In terms of prior art here...
rules_swift uses .
for remapping instead:
rules_go does as well:
Bazel appears to use /proc/self/cwd
at times, but outside of linux you need to manually remap this when debugging, with e.g.
(lldb) settings set target.source-map /proc/self/cwd <...>
Not sure which of these approaches would be best, or who would be the best to consult on this, but I think moving to one of the above is a good path forward.