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

[Bug]: Conflicting symlinks found when attempting to create venv. #358

Closed
anuragkanungo opened this issue Jun 29, 2024 · 4 comments · Fixed by #369
Closed

[Bug]: Conflicting symlinks found when attempting to create venv. #358

anuragkanungo opened this issue Jun 29, 2024 · 4 comments · Fixed by #369
Assignees
Labels
bug Something isn't working

Comments

@anuragkanungo
Copy link

What happened?

Using version 0.7.3 I am seeing

-----------------------------------------------------------------------------
Error:   × Unable to run command:
  ├─▶ Conflicting symlinks found when attempting to create venv. More than one
  │   package provides the file at these paths
  ├─▶ pip_deps_mcap_protobuf_support/site-packages/tests/test_writer.py
  ╰─▶ site-packages/tests/test_writer.py

These are the files

./bazel-voxel/external/pip_deps_mcap/site-packages/tests/test_writer.py
./bazel-voxel/external/pip_deps_mcap_protobuf_support/site-packages/tests/test_writer.py

In a typical pip installation the second file overwrites the first one.

Version

Development (host) and target OS/architectures: Linux x86-64

Output of bazel --version: bazel 7.1.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file: 0.7.3

Language(s) and/or frameworks involved:

How to reproduce

Adding these pip packages

mcap==0.0.15
mcap-protobuf-support==0.0.9


### Any other information?

_No response_
@mattem
Copy link
Collaborator

mattem commented Jul 4, 2024

In a typical pip installation the second file overwrites the first one.

Are the file contents checked before overwriting, or only the name taken into consideration? If so, then which one wins? My concern is that the ordering of the dependencies matter here, and rules_py will need to ensure the same dependency ordering as pip, which may not be possible.

In this case, both those libraries should not be shipping test cases into the distribution package.

@alexeagle
Copy link
Member

Discussed with Matt that this injected __init__.py that rules_python puts in namespaced-packages
https://github.com/bazelbuild/rules_python/blob/03854a20c39e9e9bfebe91802102715cb027220a/python/private/pypi/whl_installer/namespace_pkgs.py#L95-L96
is a particularly gross violation triggering this error.

Will probably just allow these conflicting symlinks and print a warning, then add a flag letting you suppress that warning.

@hofbi
Copy link
Contributor

hofbi commented Jul 17, 2024

I get a similar error

Error:   × Unable to run command:
  ├─▶ Conflicting symlinks found when attempting to create venv. More than one
  │   package provides the file at these paths
  ├─▶ rules_python~~pip~rules_ros_pip_deps_38_pyyaml/site-packages/yaml/
  │   loader.py
  ╰─▶ site-packages/yaml/loader.py

Allowing these conflicts and printing a warning seems like a reasonable approach.

@antspy
Copy link
Contributor

antspy commented Dec 14, 2024

Is the intended solution here to use package_collisions='ignore' any time this happens? Or should we wait for a long term fix?

(I am hitting this when installing pandera[polars] and polars).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants