fix(trim-path): remap paths in build script gen'd code
What does this PR try to resolve?
Remap paths in build script generated code,
by removing the build.build-dir path prefix.
For example, [BUILD_DIR]/debug/build/bar-[HASH]/out/bindings.rs
will be remapped to debug/build/bar-[HASH]/out/bindings.rs.
A concrete scenario would be like:
A build script may call file! macros,
and the associated crate uses include! to include the expanded
file! macro in-place via the OUT_DIR environment.
How to test and review this PR?
Should be quite straightforward.
The open question is what we want to remap to, to help debugger to find the source files. cc #12137 and #13171
r? @epage
rustbot has assigned @epage. They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
@teknalb this should fix the issue you mentioned in https://github.com/rust-lang/rust/issues/111540#issuecomment-2524209170. It is not yet available in nightly, though.