Skip to content

Commit f3fb3e2

Browse files
authored
Update rules_cc to 0.2.14. (#605)
With newer versions of `rules_cc` for WORKSPACE setups we need the following new flag that has to be put into the relevant .bazelrc files: `common --repositories_without_autoloads=cc_compatibility_proxy`. We also need a main `WORKSPACE.bzlmod` in order for `--enable_bzlmod --enable_workspace` to work (false/true and true/false) already worked but (true/true) failed in Bazel 8 before this.
1 parent d2f0994 commit f3fb3e2

File tree

7 files changed

+15
-5
lines changed

7 files changed

+15
-5
lines changed

.github/workflows/release_notes_template.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ bazel_features_deps()
4949

5050
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
5151

52+
# If you see an error:
53+
# ERROR: Cycle caused by autoloads, failed to load .bzl file '@@cc_compatibility_proxy//:symbols.bzl'.
54+
# then you might need to add the following to your .bzelrc:
55+
# common --repositories_without_autoloads=cc_compatibility_proxy
5256
compatibility_proxy_repo()
5357

5458
load("@toolchains_llvm//toolchain:rules.bzl", "llvm_toolchain")

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module(
2222
bazel_dep(name = "bazel_features", version = "1.38.0")
2323
bazel_dep(name = "bazel_skylib", version = "1.8.2")
2424
bazel_dep(name = "aspect_bazel_lib", version = "2.19.3")
25-
bazel_dep(name = "rules_cc", version = "0.2.8")
25+
bazel_dep(name = "rules_cc", version = "0.2.14")
2626
bazel_dep(name = "platforms", version = "1.0.0")
2727
bazel_dep(name = "helly25_bzl", version = "0.3.1")
2828

WORKSPACE.bzlmod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Empty by design. Allows use of --enable_bzlmod --enable_workspace.

tests/.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
common --incompatible_disallow_empty_glob
22
common --nolegacy_external_runfiles
33
build --features=layering_check
4+
common --repositories_without_autoloads=cc_compatibility_proxy

tests/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local_path_override(
2222

2323
bazel_dep(name = "bazel_skylib", version = "1.8.2")
2424
bazel_dep(name = "platforms", version = "1.0.0")
25-
bazel_dep(name = "rules_cc", version = "0.2.13")
25+
bazel_dep(name = "rules_cc", version = "0.2.14")
2626
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
2727
bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go")
2828
bazel_dep(name = "rules_license", version = "1.0.0")

tests/WORKSPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ rules_foreign_cc_dependencies()
353353

354354
load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo")
355355

356+
# If you see an error:
357+
# ERROR: Cycle caused by autoloads, failed to load .bzl file '@@cc_compatibility_proxy//:symbols.bzl'.
358+
# then you might need to add the following to your .bzelrc:
359+
# common --repositories_without_autoloads=cc_compatibility_proxy
356360
compatibility_proxy_repo()
357361

358362
_ALL_CONTENT = """\

toolchain/deps.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def bazel_toolchain_dependencies():
1919
if not native.existing_rule("rules_cc"):
2020
http_archive(
2121
name = "rules_cc",
22-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.2/rules_cc-0.2.2.tar.gz"],
23-
sha256 = "e50f24506011841e2ac83d9733a0c7e058eb3a10a6e3e10baa9c7942ff5f4767",
24-
strip_prefix = "rules_cc-0.2.2",
22+
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.14/rules_cc-0.2.14.tar.gz"],
23+
sha256 = "a2fdfde2ab9b2176bd6a33afca14458039023edb1dd2e73e6823810809df4027",
24+
strip_prefix = "rules_cc-0.2.14",
2525
)
2626

2727
# Load bazel_skylib if the user has not defined them.

0 commit comments

Comments
 (0)