bazelbuild / bazel-skylib

Common useful functions and rules for Bazel
https://bazel.build/
Apache License 2.0
376 stars 179 forks source link

Support modern location expansions for run_binary #490

Closed UebelAndre closed 3 months ago

UebelAndre commented 5 months ago

A common point of confusion I see around run_binary is that it's hard coded to only expand $(location values which in codebases I work in are otherwise completely eliminated due to it being described as "legacy"

location: A synonym for either execpath or rootpath, depending on the attribute being expanded. This is legacy pre-Starlark behavior and not recommended unless you really know what it does for a particular rule. See #2475 for details.

If execpath is used instead as the appropriate alternative, the rule does no do any expansion and fails the action. This change adds support for expanding all available patterns whenever they're provided.

UebelAndre commented 3 months ago

@tetromino any chance you have time to review this?

UebelAndre commented 3 months ago

@tetromino you available for another pass?