dtolnay/trybuild

Fails to normalize directory if `--remap-path-prefix` is in use

Opened this issue · 0 comments

I have globally setup my machine to remap some prefixes which include my home directory where I build projects from.

# ~/.cargo/config.toml
[target.x86_64-unknown-linux-gnu]
rustflags = [
  "--remap-path-prefix=/home/nemo157=\u001b[36;1m~\u001b[0m",
]

When running trybuild based tests this remapping blocks the path normalization from working.

I've tried changing a few things but wasn't able to come up with an entirely satisfying solution to this myself. The only one that managed to work was unconditionally setting RUSTFLAGS rather than only overriding that if it exists in the environment, that makes cargo ignore any .cargo/config set rustflags. (The other main change I attempted was to add a [target.$TARGET] section to the generated .cargo/config, that still fails as the flags from these get merged rather than overriding each other).