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

The current user is root, please run as non-root when using the hermetic Python interpreter #166

Closed
372046933 opened this issue Jan 30, 2024 · 4 comments

Comments

@372046933
Copy link

python_register_toolchains(
name = "python_3_11",
# Available versions are listed in @rules_python//python:versions.bzl.
python_version = "3.11",
)

Possible fix

ignore_root_user_error = True,
@372046933 372046933 mentioned this issue Jan 30, 2024
@cpsauer
Copy link
Contributor

cpsauer commented Jan 31, 2024

Hey @372046933, seems from the caveats about that flag in their docs (and it being undocumented for python_register_toolchains as opposed to bzlmod) that we should be careful with this one, doubly because they say it's ignored outside the root module, which this will almost never be.

Any chance I could ask you to give me a little more context? Is this in a container or CI or something where everything's running as root?

More generally, we're seeing enough problems/bugs with bazel's rules_python that we might revert back to builtin python for now. Would you be down to report the underlying issue to https://github.com/bazelbuild/rules_python, so they know what would be good to support here, or chime in on bazelbuild/rules_python#1169 if that seems better? And then, as a workaround, please make sure that all works fine with 6d58fa6, the commit before we switched to rules_python? (While using that one as a workaround, go ahead and delete all our transitive workspace setup calls from your WORKSPACE.)

@372046933
Copy link
Author

@cpsauer I was in a container where everything is running as root. All works fine before rules_python.
ignore_root_user_error was used in TF
https://github.com/tensorflow/tensorflow/blob/63024e99dd0d8d40bb679678c2d7c8a611722a96/WORKSPACE#L36-L40

@cpsauer
Copy link
Contributor

cpsauer commented Feb 1, 2024

Yeah, no I get it--and really appreciate your writing in to write in to report with a proposed fix no less. That said, I think the move here is for us to roll back the move to rules_python. We're just seeing a lot of brokenness there, this included, and there are some strong caveats there (like that we can't fix this with bzlmod)

@cpsauer
Copy link
Contributor

cpsauer commented Feb 1, 2024

Reverted rules_python in 0b821b7. Tracking restoration in #168.

That avoids this for now, but seriously, worth chiming in on bazelbuild/rules_python#1169 so they fix it for future use.
(Just holler if you want me to reopen.)

Thanks again for helping leave things better than you found them!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants