From 952a5eea588f44fa7dc87161304e32dddfcf67c3 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Fri, 19 Dec 2025 15:18:53 -0800 Subject: [PATCH 1/4] Add local_includes to cc_library / cc_binary This new attribute solves one of the longstanding annoyances with private include paths for third party projects. Today users often hardcode `-Iexternal/something` or come up with some complicated workarounds with custom rules vending make variables or `implementation_deps` This attribute is named after, and has the same semantics, as `defines` vs `local_defines`. These paths are only used in the context of the rule that they are on. Fixes https://github.com/bazelbuild/bazel/issues/16472 --- cc/common/cc_helper.bzl | 4 +- cc/private/cc_common.bzl | 2 + cc/private/cc_info.bzl | 8 ++++ cc/private/compile/cc_compilation_helper.bzl | 2 + cc/private/compile/compile.bzl | 2 + .../compile/compile_build_variables.bzl | 7 ++- cc/private/rules_impl/attrs.bzl | 14 ++++++ cc/private/rules_impl/cc_binary.bzl | 1 + cc/private/rules_impl/cc_library.bzl | 1 + tests/local_includes/BUILD | 47 +++++++++++++++++++ tests/local_includes/binary.c | 11 +++++ tests/local_includes/binary_helper.c | 3 ++ tests/local_includes/lib/include/public.h | 1 + tests/local_includes/lib/lib.c | 5 ++ tests/local_includes/lib/private/private.c | 3 ++ tests/local_includes/lib/private/private.h | 1 + tests/local_includes/private/binary_helper.h | 1 + 17 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 tests/local_includes/BUILD create mode 100644 tests/local_includes/binary.c create mode 100644 tests/local_includes/binary_helper.c create mode 100644 tests/local_includes/lib/include/public.h create mode 100644 tests/local_includes/lib/lib.c create mode 100644 tests/local_includes/lib/private/private.c create mode 100644 tests/local_includes/lib/private/private.h create mode 100644 tests/local_includes/private/binary_helper.h diff --git a/cc/common/cc_helper.bzl b/cc/common/cc_helper.bzl index 4720a600b..836ea7529 100644 --- a/cc/common/cc_helper.bzl +++ b/cc/common/cc_helper.bzl @@ -811,13 +811,13 @@ def _get_cc_flags_make_variable(_ctx, feature_configuration, cc_toolchain): def _package_exec_path(ctx, package, sibling_repository_layout): return get_relative_path(_repository_exec_path(ctx.label.workspace_name, sibling_repository_layout), package) -def _include_dirs(ctx, additional_make_variable_substitutions): +def _include_dirs(ctx, additional_make_variable_substitutions, attr = "includes"): result = [] sibling_repository_layout = ctx.configuration.is_sibling_repository_layout() package = ctx.label.package package_exec_path = _package_exec_path(ctx, package, sibling_repository_layout) package_source_root = _package_source_root(ctx.label.workspace_name, package, sibling_repository_layout) - for include in ctx.attr.includes: + for include in getattr(ctx.attr, attr): includes_attr = _expand(ctx, include, additional_make_variable_substitutions) if is_path_absolute(includes_attr): continue diff --git a/cc/private/cc_common.bzl b/cc/private/cc_common.bzl index 69d6db111..bd12f3227 100644 --- a/cc/private/cc_common.bzl +++ b/cc/private/cc_common.bzl @@ -460,6 +460,7 @@ def _compile( textual_hdrs = [], additional_exported_hdrs = _UNBOUND, # TODO(ilist@): remove, there are no uses includes = [], + local_includes = [], quote_includes = [], system_includes = [], framework_includes = [], @@ -545,6 +546,7 @@ def _compile( textual_hdrs = textual_hdrs, additional_exported_hdrs = additional_exported_hdrs, includes = includes, + local_includes = local_includes, quote_includes = quote_includes, system_includes = system_includes, framework_includes = framework_includes, diff --git a/cc/private/cc_info.bzl b/cc/private/cc_info.bzl index 8c4bdf285..964ef2fed 100644 --- a/cc/private/cc_info.bzl +++ b/cc/private/cc_info.bzl @@ -26,6 +26,9 @@ CcCompilationContextInfo = provider( # CommandLineCcCompilationContext fields: "includes": "Returns the set of search paths (as strings) for header files referenced " + "both by angle bracket and quotes. Usually passed with -I.", + "local_includes": "Returns the set of search paths (as strings) for header files referenced " + + "both by angle bracket and quotes. Usually passed with -I. These values " + + "are not propagated to the target's transitive dependents.", "quote_includes": "Returns the set of search paths (as strings) for header files " + "referenced by quotes, e.g. #include \"foo/bar/header.h\". They can be " + "either relative to the exec root or absolute. Usually passed with -iquote.", @@ -113,6 +116,7 @@ EMPTY_COMPILATION_CONTEXT = CcCompilationContextInfo( direct_private_headers = [], direct_textual_headers = [], includes = depset(), + local_includes = depset(), quote_includes = depset(), system_includes = depset(), framework_includes = depset(), @@ -275,6 +279,7 @@ def create_compilation_context( *, headers = None, includes = None, + local_includes = None, quote_includes = None, system_includes = None, framework_includes = None, @@ -301,6 +306,7 @@ def create_compilation_context( Args: headers: A depset of headers to compile. includes: A depset of include directories. + local_includes: A depset of local include directories. quote_includes: A depset of quoted include directories. system_includes: A depset of system include directories. framework_includes: A depset of framework include directories. @@ -360,6 +366,7 @@ def create_compilation_context( direct_private_headers = header_info.modular_private_headers, direct_textual_headers = header_info.textual_headers, includes = includes, + local_includes = local_includes, quote_includes = quote_includes, system_includes = system_includes, framework_includes = framework_includes, @@ -465,6 +472,7 @@ def _merge_compilation_contexts(*, compilation_context = EMPTY_COMPILATION_CONTE transitive = [dep.defines for dep in all_deps] + [compilation_context.defines], ), local_defines = compilation_context.local_defines, + local_includes = compilation_context.local_includes, headers = depset( direct = compilation_context.headers.to_list(), transitive = [dep.headers for dep in all_deps], diff --git a/cc/private/compile/cc_compilation_helper.bzl b/cc/private/compile/cc_compilation_helper.bzl index a16d4c0c9..b544bb77d 100644 --- a/cc/private/compile/cc_compilation_helper.bzl +++ b/cc/private/compile/cc_compilation_helper.bzl @@ -371,6 +371,7 @@ def _init_cc_compilation_context( framework_include_dirs, system_include_dirs, include_dirs, + local_includes, feature_configuration, public_headers_artifacts, include_prefix, @@ -596,6 +597,7 @@ def _init_cc_compilation_context( external_includes = depset(external_include_dirs), system_includes = depset(system_include_dirs_for_context), includes = depset(include_dirs_for_context), + local_includes = depset(local_includes), virtual_to_original_headers = depset(virtual_to_original_headers), dependent_cc_compilation_contexts = dependent_cc_compilation_contexts, non_code_inputs = additional_inputs, diff --git a/cc/private/compile/compile.bzl b/cc/private/compile/compile.bzl index 278036c52..1bc0cbebc 100644 --- a/cc/private/compile/compile.bzl +++ b/cc/private/compile/compile.bzl @@ -102,6 +102,7 @@ def compile( textual_hdrs = [], additional_exported_hdrs = [], includes = [], + local_includes = [], # TODO(b/396122076): seems unused; double-check and remove loose_includes = None, # buildifier: disable=unused-variable quote_includes = [], @@ -291,6 +292,7 @@ def compile( framework_include_dirs = framework_includes, system_include_dirs = system_includes, include_dirs = includes, + local_includes = local_includes, feature_configuration = feature_configuration, public_headers_artifacts = public_hdrs_artifacts, include_prefix = include_prefix, diff --git a/cc/private/compile/compile_build_variables.bzl b/cc/private/compile/compile_build_variables.bzl index 80f0d91fc..8597219a0 100644 --- a/cc/private/compile/compile_build_variables.bzl +++ b/cc/private/compile/compile_build_variables.bzl @@ -92,6 +92,7 @@ def create_compile_variables( output_file = None, user_compile_flags = None, includes = None, + local_includes = None, include_directories = None, quote_include_directories = None, system_include_directories = None, @@ -122,6 +123,7 @@ def create_compile_variables( includes: paths to headers that should be included using -include user_compile_flags: List of additional compilation flags (copts). include_directories: Depset of include directories. + local_includes: Depset of local include directories. quote_include_directories: Depset of quote include directories. system_include_directories: Depset of system include directories. framework_include_directories: Depset of framework include directories. @@ -157,6 +159,7 @@ def create_compile_variables( fdo_build_stamp = _get_fdo_build_stamp(cpp_configuration, fdo_context, feature_configuration), variables_extension = variables_extension, includes = includes or [], + local_includes = local_includes or depset(), include_dirs = include_directories or depset(), quote_include_dirs = quote_include_directories or depset(), system_include_dirs = system_include_directories or depset(), @@ -197,6 +200,7 @@ def setup_common_compile_build_variables( fdo_build_stamp = _get_fdo_build_stamp(cpp_configuration, fdo_context, feature_configuration), variables_extension = variables_extension, include_dirs = cc_compilation_context.includes, + local_includes = cc_compilation_context.local_includes, quote_include_dirs = cc_compilation_context.quote_includes, system_include_dirs = cc_compilation_context.system_includes, framework_include_dirs = cc_compilation_context.framework_includes, @@ -215,6 +219,7 @@ def _setup_common_compile_build_variables_internal( variables_extension = [], # [dict{str,object}] additional_build_variables = {}, # dict{str,str} include_dirs = depset(), + local_includes = depset(), quote_include_dirs = depset(), system_include_dirs = depset(), framework_include_dirs = depset(), @@ -225,7 +230,7 @@ def _setup_common_compile_build_variables_internal( if feature_configuration.is_enabled("use_header_modules"): result[_VARS.MODULE_FILES] = [] - result[_VARS.INCLUDE_PATHS] = include_dirs + result[_VARS.INCLUDE_PATHS] = depset(transitive = [include_dirs, local_includes]) result[_VARS.QUOTE_INCLUDE_PATHS] = quote_include_dirs result[_VARS.SYSTEM_INCLUDE_PATHS] = system_include_dirs if includes: diff --git a/cc/private/rules_impl/attrs.bzl b/cc/private/rules_impl/attrs.bzl index c703bcdb8..0c0ba2e84 100644 --- a/cc/private/rules_impl/attrs.bzl +++ b/cc/private/rules_impl/attrs.bzl @@ -144,6 +144,20 @@ very careful, since this may have far-reaching effects. When in doubt, add The added include paths will include generated files as well as files in the source tree.

+"""), + "local_includes": attr.string_list(doc = """ +List of include dirs to be added to the compile line. +Subject to "Make variable" substitution. +Each string is prepended with the package path and passed to the C++ toolchain for +expansion via the "include_paths" CROSSTOOL feature. A toolchain running on a +POSIX system with typical feature definitions will produce +-I path_to_package/include_entry. + +Unlike INCLUDES, these flags are added for +this target and not added to every target that depends on it. + +The added include paths will include generated files as well as +files in the source tree. """), "defines": attr.string_list(doc = """ List of defines to add to the compile line of this and all dependent targets. diff --git a/cc/private/rules_impl/cc_binary.bzl b/cc/private/rules_impl/cc_binary.bzl index b6c3f8655..e149c07a7 100644 --- a/cc/private/rules_impl/cc_binary.bzl +++ b/cc/private/rules_impl/cc_binary.bzl @@ -540,6 +540,7 @@ def cc_binary_impl(ctx, additional_linkopts, force_linkstatic = False): defines = cc_helper.defines(ctx, additional_make_variable_substitutions), local_defines = cc_helper.local_defines(ctx, additional_make_variable_substitutions) + cc_helper.get_local_defines_for_runfiles_lookup(ctx, ctx.attr.deps), includes = cc_helper.include_dirs(ctx, additional_make_variable_substitutions), + local_includes = cc_helper.include_dirs(ctx, additional_make_variable_substitutions, attr = "local_includes"), private_hdrs = cc_helper.get_private_hdrs(ctx), public_hdrs = cc_helper.get_public_hdrs(ctx), copts_filter = cc_helper.copts_filter(ctx, additional_make_variable_substitutions), diff --git a/cc/private/rules_impl/cc_library.bzl b/cc/private/rules_impl/cc_library.bzl index a66995944..2f849bff8 100755 --- a/cc/private/rules_impl/cc_library.bzl +++ b/cc/private/rules_impl/cc_library.bzl @@ -64,6 +64,7 @@ def _cc_library_impl(ctx): defines = cc_helper.defines(ctx, additional_make_variable_substitutions), local_defines = cc_helper.local_defines(ctx, additional_make_variable_substitutions) + cc_helper.get_local_defines_for_runfiles_lookup(ctx, ctx.attr.deps + ctx.attr.implementation_deps), includes = cc_helper.include_dirs(ctx, additional_make_variable_substitutions), + local_includes = cc_helper.include_dirs(ctx, additional_make_variable_substitutions, attr = "local_includes"), copts_filter = cc_helper.copts_filter(ctx, additional_make_variable_substitutions), purpose = "cc_library-compile", srcs = cc_helper.get_srcs(ctx), diff --git a/tests/local_includes/BUILD b/tests/local_includes/BUILD new file mode 100644 index 000000000..90f7db33b --- /dev/null +++ b/tests/local_includes/BUILD @@ -0,0 +1,47 @@ +# Copyright 2025 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("//cc:cc_binary.bzl", "cc_binary") +load("//cc:cc_library.bzl", "cc_library") + +licenses(["notice"]) + +cc_library( + name = "lib", + srcs = [ + "lib/lib.c", + "lib/private/private.c", + "lib/private/private.h", + ], + hdrs = ["lib/include/public.h"], + includes = [ + "lib/include", + ], + local_includes = [ + "lib/private", + ], +) + +cc_binary( + name = "bin", + srcs = [ + "binary.c", + "binary_helper.c", + "private/binary_helper.h", + ], + local_includes = [ + "private", + ], + deps = [":lib"], +) diff --git a/tests/local_includes/binary.c b/tests/local_includes/binary.c new file mode 100644 index 000000000..a78687b69 --- /dev/null +++ b/tests/local_includes/binary.c @@ -0,0 +1,11 @@ +#include "binary_helper.h" +#include "public.h" + +#if __has_include("private.h") +#error "private.h should not be on the include path" +#endif + + +int main() { + return foo() + helper(); +} diff --git a/tests/local_includes/binary_helper.c b/tests/local_includes/binary_helper.c new file mode 100644 index 000000000..97f18b589 --- /dev/null +++ b/tests/local_includes/binary_helper.c @@ -0,0 +1,3 @@ +int helper() { + return 42; +} diff --git a/tests/local_includes/lib/include/public.h b/tests/local_includes/lib/include/public.h new file mode 100644 index 000000000..5d5f8f0c9 --- /dev/null +++ b/tests/local_includes/lib/include/public.h @@ -0,0 +1 @@ +int foo(); diff --git a/tests/local_includes/lib/lib.c b/tests/local_includes/lib/lib.c new file mode 100644 index 000000000..602f9fffc --- /dev/null +++ b/tests/local_includes/lib/lib.c @@ -0,0 +1,5 @@ +#include "private.h" + +int foo() { + return bar(); +} diff --git a/tests/local_includes/lib/private/private.c b/tests/local_includes/lib/private/private.c new file mode 100644 index 000000000..a4957daad --- /dev/null +++ b/tests/local_includes/lib/private/private.c @@ -0,0 +1,3 @@ +int bar() { + return 0; +} diff --git a/tests/local_includes/lib/private/private.h b/tests/local_includes/lib/private/private.h new file mode 100644 index 000000000..c362dd03f --- /dev/null +++ b/tests/local_includes/lib/private/private.h @@ -0,0 +1 @@ +int bar(); diff --git a/tests/local_includes/private/binary_helper.h b/tests/local_includes/private/binary_helper.h new file mode 100644 index 000000000..7b89ca581 --- /dev/null +++ b/tests/local_includes/private/binary_helper.h @@ -0,0 +1 @@ +int helper(); From 44d2a27e822af7948d435a49028829cea2544997 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 21 Jan 2026 17:17:31 -0800 Subject: [PATCH 2/4] update ci --- .bazelci/presubmit.yml | 56 +++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 22 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 568d7c3f7..a4f77f9a6 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -13,6 +13,22 @@ test_targets: &test_targets - "-//tests/system_library:system_library_test" # Only intended to work in WORKSPACE files - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. +build_targets_bazel_7_8: &build_targets_bazel_7_8 + - "//:all" + - "//cc/..." + - "//examples/..." + - "//tests/..." + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + - "-//tests/local_includes/..." # Requires bazel 9.x+ +test_targets_bazel_7_8: &test_targets_bazel_7_8 + - "//:all" + - "//cc/..." + - "//examples/..." + - "//tests/..." + - "-//tests/system_library:system_library_test" # Only intended to work in WORKSPACE files + - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + - "-//tests/local_includes/..." # Requires bazel 9.x+ + build_targets_bazel_6: &build_targets_bazel_6 - "//:all" - "//cc:all" @@ -21,6 +37,7 @@ build_targets_bazel_6: &build_targets_bazel_6 - "-//tests/rule_based_toolchain/..." # proto.encode_text doesn't support None - "-//cc:optional_current_cc_toolchain" # Not supported in Bazel 6 - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + - "-//tests/local_includes/..." # Requires bazel 9.x+ test_targets_bazel_6: &test_targets_bazel_6 - "//:all" - "//cc:all" @@ -30,6 +47,7 @@ test_targets_bazel_6: &test_targets_bazel_6 - "-//cc:optional_current_cc_toolchain" # Not supported in Bazel 6 - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - "-//tests/system_library:system_library_test" # Should be skipped on Windows and MacOS + - "-//tests/local_includes/..." # Requires bazel 9.x+ buildifier: version: latest @@ -117,64 +135,58 @@ tasks: name: Ubuntu 20.04 (Bazel 7) bazel: 7.x platform: ubuntu2004 - build_targets: *build_targets_bazel_6 - test_targets: *test_targets_bazel_6 + build_targets: *build_targets_bazel_7_8 + test_targets: *test_targets_bazel_7_8 macos_bazel_7: name: MacOS (Bazel 7) bazel: 7.x platform: macos - build_targets: *build_targets_bazel_6 - test_targets: *test_targets_bazel_6 + build_targets: *build_targets_bazel_7_8 + test_targets: *test_targets_bazel_7_8 windows_bazel_7: name: Windows (Bazel 7) bazel: 7.x platform: windows - build_targets: *build_targets_bazel_6 - test_targets: *test_targets_bazel_6 + build_targets: *build_targets_bazel_7_8 + test_targets: *test_targets_bazel_7_8 # Bazel 8 ubuntu2004_bazel_8: name: Ubuntu 20.04 (Bazel 8) bazel: 8.x platform: ubuntu2004 - build_targets: *build_targets_bazel_6 - test_targets: *test_targets_bazel_6 + build_targets: *build_targets_bazel_7_8 + test_targets: *test_targets_bazel_7_8 macos_bazel_8: name: MacOS (Bazel 8) bazel: 8.x platform: macos - build_targets: *build_targets_bazel_6 - test_targets: *test_targets_bazel_6 + build_targets: *build_targets_bazel_7_8 + test_targets: *test_targets_bazel_7_8 windows_bazel_8: name: Windows (Bazel 8) bazel: 8.x platform: windows - build_targets: *build_targets_bazel_6 - test_targets: *test_targets_bazel_6 + build_targets: *build_targets_bazel_7_8 + test_targets: *test_targets_bazel_7_8 # Bazel 9 ubuntu2004: name: Ubuntu 20.04 (Bazel LTS) - bazel: last_rc # TODO: change to 9.x when released + bazel: 9.x + platform: ubuntu2004 build_targets: *build_targets test_targets: *test_targets macos: name: MacOS (Bazel LTS) - bazel: last_rc # TODO: change to 9.x when released + bazel: 9.x build_targets: *build_targets test_targets: *test_targets windows: name: Windows (Bazel LTS) - bazel: last_rc # TODO: change to 9.x when released + bazel: 9.x build_targets: *build_targets test_targets: *test_targets - ubuntu_bzlmod: - name: Ubuntu 20.04 (Bazel LTS, bzlmod) - bazel: last_rc # TODO: change to 9.x when released - platform: ubuntu2004 - build_flags: - - "--enable_bzlmod" - - "--ignore_dev_dependency" ubuntu_rule_based_toolchains: name: Ubuntu rule-based toolchains From b25b0310876655125c002ac270d16b50693d0840 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 21 Jan 2026 17:27:37 -0800 Subject: [PATCH 3/4] another attempt --- .bazelci/presubmit.yml | 75 +++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index a4f77f9a6..3aa07a084 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -13,21 +13,8 @@ test_targets: &test_targets - "-//tests/system_library:system_library_test" # Only intended to work in WORKSPACE files - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. -build_targets_bazel_7_8: &build_targets_bazel_7_8 - - "//:all" - - "//cc/..." - - "//examples/..." - - "//tests/..." - - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - - "-//tests/local_includes/..." # Requires bazel 9.x+ -test_targets_bazel_7_8: &test_targets_bazel_7_8 - - "//:all" - - "//cc/..." - - "//examples/..." - - "//tests/..." - - "-//tests/system_library:system_library_test" # Only intended to work in WORKSPACE files - - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - - "-//tests/local_includes/..." # Requires bazel 9.x+ +flags_bazel_less_than_9: &flags_bazel_less_than_9 + - "--deleted_packages=//tests/local_includes" build_targets_bazel_6: &build_targets_bazel_6 - "//:all" @@ -37,7 +24,6 @@ build_targets_bazel_6: &build_targets_bazel_6 - "-//tests/rule_based_toolchain/..." # proto.encode_text doesn't support None - "-//cc:optional_current_cc_toolchain" # Not supported in Bazel 6 - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - - "-//tests/local_includes/..." # Requires bazel 9.x+ test_targets_bazel_6: &test_targets_bazel_6 - "//:all" - "//cc:all" @@ -47,7 +33,6 @@ test_targets_bazel_6: &test_targets_bazel_6 - "-//cc:optional_current_cc_toolchain" # Not supported in Bazel 6 - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. - "-//tests/system_library:system_library_test" # Should be skipped on Windows and MacOS - - "-//tests/local_includes/..." # Requires bazel 9.x+ buildifier: version: latest @@ -66,12 +51,7 @@ tasks: bazel: last_green platform: ubuntu2004 build_targets: *build_targets - test_targets: - - "//:all" - - "//cc/..." - - "//examples/..." - - "//tests/..." - - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + test_targets: *test_targets macos_head: name: MacOS (Bazel HEAD) bazel: last_green @@ -91,12 +71,7 @@ tasks: bazel: rolling platform: ubuntu2004 build_targets: *build_targets - test_targets: - - "//:all" - - "//cc/..." - - "//examples/..." - - "//tests/..." - - "-//tests/rule_based_toolchain/tool_map:_duplicate_action_test_subject" # Intentionally broken rule. + test_targets: *test_targets macos_rolling: name: MacOS (Bazel rolling) bazel: rolling @@ -117,58 +92,76 @@ tasks: platform: ubuntu2004 build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 macos_bazel_6: name: MacOS (Bazel 6) bazel: 6.3.0 platform: macos build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 windows_bazel_6: name: Windows (Bazel 6) bazel: 6.3.0 platform: windows build_targets: *build_targets_bazel_6 test_targets: *test_targets_bazel_6 + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 # Bazel 7 ubuntu2004_bazel_7: name: Ubuntu 20.04 (Bazel 7) bazel: 7.x platform: ubuntu2004 - build_targets: *build_targets_bazel_7_8 - test_targets: *test_targets_bazel_7_8 + build_targets: *build_targets + test_targets: *test_targets + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 macos_bazel_7: name: MacOS (Bazel 7) bazel: 7.x platform: macos - build_targets: *build_targets_bazel_7_8 - test_targets: *test_targets_bazel_7_8 + build_targets: *build_targets + test_targets: *test_targets + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 windows_bazel_7: name: Windows (Bazel 7) bazel: 7.x platform: windows - build_targets: *build_targets_bazel_7_8 - test_targets: *test_targets_bazel_7_8 + build_targets: *build_targets + test_targets: *test_targets + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 # Bazel 8 ubuntu2004_bazel_8: name: Ubuntu 20.04 (Bazel 8) bazel: 8.x platform: ubuntu2004 - build_targets: *build_targets_bazel_7_8 - test_targets: *test_targets_bazel_7_8 + build_targets: *build_targets + test_targets: *test_targets + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 macos_bazel_8: name: MacOS (Bazel 8) bazel: 8.x platform: macos - build_targets: *build_targets_bazel_7_8 - test_targets: *test_targets_bazel_7_8 + build_targets: *build_targets + test_targets: *test_targets + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 windows_bazel_8: name: Windows (Bazel 8) bazel: 8.x platform: windows - build_targets: *build_targets_bazel_7_8 - test_targets: *test_targets_bazel_7_8 + build_targets: *build_targets + test_targets: *test_targets + build_flags: *flags_bazel_less_than_9 + test_flags: *flags_bazel_less_than_9 # Bazel 9 ubuntu2004: From fdc700ccb8effd508180d76892bbd4ee12f891ed Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Wed, 21 Jan 2026 17:34:17 -0800 Subject: [PATCH 4/4] docs --- cc/private/compile/compile.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/private/compile/compile.bzl b/cc/private/compile/compile.bzl index 1bc0cbebc..01cb43773 100644 --- a/cc/private/compile/compile.bzl +++ b/cc/private/compile/compile.bzl @@ -152,6 +152,8 @@ def compile( additional_exported_hdrs: undocumented includes: Search paths for header files referenced both by angle bracket and quotes. Usually passed with -I. Propagated to dependents transitively. + local_includes: Search paths for header files referenced by angle brackets and quotes. + Usually passed with -I. Not propagated to dependents transitively. loose_includes: undocumented quote_includes: Search paths for header files referenced by quotes, e.g. #include \"foo/bar/header.h\". They can be either relative to the exec