Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support modern location expansions for run_binary #490

Merged
merged 8 commits into from Apr 30, 2024

Conversation

UebelAndre
Copy link
Contributor

@UebelAndre UebelAndre commented Mar 2, 2024

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
Copy link
Contributor Author

@tetromino any chance you have time to review this?

rules/run_binary.bzl Outdated Show resolved Hide resolved
rules/run_binary.bzl Outdated Show resolved Hide resolved
@UebelAndre UebelAndre changed the title Improve user feedback for run_binary location expansions Support modern location expansions for run_binary Apr 30, 2024
@UebelAndre
Copy link
Contributor Author

@tetromino you available for another pass?

Copy link
Collaborator

@tetromino tetromino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I've taken the liberty of updating the docs to mention both $(execpath) and $(location).

@tetromino tetromino merged commit 16bf90d into bazelbuild:main Apr 30, 2024
2 checks passed
@UebelAndre UebelAndre deleted the location branch April 30, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants