Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8734929
Remove release tests, add check for green commit (#898)
keith Sep 24, 2026
327ab4a
Rename INTERNAL_VISIBILITY to PUBLIC_IF_NOT_GOOGLE (#910)
armandomontanez Sep 29, 2026
1f56261
Fix cc_shared_library locations with rules_python on windows (#909)
keith Sep 30, 2026
2251f97
Use --remote_download_all on windows (#915)
keith Sep 30, 2026
f0a3fa7
Bump apple_support dep (#903)
keith Oct 1, 2026
59bedc6
Set coverage_files from rules based toolchains (#904)
keith Oct 1, 2026
20e8db3
Use dict.items() for artifact-label pairs (#900)
dzbarsky Oct 1, 2026
2e1b4ab
Starlarkify cc_common.empty_variables (#806)
dzbarsky Oct 1, 2026
785f33a
Support checking command-line copts in disallowed copts policies
a-googler Oct 1, 2026
958e6a1
Remove -std=c++17 from bazelrc (#918)
keith Oct 2, 2026
eaafbd3
Add back grep-includes alias (#888)
keith Oct 2, 2026
8e81232
Automatic code cleanup.
nglevin Oct 5, 2026
213bf55
Use named arguments instead of comments (#906)
keith Oct 5, 2026
1dfaf0b
Add docs for skip_virtual_includes (#920)
keith Oct 6, 2026
f96573d
Add a `dwo_files` output group to cc_binary and cc_test.
trybka Oct 9, 2026
9b9b7de
Keep tool paths of generated files relative to the execution root (#901)
fmeum Oct 9, 2026
770471b
Enable some more tests on macOS (#924)
keith Oct 12, 2026
14c3913
No public description
a-googler Oct 16, 2026
d1d1a95
Check disallowed copts before allowlist membership.
a-googler Oct 19, 2026
b50a797
Fix label resolution for external repos (#896)
fmeum Oct 20, 2026
ebd996f
Implement target allowlists in addition to package allowlists for dis…
a-googler Oct 20, 2026
f3daca7
Add --check_direct_dependencies=off to bazelrc (#917)
keith Oct 20, 2026
bf7ebfe
Apply cxx_flags to Windows module actions (#912)
PikachuHyA Oct 20, 2026
f6a743e
Update $(location to execpath (#891)
keith Oct 21, 2026
4d19de1
Fix cpp_modules + features=parse_headers/c=opt (#876)
rdong8 Oct 22, 2026
1197612
Exclude cpp_module_codegen from source_compile_actions (#897)
fmeum Oct 22, 2026
1bcbf51
Stop using deprecated aliases for rules_cc tools (#889)
keith Oct 23, 2026
9cb3e09
Add lilygorsheneva to BCR maintainers list (#956)
armandomontanez Oct 23, 2026
5323f49
Migrate C++ debug info packaging tests from Java to Starlark.
a-googler Oct 27, 2026
24f0847
Add Bazel 10 RC testing to BazelCI:rules_cc
pzembrod Oct 27, 2026
12f2354
Reenable coverage for windows_rolling on BazelCI:rules_cc
pzembrod Oct 27, 2026
cad4670
Fix windows binaries with spaces (#923)
keith Oct 27, 2026
cb13b25
Add rule-based args for C++20 modules (#927)
AustinSchuh Oct 28, 2026
b368e9c
Add linker directory -B flag when using lld or gold (#943)
pefoley2 Oct 28, 2026
df732a0
Starlarkify _cc_internal.create_cc_compile_action_template().
pzembrod Oct 28, 2026
d310c2a
Preserve LLVM coverage runtime object paths (#905)
gztong666 Oct 28, 2026
2ec2e09
Let integration tests reuse the pkg directory of earlier tests (#953)
chrisburr Oct 28, 2026
d16594b
Use the DLL's file name in the DEF file generated by cc_shared_librar…
fmeum Oct 28, 2026
2216264
Name MinGW DLLs `lib<name>.dll` (#951)
fmeum Oct 28, 2026
28acac0
Fallback to finding clang-scan-deps on PATH (#887)
keith Oct 28, 2026
45a967f
Avoid unnecessary versioned library checks in cc_helper (#871)
dzbarsky Oct 29, 2026
880db0a
Automated rollback of commit df732a095ddb6d552fcb8165468557922b08b8b3.
a-googler Oct 29, 2026
1448f8b
Add analysis tests for cc_shared_library DEF file DLL name generation.
pzembrod Oct 29, 2026
599653f
Avoid redundant `linker_inputs` depset flattening during `cc_binary` …
meisterT Oct 29, 2026
0726c5d
Fix cc_static_library opt mode duplicate archive symbols (#930)
jke-jumptrading Oct 29, 2026
bfb9321
No public description
zrlk Oct 30, 2026
2695f06
Automated rollback of commit 599653fd53e54daa13d800745bcb7fc8851a41b8.
a-googler Oct 30, 2026
ef8ed36
Minor fixes for documentation x-refs (#938)
sin-ack Oct 30, 2026
fc6b090
Validate extra link-time callbacks with Starlark Args (#827)
dzbarsky Nov 1, 2026
f042218
Use --ld-path= for the autoconfigured Clang linker (#935)
MaskRay Nov 2, 2026
c7c3941
Return the Unix linker path and compiler flags (#971)
tamird Nov 3, 2026
f3c5882
Don't resolve cc_configure template labels to paths (#944)
fmeum Nov 3, 2026
818408b
Describe C++ toolchain helpers and providers
tamird Oct 29, 2026
cb69150
Check and distribute rules_cc type contracts
tamird Oct 29, 2026
8dadf5c
Keep toolchain contracts beside their source
tamird Nov 3, 2026
8eec445
Move tool and repository types into source
tamird Nov 3, 2026
d3c9dc8
Document the type source for forwarded keywords
tamird Nov 3, 2026
99a0753
Explain the source annotation limits
tamird Nov 3, 2026
826ec97
Reference sty by release tag
tamird Nov 3, 2026
4f9860e
Select the strict sty rules as a group
tamird Nov 3, 2026
bbec9df
Check rules_cc against released Skylib
tamird Nov 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 47 additions & 7 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ tasks:
build_targets: *build_targets
test_targets: *test_targets
test_flags: *windows_test_flags
# TODO(pzembrod): reenable once Commit #53428ca hits Bazel ROLLING - should be within 08/2026
# coverage_flags: *windows_coverage_flags
# coverage_targets: *coverage_targets
coverage_flags: *windows_coverage_flags
coverage_targets: *coverage_targets

# Bazel 7
ubuntu_bazel_7:
Expand Down Expand Up @@ -230,15 +229,15 @@ tasks:
coverage_targets: *test_targets_bazel_less_than_9

# Bazel 9
ubuntu:
ubuntu_bazel_9:
name: Ubuntu (Bazel 9)
bazel: 9.x
platform: ubuntu2404
build_targets: *build_targets
test_targets: *test_targets
coverage_flags: *common_coverage_flags
coverage_targets: *coverage_targets
macos_intel:
macos_intel_bazel_9:
name: MacOS Intel (Bazel 9)
bazel: 9.x
platform: macos
Expand All @@ -247,7 +246,7 @@ tasks:
test_flags: *macos_test_flags
coverage_flags: *common_coverage_flags
coverage_targets: *coverage_targets
macos:
macos_bazel_9:
name: MacOS (Bazel 9)
bazel: 9.x
platform: macos_arm64
Expand All @@ -256,9 +255,50 @@ tasks:
test_flags: *macos_test_flags
coverage_flags: *common_coverage_flags
coverage_targets: *coverage_targets
windows:
windows_bazel_9:
name: Windows (Bazel 9)
bazel: 9.x
platform: windows
build_targets: *build_targets
test_targets: *test_targets
test_flags: *windows_test_flags
coverage_flags: *windows_coverage_flags
coverage_targets: *test_targets

# Bazel 10
ubuntu_bazel_10:
name: Ubuntu (Bazel 10)
bazel: 10.* # TODO(pzembrod): Change to 10.x after 10.0.0 is released. Same for other jobs.
platform: ubuntu2404
build_targets: *build_targets
test_targets: *test_targets
coverage_flags: *common_coverage_flags
coverage_targets: *coverage_targets
macos_intel_bazel_10:
name: MacOS Intel (Bazel 10)
bazel: 10.*
platform: macos
environment:
ANDROID_HOME: ""
ANDROID_NDK_HOME: ""
build_targets: *build_targets
test_targets: *test_targets
test_flags: *macos_test_flags
coverage_flags: *common_coverage_flags
coverage_targets: *coverage_targets
macos_bazel_10:
name: MacOS (Bazel 10)
bazel: 10.*
platform: macos_arm64
build_targets: *build_targets
test_targets: *test_targets
test_flags: *macos_test_flags
coverage_flags: *common_coverage_flags
coverage_targets: *coverage_targets
windows_bazel_10:
name: Windows (Bazel 10)
bazel: 10.*
platform: windows
build_targets: *build_targets
test_targets: *test_targets
test_flags: *windows_test_flags
Expand Down
8 changes: 6 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Required by googletest 1.17.
common --cxxopt=-std=c++17
common --enable_platform_specific_config
# TODO: Remove https://github.com/bazelbuild/bazel/pull/31423
common:windows --remote_download_all

common --check_direct_dependencies=off

test --test_env=PATH=/bin:/usr/bin:/usr/local/bin
5 changes: 5 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"email": "pzembrod@google.com",
"github": "pzembrod",
"name": "Philip Zembrod"
},
{
"email": "bgorshenev@google.com",
"github": "lilygorsheneva",
"name": "Lily Gorsheneva"
}
],
"versions": [],
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,29 @@ permissions:
attestations: write
contents: write
jobs:
check-commit-status:
name: Check commit status
runs-on: ubuntu-latest
permissions:
statuses: read
steps:
- name: Require a green commit
env:
GH_TOKEN: ${{ github.token }}
run: |
status="$(gh api \
--header "X-GitHub-Api-Version: 2022-11-28" \
"repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/status" \
--jq '.state')"
if [[ "${status}" != "success" ]]; then
echo "::error::Commit ${GITHUB_SHA} is not green (combined status: ${status})."
exit 1
fi
release:
needs: check-commit-status
uses: bazel-contrib/.github/.github/workflows/release_ruleset.yaml@v7.2.3
with:
bazel_test_command: "true"
prerelease: false
release_files: rules_cc-*.tar.gz
tag_name: ${{ inputs.tag_name || github.ref_name }}
Expand Down
108 changes: 108 additions & 0 deletions .github/workflows/sty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Starlark types

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
sty:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: tamird/sty@95e2b424a7f52fa0b0946da98eb2cc328e9b4107
with:
audit-loads: true
bazel-version: '9.3.0'
advisory-pathspecs: '*.bzl'
advisory-bazel-load-context: '@cross_repo_test//toolchain_include_dirs:toolchain_config'
advisory-require-bazel-load-context: tests/builtins_bzl/cc/cc_shared_library/test2/toolchain_include_dirs/cc_toolchain_config.bzl
files: |
@bazel_skylib//:bzl_library.bzl
@bazel_skylib//lib:paths.bzl
@bazel_skylib//rules:common_settings.bzl
@bazel_skylib//rules/directory:providers.bzl
cc/BUILD
cc/action_names.bzl
cc/cc_import.bzl
cc/cc_postmark.bzl
cc/cc_rules_extension_support.bzl
cc/cc_shared_library.bzl
cc/common/BUILD
cc/common/cc_shared_library_info.bzl
cc/common/debug_package_info.bzl
cc/common/feature_names.bzl
cc/common/objc_info.bzl
cc/extensions.bzl
cc/private/cc_shared_library_hint_info.bzl
cc/private/cc_shared_library_info.bzl
cc/private/debug_package_info.bzl
cc/private/graph_node_info.bzl
cc/private/paths.bzl
cc/private/rules_impl/failing_cc_proto_library.bzl
cc/private/rules_impl/fdo/fdo_prefetch_hints.bzl
cc/private/rules_impl/fdo/fdo_profile.bzl
cc/private/rules_impl/fdo/memprof_profile.bzl
cc/private/rules_impl/fdo/propeller_optimize.bzl
cc/private/rules_impl/native_cc_common.bzl
cc/private/rules_impl/objc_compilation_context_info.bzl
cc/private/toolchain/cc_configure.bzl
cc/private/toolchain/unix_cc_configure.bzl
cc/repositories.bzl
cc/starlark_doc_extract_helper.bzl
cc/system_library.bzl
cc/toolchains/actions.bzl
cc/toolchains/actions/BUILD
cc/toolchains/args/BUILD
cc/toolchains/args/libraries_to_link/private/library_link_args.bzl
cc/toolchains/args_list.bzl
cc/toolchains/artifacts.bzl
cc/toolchains/capabilities/BUILD
cc/toolchains/cc_toolchain.bzl
cc/toolchains/cc_toolchain_alias.bzl
cc/toolchains/cc_toolchain_config_info.bzl
cc/toolchains/directory_tool.bzl
cc/toolchains/fdo_prefetch_hints.bzl
cc/toolchains/fdo_profile.bzl
cc/toolchains/feature.bzl
cc/toolchains/feature_constraint.bzl
cc/toolchains/feature_injection.bzl
cc/toolchains/feature_set.bzl
cc/toolchains/features/BUILD
cc/toolchains/features/legacy/BUILD
cc/toolchains/impl/cc_artifact_category.bzl
cc/toolchains/impl/external_feature.bzl
cc/toolchains/impl/label_utils.bzl
cc/toolchains/impl/libc_version.bzl
cc/toolchains/impl/markdown_helpers.bzl
cc/toolchains/legacy_file_group.bzl
cc/toolchains/legacy_tool.bzl
cc/toolchains/make_variable.bzl
cc/toolchains/memprof_profile.bzl
cc/toolchains/mutually_exclusive_category.bzl
cc/toolchains/nested_args.bzl
cc/toolchains/propeller_optimize.bzl
cc/toolchains/providers.bzl
cc/toolchains/tool.bzl
cc/toolchains/tool_capability.bzl
cc/toolchains/variables/BUILD
cc/use_cc_toolchain.bzl
local_bazel.bzl
tests/cc/testutil/toolchains/additional_toolchains.bzl
tests/cc/testutil/toolchains/features.bzl
tests/load_from_macro/tags.bzl
tests/rule_based_toolchain/action_type_sets
tests/rule_based_toolchain/args/make_var_provider.bzl
tests/rule_based_toolchain/helpers.bzl
tests/rule_based_toolchain/legacy_features_as_args/goldens
tests/rule_based_toolchain/tool/execution_requirements.bzl
6 changes: 5 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ package(default_visibility = ["//visibility:public"])

licenses(["notice"])

exports_files(["LICENSE"])
exports_files([
"LICENSE",
"stubs.toml",
])

exports_files(["copy.bara.sky"])

Expand Down Expand Up @@ -51,6 +54,7 @@ filegroup(
srcs = [
"BUILD",
"MODULE.bazel",
"stubs.toml",
"//cc:srcs",
],
visibility = ["//:__subpackages__"],
Expand Down
6 changes: 2 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module(
compatibility_level = 1,
)

bazel_dep(name = "apple_support", version = "2.8.0")
bazel_dep(name = "apple_support", version = "2.9.1")
bazel_dep(name = "bazel_features", version = "1.50.0")
bazel_dep(name = "bazel_skylib", version = "1.8.0")
bazel_dep(name = "platforms", version = "0.0.10")
Expand All @@ -19,9 +19,7 @@ register_toolchains(
)

bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)

bazel_dep(name = "rules_python", version = "1.7.0")

bazel_dep(name = "rules_python", version = "2.0.0", dev_dependency = True)
bazel_dep(name = "googletest", version = "1.17.0", dev_dependency = True)
single_version_override(
module_name = "googletest",
Expand Down
3 changes: 3 additions & 0 deletions cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ filegroup(
)

exports_files([
"cc_postmark_initializers.bzli",
"cc_toolchain_config_lib.bzli",
"defs.bzl",
"action_names.bzl",
"system_library.bzl",
Expand Down Expand Up @@ -74,6 +76,7 @@ filegroup(
testonly = 1,
srcs = glob([
"**/*.bzl",
"**/*.bzli",
"**/BUILD",
]) + [
"//cc/common:srcs",
Expand Down
3 changes: 3 additions & 0 deletions cc/cc_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@

load("@cc_compatibility_proxy//:proxy.bzl", _cc_import = "cc_import")

# TODO(https://github.com/bazelbuild/bazel/issues/32343): Annotate **kwargs
# when Bazel can derive them from the wrapped cc_import rule.
def cc_import(**kwargs):
# type: (**Unpack[KeywordArgs[_cc_import]]) -> None
_cc_import(**kwargs)
11 changes: 6 additions & 5 deletions cc/cc_postmark.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@

"""PostMark is not implemented in Bazel."""

def _get_postmark_attrs():
return {}

def _postmark_initializer(**kwargs):
return kwargs
load("//cc:cc_postmark_initializers.bzl", _get_postmark_attrs = "get_postmark_attrs", _postmark_initializer = "postmark_initializer")

def _add_postmark_action(
ctx, # @unused
cc_toolchain, # @unused
binary, # @unused
output_binary_for_linking): # @unused
# type: (object, object, object, object) -> None
pass

# The public toolchain never enables PostMark. A broader bool makes the
# cc_binary branch that passes internal-only action keywords reachable.
# TODO: Use bool when the public implementation supports that action.
def _get_use_postmark(ctx): # @unused
# type: (object) -> Literal[False]
return False

postmark = struct(
Expand Down
7 changes: 7 additions & 0 deletions cc/cc_postmark_initializers.bzli
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""Contracts for the PostMark initializer compatibility layer."""

# TODO(https://github.com/bazelbuild/starlark/pull/362): Move the initializers into source when supported Bazel versions can bind
# K and V on the function. A signature comment cannot bind these type parameters.

def _get_postmark_attrs[K, V]() -> dict[K, V]: ...
def _postmark_initializer[T](**kwargs: T) -> dict[str, T]: ...
3 changes: 3 additions & 0 deletions cc/cc_shared_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@

load("@cc_compatibility_proxy//:proxy.bzl", _cc_shared_library = "cc_shared_library")

# TODO(https://github.com/bazelbuild/bazel/issues/32343): Annotate **kwargs
# when Bazel can derive them from the wrapped cc_shared_library rule.
def cc_shared_library(**kwargs):
# type: (**Unpack[KeywordArgs[_cc_shared_library]]) -> None
_cc_shared_library(**kwargs)
Loading
Loading