Skip to content

Commit

Permalink
ignore_root_user_error should be taken from root module only
Browse files Browse the repository at this point in the history
  • Loading branch information
shabanzd committed Jan 4, 2024
1 parent 619fa0c commit a73c85f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/private/bzlmod/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,15 @@ def _print_warn(msg):
def _python_register_toolchains(name, toolchain_attr, module):
"""Calls python_register_toolchains and returns a struct used to collect the toolchains.
"""
# Only the root module should have a say on whether or not to ignore the root user
# error. This can be achieved by taking the ignore_root_user_error for the root
# module. For all other modules, the ignore_root_user_error attr is set to True.
ignore_root_user_error = not (module.is_root and toolchain_attr.ignore_root_user_error)
python_register_toolchains(
name = name,
python_version = toolchain_attr.python_version,
register_coverage_tool = toolchain_attr.configure_coverage_tool,
ignore_root_user_error = toolchain_attr.ignore_root_user_error,
ignore_root_user_error = ignore_root_user_error,
)
return struct(
python_version = toolchain_attr.python_version,
Expand Down

0 comments on commit a73c85f

Please sign in to comment.