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
when install_deps(..) is run with rpyc as a requirement(), the Bazel build errors due to duplicate py_binary entries in the generated pip_dependencies set.
Is this a regression?
Have not run a previous version of baxel, with the rpyc dependency.
Description
Issue #702 introduced an edge case bug, where wheels with duplicate console_script entries (by name), differing by the .py extension fail due to duplicate dependencies being generated.
has 4x entries, pairs differeing with a .py extension.
this in turn results in "duplicate" py_binary() rules generated.
(🔥 Exception)
❯ bazel test lib/internal/mylib7/src:mylib7_py
Loading:
Loading: 0 packages loaded
Analyzing: target //lib/internal/mylib7/src:mylib7_py (0 packages loaded, 0 targets configured)
ERROR: Traceback (most recent call last):
File "/home/user8/.cache/bazel/_bazel_user8/09d901cfcd7f772f56461320444edcec/external/pip_dependencies_310_rpyc/BUILD.bazel", line 42, column 10, in <toplevel>
py_binary(
File "/home/user8/.cache/bazel/_bazel_user8/09d901cfcd7f772f56461320444edcec/external/rules_python/python/private/reexports.bzl", line 79, column 21, in py_binary
native.py_binary(**_add_tags(attrs))
Error in py_binary: py_binary rule 'rules_python_wheel_entry_point_rpyc_classic' in package '' conflicts with existing py_binary rule, defined at /home/user8/.cache/bazel/_bazel_user8/09d901cfcd7f772f56461320444edcec/external/pip_dependencies_310_rpyc/BUILD.bazel:33:10
ERROR: /home/user8/projects/svcs.com/acme-eng/main/lib/internal/mylib7/src/BUILD:18:11: Target '@pip_dependencies_310_rpyc//:pkg' contains an error and its package is in error and referenced by '//lib/internal/mylib7/src:mylib7_py'
ERROR: Analysis of target '//lib/internal/mylib7/src:mylib7_py' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.047s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
ERROR: Couldn't start the build. Unable to run tests
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
As per the error, there are indeed two py_binary rules stacked above each other at lines 33 (...pip_dependencies_310_rpyc/BUILD.bazel:33:10)
, and line 42 (...pip_dependencies_310_rpyc/BUILD.bazel", line 42)
#/home/user8/.cache/bazel/_bazel_user8/09d901cfcd7f772f56461320444edcec/external/pip_dependencies_310_rpyc/BUILD.bazel
...
py_binary(
name = "rules_python_wheel_entry_point_rpyc_classic",
srcs = ["rules_python_wheel_entry_point_rpyc_classic.py"],
# This makes this directory a top-level in the python import
# search path for anything that depends on this.
imports = ["."],
deps = ["pkg"],
)
py_binary(
name = "rules_python_wheel_entry_point_rpyc_classic",
srcs = ["rules_python_wheel_entry_point_rpyc_classic.py"],
# This makes this directory a top-level in the python import
# search path for anything that depends on this.
imports = ["."],
deps = ["pkg"],
)
...
🔬 Minimal Reproduction
add rpyc as a dependency in a requirements.txt
add it to the "deps" of a py_library.. e.g.
🐞 bug report
Affected Rule
when
install_deps(..)
is run withrpyc
as arequirement()
, the Bazel build errors due to duplicatepy_binary
entries in the generatedpip_dependencies
set.Is this a regression?
Have not run a previous version of baxel, with the rpyc dependency.
Description
Issue #702 introduced an edge case bug, where wheels with duplicate console_script entries (by name), differing by the
.py
extension fail due to duplicate dependencies being generated.https://github.com/bazelbuild/rules_python/blob/main/python/pip_install/extract_wheels/bazel.py#L399
alters the name by stripping the extension
.py
Which in the case of the pip dependency
rpyc
, creates duplicatepy_binary(...)
rules.has 4x entries, pairs differeing with a
.py
extension.this in turn results in "duplicate" py_binary() rules generated.
(🔥 Exception)
As per the error, there are indeed two py_binary rules stacked above each other at lines 33 (...pip_dependencies_310_rpyc/BUILD.bazel:33:10)
, and line 42 (...pip_dependencies_310_rpyc/BUILD.bazel", line 42)
🔬 Minimal Reproduction
add
rpyc
as a dependency in arequirements.txt
add it to the "deps" of a py_library.. e.g.
and then build that target, when the
pip_dependencies
are read, the error occurs.🌍 Your Environment
Operating System:
Linux
Output of
bazel version
:Rules_python version:
The text was updated successfully, but these errors were encountered: