Skip to content

Commit

Permalink
[8.1.0] Path map tool paths in compilation actions (#25053)
Browse files Browse the repository at this point in the history
This is required for toolchains where tools are generated files, e.g.
wrappers around compilers.

Closes #25035.

PiperOrigin-RevId: 719209649
Change-Id: Iaa10a066bf271ffb485d25f38f8db87a020144c6

Commit
c906e23

Co-authored-by: Fabian Meumertzheim <[email protected]>
  • Loading branch information
bazel-io and fmeum authored Jan 27, 2025
1 parent afcbcb3 commit df8545c
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,13 @@ List<String> getArguments(
List<String> commandLine = new ArrayList<>();

// first: The command name.
commandLine.add(getToolPath());
if (pathMapper.isNoop()) {
commandLine.add(getToolPath());
} else {
// getToolPath() ultimately returns a PathFragment's getSafePathString(), so its safe to
// reparse it here with no risk of e.g. altering a user-specified absolute path.
commandLine.add(pathMapper.map(PathFragment.create(getToolPath())).getSafePathString());
}

// second: The compiler options.
if (parameterFilePath != null) {
Expand Down

0 comments on commit df8545c

Please sign in to comment.