ali5h / rules_pip

pip package rules for bazel that are fast (incremental fetch), support different python versions and work with all kinds of packages (i.e. packages with namespaces)
MIT License
60 stars 24 forks source link

Please document example of namespace handling #35

Closed chickenandpork closed 4 years ago

chickenandpork commented 4 years ago

Hey @ali5h, I've got an instance of the google. and azure. namespace clash issue (bazelbuild/rules_python#93 bazelbuild/rules_python#55). You've indicated that you fixed it, but the problem still persists in v2.1.1, can you give an idea of what that fix looks like?

https://github.com/bazelbuild/rules_python/issues/93#issuecomment-533837325

i fixed this issue in https://github.com/ali5h/rules_pip

as well https://github.com/bazelbuild/rules_python/issues/93#issuecomment-565391286

fixed the issues, plz use latest release, thanks for the feedback

I'm using your latest release, and I'm still seeing the issue. Maybe there's additional text I've missed describing what else to do to activate this repair.

If you see https://github.com/chickenandpork/bazel-pip-import-namespace, it represents the issue I'm having. Note that transitory dependencies were tried as well, then commented back out in the BUILD file.

bazel test //... repro the error.

I believe this follows the instructions you've shared. Can you see what else is missing to work around the issue ?

ali5h commented 4 years ago

i will check, but in the meanwhile look in examples

ali5h commented 4 years ago

it passes for me, on mac, python 3.8

ali5h commented 4 years ago

also tested on linux

chickenandpork commented 4 years ago

I appreciate your quick reply.

Can you confirm it is not leveraging your locally-installed packages?

I found the issue is avoided and the build passes if either package is locally-installed on my build system and available on PYTHONPATH (ie not brought in hermetically by Bazel). Locally-installed non-hermetic packages are not the intention though.

ali5h commented 4 years ago

they are not

ali5h commented 4 years ago

it would be great if you can add Dockerfile to reproduce this

chickenandpork commented 4 years ago

Looks like I'm wrong; Sorry.

Your very specific request (thanks) helped me find a possible solution (build host taint trashing the first resolution of the google.* namespace, and failing, so no others checked.

Bazel builds should be hermetic !

For the next person who has this issue (and for when I forget :-/ ) I'm documenting the path to the solution at https://github.com/chickenandpork/bazel-pip-import-namespace#recommendation