Path map executable paths
In CommandLines, the very first argument of the first command line is always a path to an executable. As such, it should be path mapped, even when it is a string. This wasn't the case for SpawnAction's created via ctx.actions.run(executable = <some string>).
Work towards #6526 Work towards #22366
Marking this as draft as the idea is flawed: It's possible that the user wants the executable to be looked up in path.
@justinhorvitz Friendly ping
Is this change only necessary due to the optimization detailed at https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java;l=979-982;drc=d32202b20f82c17f75ee204d505b08f2160640f5? That comes from https://github.com/bazelbuild/bazel/commit/d18702c7b0be423ed55d11ddb75d0af5a667182a, for which the internal description mentions a trivial memory savings. Maybe it's not worth it? @comius
Not just because of that: There is plenty of starlark API that doesn't provide access to an Artifact, but just the path of an executable. For example, C++ tool paths and the java binary can only be obtained as strings but may still need to be mapped.
Thanks, it's much easier to justify this change then.
@bazel-io fork 7.3.0
@justinhorvitz @fmeum Just a friendly reminder, the 7.3.0RC1 is scheduled for next Monday, July 29th. Thanks!