bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Path map executable paths

Open fmeum opened this issue 1 year ago • 1 comments

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

fmeum avatar Jun 21 '24 11:06 fmeum

Marking this as draft as the idea is flawed: It's possible that the user wants the executable to be looked up in path.

fmeum avatar Jun 21 '24 12:06 fmeum

@justinhorvitz Friendly ping

fmeum avatar Jul 18 '24 11:07 fmeum

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

justinhorvitz avatar Jul 18 '24 13:07 justinhorvitz

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.

fmeum avatar Jul 18 '24 15:07 fmeum

Thanks, it's much easier to justify this change then.

justinhorvitz avatar Jul 18 '24 15:07 justinhorvitz

@bazel-io fork 7.3.0

fmeum avatar Jul 18 '24 16:07 fmeum

@justinhorvitz @fmeum Just a friendly reminder, the 7.3.0RC1 is scheduled for next Monday, July 29th. Thanks!

iancha1992 avatar Jul 24 '24 22:07 iancha1992