-
Notifications
You must be signed in to change notification settings - Fork 8
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
Using with py_test #2
Comments
Hi @chrislovecnm, thanks got giving this a try. I just added a |
Thanks for the fast response! I am importing your example into my project so that we can compare apples to apples. |
have imported your example, into my code, and I am still getting the same error. Here is my PR: cockroachdb/cockroach-operator#115 Here is my error:
I am on a Debian 10 server using bazel 3.4.1. This server does not have a The command that I am running is: bazel test //hack/... |
I broke up the python script into a library in order to see if that fixed the problem. I would rather just have one python file. |
Here is my tool chain debug as well:
|
I'm thinking that this is a bazel version issue. I just downloaded your project and executed:
And I am getting the above error as well. Also, the container rules that you are using do not work with the bazel version as well :( |
I'm on ubuntu 18.04 with bazel 3.1. Let met try it out in a debian container. One thing I did notice from your PR is that you don't have [1] bazel-hermetic-python/WORKSPACE Line 112 in e4f3987
|
So the toolchain is now registered. So that is fixed, but still getting the same error. |
I was able to repro the issue on debian 10 with bazel 3.4.1. I believe this is an issue with bazel - when doing One workaround for now is to install symlink |
In the directory that we install python in or on the system? |
On the system.
…On Wed, Jul 29, 2020, 18:05 Chris Love ***@***.***> wrote:
One workaround, for now, is to install symlink python to python3 :/
In the directory that we install python in or on the system?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASYHTTXVQTC27DIJHELWB3R6DBOZANCNFSM4PMDOTMA>
.
|
SMH. Yah there goes the hermetic build. LMAO. |
Your code itself is still run using the hermetically built python interpreter. The issue here is that bazel's wrapper script that launches the hermetically built python intepreter depends on the system's python. |
I get you, and really appreciate the help! Hermetic to me means I don’t break outside the sandbox. What is the point of this if I have to mess with the systems python. I may as well use a container. . Since you understand this a lot better than I do, how should this be fixed? I’m pinging Simone at google to see if the priority of this bug can be raised. |
So dumb question. Would this work. If we add a symbolic link inside of the ~/.cache/bazel/_bazel_clove/6daf43ef28bfabb61bbb29fb23d1665c/external/python_interpreter/bazel_install/bin directory, and then add that folder to the path, then env would find the file. You can find the base of that path with a |
So bazel test --action_env="PATH=$(bazel info output_base)/external/python_interpreter:$PATH" //hack/... sorta works, but now I am trying to figure out how to set the path more gracefully. |
Looks like there's an open PR for this already: bazelbuild/bazel#11434. I think this is part of the fix, and the second part is to pump the python toolchain information to the script.
Yeah I think that works! A more graceful way to set it would be to add the |
I have followed your instructions and your example does not seem to work with
py_test
. How do you cause the installed toolchain to be used instead of the host interpreter?The text was updated successfully, but these errors were encountered: