From a73c85f5378218ff0604d63bf10062406bcc9087 Mon Sep 17 00:00:00 2001 From: Ziad Shaban Date: Tue, 2 Jan 2024 18:56:12 +0200 Subject: [PATCH] ignore_root_user_error should be taken from root module only --- python/private/bzlmod/python.bzl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/private/bzlmod/python.bzl b/python/private/bzlmod/python.bzl index 3b59d5be92..1715458888 100644 --- a/python/private/bzlmod/python.bzl +++ b/python/private/bzlmod/python.bzl @@ -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,