-
Notifications
You must be signed in to change notification settings - Fork 542
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
pypi libraries installed to system python are implicitly available to builds #27
Comments
It is a consequence of us trying to make it easy for people to use Bazel on their system. Specifying --experimental_use_strict_env should do the trick. |
Hmm, after watching this last night, I'm not so sure it is that simple (unless you guys reimplemented virtualenv?). |
@damienmg Can you move this to the main repo or assign this to the appropriate Bazel owner? |
@damienmg
Is it a new flag? I also don't see it in the source though? https://github.com/bazelbuild/bazel/search?utf8=%E2%9C%93&q=experimental_use_strict_env&type= (unless there's a different repo where flags get defined?) |
I believe he may have meant "--experimental_strict_action_env" rather than "--experimental_use_strict_env"? It is listed in the CLI reference. |
With 0.7.0,
|
My recollection is that PEX removes I suspect subpar could probably include a similar mechanism which would probably resolve this. |
As a longer-term fix, these rules could start creating |
Would it be any easier to check at build-time for any undeclared dependencies, instead of modifying the artifact to not have access to them at run-time? I think pants does the latter via the |
@duggelz @AlecBenzer it looks like this is possible using Python toolchains, see https://gist.github.com/NathanHowell/5cf4a353a8dd3a1025e682c4707d5bac for an example |
@duggelz <https://github.com/duggelz> @AlecBenzer
<https://github.com/AlecBenzer> it looks like this is possible using
Python toolchains, see
https://gist.github.com/NathanHowell/5cf4a353a8dd3a1025e682c4707d5bac for
an example
This is pretty awesome, I've been using externally-managed venvs for a long
time. Do you plan to package it as set of rules?
…--
Paweł Stradomski
|
@pstradomski yeah I can do that, I have a couple other things I want to add to the poetry rules too so maybe I'll drop it in that repo later this week |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
Don't close. This is still a problem when using the non-hermetic default Python toolchain. When toolchain support is better supported here was can document the problem with the default toolchain, direct users at a sane way create a hermetic toolchain, and then close this issue. |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
It is possible to avoid loading site-packages using |
What is the status on this issue? |
This is very stale. Closing. |
It looks like any libraries installed to my system python's site-packages are available to bazel, whether or not they are expressed as a dependency to bazel.
This seems like an issue from a reproducible build standpoint. I.e.: it'd be easy to forget to include an external library in bazel, and create implicit dependencies for others using your BUILD files or for any par files or similar archives you build.
The text was updated successfully, but these errors were encountered: