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 #25035.

PiperOrigin-RevId: 719209649
Change-Id: Iaa10a066bf271ffb485d25f38f8db87a020144c6
  • Loading branch information
fmeum authored and copybara-github committed Jan 24, 2025
1 parent 1b41063 commit c906e23
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 c906e23

Please sign in to comment.