Fix ordering of --remap-path-prefix flags.#4008
Fix ordering of --remap-path-prefix flags.#4008slackito wants to merge 1 commit intobazelbuild:mainfrom
--remap-path-prefix flags.#4008Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
These flags are interpreted in reverse order (see rust-lang/rust#82108), and if we have a set of flags like: ``` --remap-path-prefix=/a/b/c/d=. --remap-path-prefix=/a/b=. ``` then the first flag will never apply, because the path will be first rewritten as ./c/d. In this case, output_base is the outermost directory, so we need to make sure it's remapped last.
UebelAndre
left a comment
There was a problem hiding this comment.
Looks good to me! One optional nit
| "--remap-path-prefix=${output_base}=.", | ||
| "--remap-path-prefix=${pwd}=.", | ||
| "--remap-path-prefix=${exec_root}=.", | ||
| ]) |
There was a problem hiding this comment.
Nit: Maybe add an assert message that the ordering is sensitive?
There was a problem hiding this comment.
What do you mean? assert_list_contains_adjacent_elements doesn't have any argument to pass a message.
There was a problem hiding this comment.
Oh, I thought it did, I know some do. Either way, the desire was to ensure folks who encounter this test to be failing don't just update the test to match the current behavior. A note would be nice
These flags are interpreted in reverse order (see
rust-lang/rust#82108), and if we have a set of flags like:
then the first flag will never apply, because the path will be first rewritten as ./c/d.
In this case, output_base is the outermost directory, so we need to make sure it's remapped last.