You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works fine, but if you do the same with rules_py's py_binary, you get this error:
ERROR: /home/ubuntu/dev/bazelbuild/rules_py/examples/py_binary/BUILD.bazel:9:10: in py_binary rule //examples/py_binary:py_binary2: label '//examples/py_binary:py_binary' in $(location) expression expands to more than one file, please use $(locations //examples/py_binary:py_binary) instead. Files (at most 5 shown) are: [bazel-out/aarch64-fastbuild/bin/examples/py_binary/py_binary, bazel-out/aarch64-fastbuild/bin/examples/py_binary/py_binary.venv.pth, examples/py_binary/say.py]
Version
Development (host) and target OS/architectures: ubuntu 22.04
Output of bazel --version: bazel 7.4.0
Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file: see repro case below
The reason this works in rules_python is that they use an exposed internal method to expand the files, rather than the one on ctx, all Bazel built-in rules exhibit this behavior, iirc there's an open issue upstream for it.
That being said, it likely makes sense to remove the other outputs from files on DefaultInfo.
What happened?
Using rules_python's py_binary like this:
Works fine, but if you do the same with rules_py's py_binary, you get this error:
Version
Development (host) and target OS/architectures: ubuntu 22.04
Output of
bazel --version
: bazel 7.4.0Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file: see repro case belowHow to reproduce
On this branch: #456
bazel build :upstream_py_binary2
works finebazel build :py_binary2
fails with the above errorAny other information?
No response
The text was updated successfully, but these errors were encountered: