rules_rust
rules_rust copied to clipboard
Usage example for `remap-path-prefix`
As far as I can tell from searching through the source code, rules_rust does support passing this option to rustc, but I can't tell how or where to configure it.
rustc_flags doesn’t work to pass the flags? I’m assuming there’s more nuance to the issue so just want to clarify things
I also would like to see where I can set this. It's not clear for me at all
The remap path prefix is not user-configurable I believe. We have it as a param to the internal function that computes the compiler flags, but that's only ever called with the default of "" or None from the rustdoc definitions.
The thing that makes it a bit special is that it requires ${{pwd}}
substitution:
https://github.com/bazelbuild/rules_rust/blob/c8ab970c4b89dca6cd8cd4ad5c602180acb1e5a9/rust/private/rustc.bzl#L882
Using rustc_flags to set this may just work out of the box, but I'm not sure if the pwd substitution is performed for rustc_flags and what does rustc do in the presence of multiple --remap-path-prefix=
arguments.