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

rules_pkg fails to build when user is root #901

Open
turmanticant opened this issue Nov 17, 2024 · 0 comments
Open

rules_pkg fails to build when user is root #901

turmanticant opened this issue Nov 17, 2024 · 0 comments

Comments

@turmanticant
Copy link

Hey! It looks like rules_pkg depends on rules_python. This rule calls fail when the current user is root.

ERROR: /root/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/external/rules_pkg~/pkg/private/tar/BUILD:47:10: @@rules_pkg~//pkg/private/tar:build_tar depends on @@rules_python~~python~python_3_11_x86_64-unknown-linux-gnu//:py_exec_tools_toolchain in repository @@rules_python~~python~python_3_11_x86_64-unknown-linux-gnu which failed to fetch. no such package '@@rules_python~~python~python_3_11_x86_64-unknown-linux-gnu//': The current user is root, please run as non-root when using the hermetic Python interpreter. See https://github.com/bazelbuild/rules_python/pull/713.

My project doesn't use python, but to work around this error I add rules_python to my module file and patch out the check that fails.

Looking on the rules_python issue tracker someone mentioned that you can configure this behavior.

Would it be possible to configure this in your MODULE.bazel?

python_register_toolchains(
    name = ...,
    python_version = ...,
    ignore_root_user_error = True,
)
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

No branches or pull requests

1 participant