Skip to content

Commit

Permalink
Path map tool paths in compilation actions
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 bazelbuild#25035.

PiperOrigin-RevId: 719209649
Change-Id: Iaa10a066bf271ffb485d25f38f8db87a020144c6
  • Loading branch information
fmeum committed Jan 29, 2025
1 parent 3d3f0c2 commit 85009ec
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 85009ec

Please sign in to comment.