Open rickeylev opened 2 years ago
So I propose that the Python rules use execpath semantics for $location expansion.
LGTM
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team (@bazelbuild/triage
) if you think this issue is still relevant or you are interested in getting the issue resolved.
Description of the feature request:
Today, the Python rules, because they're Java-implemented, use rootpath (runfiles-root relative) expansion semantics when expanding
$(location)
in e.g. env, etc. I came across this while re-implementing location expansion for theenv
attribute. (aside: i saw this for env, but i think args uses the same underlying code, but didn't actually check behavior for args).This poses a few problems:
$(location)
makes sense IMHO.)$(location)
act like$(rootpath)
. Thectx.expand_location
function acts like$(execpath)
.Because the main usage of location-expansion is for args and env, where some other input is being passed as an input to the test/binary, using execpath makes sense -- such inputs don't need to be part of the runfiles, and including them in the runfiles is just bloat for the underlying binary (fixing that is it's own change I think).
So I propose that the Python rules use execpath semantics for $location expansion.
What underlying problem are you trying to solve with this feature?
Making the rules more consistent and possible to implement in pure-starlark
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?google build
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.google build
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
Not too much, really. There are sort of related discussions centering around genrule's behavior here, but that's a different rule.
Any other information, logs, or outputs that you want to share?
No response