Przeglądaj źródła

Consolidate on @rules_cc and update it to the latest version (#6580)

Also consolidate on using `//bazel/cc_rules:defs.bzl` where appropriate.

Also update a couple of Bazel modules deps of `@rules_cc` to the latest
versions.
Chandler Carruth 3 miesięcy temu
rodzic
commit
93c7c9ad96

+ 3 - 3
MODULE.bazel

@@ -29,13 +29,13 @@ http_archive = use_repo_rule(
 )
 
 bazel_dep(name = "abseil-cpp", version = "20250512.1")
-bazel_dep(name = "bazel_skylib", version = "1.8.1")
+bazel_dep(name = "bazel_skylib", version = "1.9.0")
 bazel_dep(name = "google_benchmark", version = "1.9.4")
 bazel_dep(name = "googletest", version = "1.17.0")
 bazel_dep(name = "re2", version = "2024-07-02.bcr.1")
-bazel_dep(name = "rules_cc", version = "0.1.4")
+bazel_dep(name = "rules_cc", version = "0.2.6")
 bazel_dep(name = "rules_pkg", version = "1.1.0")
-bazel_dep(name = "rules_shell", version = "0.5.0")
+bazel_dep(name = "rules_shell", version = "0.6.1")
 bazel_dep(name = "tcmalloc", version = "0.0.0-20250331-43fcf6e")
 bazel_dep(name = "tree-sitter-bazel", version = "0.26.3")
 

+ 4 - 5
MODULE.bazel.lock

@@ -144,8 +144,8 @@
     "https://bcr.bazel.build/modules/rules_cc/0.0.8/MODULE.bazel": "964c85c82cfeb6f3855e6a07054fdb159aced38e99a5eecf7bce9d53990afa3e",
     "https://bcr.bazel.build/modules/rules_cc/0.0.9/MODULE.bazel": "836e76439f354b89afe6a911a7adf59a6b2518fafb174483ad78a2a2fde7b1c5",
     "https://bcr.bazel.build/modules/rules_cc/0.1.1/MODULE.bazel": "2f0222a6f229f0bf44cd711dc13c858dad98c62d52bd51d8fc3a764a83125513",
-    "https://bcr.bazel.build/modules/rules_cc/0.1.4/MODULE.bazel": "bb03a452a7527ac25a7518fb86a946ef63df860b9657d8323a0c50f8504fb0b9",
-    "https://bcr.bazel.build/modules/rules_cc/0.1.4/source.json": "f8e6678214b318585ed9f8deb55ae64ba7708465e4f201f41ab636b9c63851e1",
+    "https://bcr.bazel.build/modules/rules_cc/0.2.6/MODULE.bazel": "b700c99fb8d0c4016c6c05314d15c8964c770ae8e4430f4798619d5044cedbdc",
+    "https://bcr.bazel.build/modules/rules_cc/0.2.6/source.json": "1340464525aeea011f7443e20a1131509efe13d70aa7067ebb3ed066a8241732",
     "https://bcr.bazel.build/modules/rules_foreign_cc/0.9.0/MODULE.bazel": "c9e8c682bf75b0e7c704166d79b599f93b72cfca5ad7477df596947891feeef6",
     "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/MODULE.bazel": "40c97d1144356f52905566c55811f13b299453a14ac7769dfba2ac38192337a8",
     "https://bcr.bazel.build/modules/rules_fuzzing/0.5.2/source.json": "c8b1e2c717646f1702290959a3302a178fb639d987ab61d548105019f11e527e",
@@ -210,7 +210,6 @@
     "https://bcr.bazel.build/modules/rules_rust/0.45.1/MODULE.bazel": "a69d0db3a958fab2c6520961e1b2287afcc8b36690fd31bbc4f6f7391397150d",
     "https://bcr.bazel.build/modules/rules_shell/0.2.0/MODULE.bazel": "fda8a652ab3c7d8fee214de05e7a9916d8b28082234e8d2c0094505c5268ed3c",
     "https://bcr.bazel.build/modules/rules_shell/0.3.0/MODULE.bazel": "de4402cd12f4cc8fda2354fce179fdb068c0b9ca1ec2d2b17b3e21b24c1a937b",
-    "https://bcr.bazel.build/modules/rules_shell/0.5.0/MODULE.bazel": "8c8447370594d45539f66858b602b0bb2cb2d3401a4ebb9ad25830c59c0f366d",
     "https://bcr.bazel.build/modules/rules_shell/0.6.1/MODULE.bazel": "72e76b0eea4e81611ef5452aa82b3da34caca0c8b7b5c0c9584338aa93bae26b",
     "https://bcr.bazel.build/modules/rules_shell/0.6.1/source.json": "20ec05cd5e592055e214b2da8ccb283c7f2a421ea0dc2acbf1aa792e11c03d0c",
     "https://bcr.bazel.build/modules/rules_swift/1.16.0/MODULE.bazel": "4a09f199545a60d09895e8281362b1ff3bb08bbde69c6fc87aff5b92fcc916ca",
@@ -295,7 +294,7 @@
     },
     "@@apple_support+//crosstool:setup.bzl%apple_cc_configure_extension": {
       "general": {
-        "bzlTransitiveDigest": "E970FlMbwpgJPdPUQzatKh6BMfeE0ZpWABvwshh7Tmg=",
+        "bzlTransitiveDigest": "p7Ghcq3+nnQxCrf+U3xnhdn7yOSTDbcFyGHK7Ja+rU4=",
         "usagesDigest": "D4pmKMi+AKU6GdJ8ZxoDKj1muCYIcreeg1ilywlspTc=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},
@@ -406,7 +405,7 @@
     },
     "@@rules_apple+//apple:apple.bzl%provisioning_profile_repository_extension": {
       "general": {
-        "bzlTransitiveDigest": "DKG756yy334fy13r7XW5ZeBLFQP1GZnmqVpCsytUDKk=",
+        "bzlTransitiveDigest": "eVzyeT0wtszNEyCDTNCqNnCFIIhGkAIayc8bRxl37Hs=",
         "usagesDigest": "vsJl8Rw5NL+5Ag2wdUDoTeRF/5klkXO8545Iy7U1Q08=",
         "recordedFileInputs": {},
         "recordedDirentsInputs": {},

+ 2 - 2
bazel/cc_toolchains/clang_cc_toolchain_config.bzl

@@ -4,9 +4,9 @@
 
 """A Starlark cc_toolchain configuration rule"""
 
-load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
+load("@rules_cc//cc:action_names.bzl", "ACTION_NAMES")
 load(
-    "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
+    "@rules_cc//cc:cc_toolchain_config_lib.bzl",
     "action_config",
     "feature",
     "feature_set",

+ 1 - 1
scripts/BUILD

@@ -2,8 +2,8 @@
 # Exceptions. See /LICENSE for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-load("@rules_cc//cc:cc_library.bzl", "cc_library")
 load("@rules_python//python:defs.bzl", "py_test")
+load("//bazel/cc_rules:defs.bzl", "cc_library")
 
 py_test(
     name = "no_op_test",

+ 1 - 2
testing/file_test/BUILD

@@ -2,8 +2,7 @@
 # Exceptions. See /LICENSE for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-load("@rules_cc//cc:cc_test.bzl", "cc_test")
-load("//bazel/cc_rules:defs.bzl", "cc_library")
+load("//bazel/cc_rules:defs.bzl", "cc_library", "cc_test")
 load("rules.bzl", "file_test")
 
 package(default_visibility = ["//visibility:public"])

+ 1 - 1
third_party/llvm/BUILD

@@ -2,7 +2,7 @@
 # Exceptions. See /LICENSE for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-load("@rules_cc//cc:defs.bzl", "cc_library")
+load("//bazel/cc_rules:defs.bzl", "cc_library")
 
 cc_library(
     name = "clang_cc1",

+ 1 - 1
toolchain/base/llvm_tools.bzl

@@ -4,7 +4,7 @@
 
 """Provides variables and rules to automate working with LLVM's CLI tools."""
 
-load("@rules_cc//cc:cc_library.bzl", "cc_library")
+load("//bazel/cc_rules:defs.bzl", "cc_library")
 
 # The main LLVM command line tools, including their "primary" name, binary name,
 # and the library dependency required to use them.

+ 1 - 1
toolchain/base/runtime_sources.bzl

@@ -18,7 +18,7 @@ Future runtimes we plan to add support for but not yet included:
 - Profiling runtimes
 """
 
-load("@rules_cc//cc:cc_library.bzl", "cc_library")
+load("//bazel/cc_rules:defs.bzl", "cc_library")
 
 CRT_FILES = {
     "crtbegin_src": "@llvm-project//compiler-rt:builtins_crtbegin_src",