Skip to content

Commit dbf2b24

Browse files
authored
Bump rules_cc with explicit loads for Bazel 9 (#47716)
### What does this PR do? Bump `rules_cc` from 0.2.8 to 0.2.17 (latest BCR release) and replace implicit global `cc_*` rule usage in our `BUILD.bazel` files with explicit loads from `@rules_cc//cc:defs.bzl`. ### Motivation Bazel has long deprecated injecting `cc_library`, `cc_shared_library`, `cc_binary`, `cc_import` and `cc_test` as built-in globals. Making the `load`s explicit is the correct practice regardless of Bazel version, and is a **prerequisite for the upcoming Bazel 9 bump** where those globals are removed entirely. Co-authored-by: regis.desgroppes <regis.desgroppes@datadoghq.com>
1 parent 9323ce8 commit dbf2b24

27 files changed

Lines changed: 39 additions & 37 deletions

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ use_repo(linux_headers_ext, "linux_headers")
162162
## Compilers and toolchains ##
163163
####################################
164164

165-
bazel_dep(name = "rules_cc", version = "0.2.8")
165+
bazel_dep(name = "rules_cc", version = "0.2.17")
166166
bazel_dep(name = "rules_flex", version = "0.4")
167167
bazel_dep(name = "rules_m4", version = "0.3")
168168
bazel_dep(name = "gawk", version = "5.3.2.bcr.3")

MODULE.bazel.lock

Lines changed: 13 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/bzip2/overlay.BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"""Agent specific BUILD file for bzip2."""
22

33
load("@@//bazel/rules:so_symlink.bzl", "so_symlink")
4-
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
5-
load("@rules_cc//cc:cc_library.bzl", "cc_library")
6-
load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library")
4+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_shared_library")
75
load("@rules_license//rules:license.bzl", "license")
86
load("@rules_pkg//pkg:install.bzl", "pkg_install")
97
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files")

deps/cpython.BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@//deps/openssl:version.bzl", "OPENSSL_VERSION")
44
load("@bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
55
load("@bazel_lib//lib:run_binary.bzl", "run_binary")
66
load("@bazel_skylib//rules:select_file.bzl", "select_file")
7+
load("@rules_cc//cc:defs.bzl", "cc_import", "cc_library")
78
load("@rules_foreign_cc//foreign_cc:defs.bzl", "configure_make")
89
load("@rules_pkg//pkg:install.bzl", "pkg_install")
910
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files", "pkg_mklink")

deps/curl/overlay/overlay.BUILD.bazel

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
load("@@//bazel/rules:so_symlink.bzl", "so_symlink")
44
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
5-
load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
6-
load("@rules_cc//cc:cc_library.bzl", "cc_library")
7-
load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library")
5+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_shared_library")
86
load("@rules_license//rules:license.bzl", "license")
97
load("@rules_pkg//pkg:install.bzl", "pkg_install")
108
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_filegroup", "pkg_files")

deps/dbus/dbus.BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
22
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
3-
load("@rules_cc//cc:cc_library.bzl", "cc_library")
3+
load("@rules_cc//cc:defs.bzl", "cc_library")
44
load("@rules_license//rules:license.bzl", "license")
55
load("@rules_pkg//pkg:install.bzl", "pkg_install")
66
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files")

deps/gcrypt/gcrypt.BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load("@@//compliance/rules:ship_source_offer.bzl", "ship_source_offer")
44
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
55
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
66
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
7+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_shared_library")
78
load("@rules_license//rules:license.bzl", "license")
89
load("@rules_pkg//pkg:install.bzl", "pkg_install")
910
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files")

deps/gpg-error/gpg-error.BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ load("@@//compliance/rules:purl.bzl", "purl_for_generic")
44
load("@@//compliance/rules:ship_source_offer.bzl", "ship_source_offer")
55
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
66
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
7-
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_shared_library")
7+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_shared_library")
88
load("@rules_license//rules:license.bzl", "license")
99
load("@rules_pkg//pkg:install.bzl", "pkg_install")
1010
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files")

deps/libpcap/overlay/overlay.BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
12
load("@@//compliance/rules:purl.bzl", "purl_for_generic")
23
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
34
load("@rules_license//rules:license.bzl", "license")

deps/libselinux.BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
load("@@//compliance/rules:purl.bzl", "purl_for_generic")
22
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
3-
load("@rules_cc//cc:defs.bzl", "cc_library")
3+
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_shared_library")
44
load("@rules_license//rules:license.bzl", "license")
55
load("@rules_pkg//pkg:install.bzl", "pkg_install")
66
load("@rules_pkg//pkg:mappings.bzl", "pkg_filegroup", "pkg_files")

0 commit comments

Comments
 (0)