From 8eeba12f3abdce90080d04a1d7216f15c15dd81c Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 10 Dec 2025 17:27:55 +0100 Subject: [PATCH 1/3] Allow multiple module interfaces per `cc_library` This is now supported in Bazel (HEAD and 9.0.0) since https://github.com/bazelbuild/bazel/pull/27927. --- cc/private/compile/compile.bzl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cc/private/compile/compile.bzl b/cc/private/compile/compile.bzl index 8a6f8c6a..187a61d6 100644 --- a/cc/private/compile/compile.bzl +++ b/cc/private/compile/compile.bzl @@ -244,10 +244,7 @@ def compile( if module_interfaces and not feature_configuration.is_enabled("cpp_modules"): fail("to use C++20 Modules, the feature cpp_modules must be enabled") - if module_interfaces and len(module_interfaces) > 1: - fail("module_interfaces must be a list of files with exactly one file " + - "due to implementation limitation. see https://github.com/bazelbuild/bazel/pull/22553") - + language_normalized = "c++" if language == None else language language_normalized = language_normalized.replace("+", "p").upper() source_category = SOURCE_CATEGORY_CC if language_normalized == "CPP" else SOURCE_CATEGORY_CC_AND_OBJC From 5ab97435b88703142e579045aa2957f897ad7ce6 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 10 Dec 2025 17:32:20 +0100 Subject: [PATCH 2/3] Update compile.bzl --- cc/private/compile/compile.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/cc/private/compile/compile.bzl b/cc/private/compile/compile.bzl index 187a61d6..7c4fe3db 100644 --- a/cc/private/compile/compile.bzl +++ b/cc/private/compile/compile.bzl @@ -244,7 +244,6 @@ def compile( if module_interfaces and not feature_configuration.is_enabled("cpp_modules"): fail("to use C++20 Modules, the feature cpp_modules must be enabled") - language_normalized = "c++" if language == None else language language_normalized = language_normalized.replace("+", "p").upper() source_category = SOURCE_CATEGORY_CC if language_normalized == "CPP" else SOURCE_CATEGORY_CC_AND_OBJC From b4ec47b1096124c6ed3871615ed220ebeffcd8c7 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Wed, 10 Dec 2025 17:33:03 +0100 Subject: [PATCH 3/3] Update compile.bzl --- cc/private/compile/compile.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/cc/private/compile/compile.bzl b/cc/private/compile/compile.bzl index 7c4fe3db..d958cc90 100644 --- a/cc/private/compile/compile.bzl +++ b/cc/private/compile/compile.bzl @@ -244,6 +244,7 @@ def compile( if module_interfaces and not feature_configuration.is_enabled("cpp_modules"): fail("to use C++20 Modules, the feature cpp_modules must be enabled") + language_normalized = "c++" if language == None else language language_normalized = language_normalized.replace("+", "p").upper() source_category = SOURCE_CATEGORY_CC if language_normalized == "CPP" else SOURCE_CATEGORY_CC_AND_OBJC