Skip to content

Commit f231358

Browse files
authored
deps: use rules_cc 0.0.13 to support newer bazel versions (bazel-contrib#2335)
In order for WORKSPACE to work with newer bazel versions, rules_cc 0.0.13 or higher is necessary. rules_cc then requires a newer protobuf version. Note I couldn't figure out the minimum protobuf version, but 27.0 seems to work OK. AFAIK only WORKSPACE is affected. Our bzlmod uses 0.0.9 and hasn't had issues. Fixes bazel-contrib#2310
1 parent 6babe59 commit f231358

File tree

6 files changed

+13
-66
lines changed

6 files changed

+13
-66
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ A brief description of the categories of changes:
2727

2828
{#v0-0-0-changed}
2929
### Changed
30-
- Nothing yet
30+
* (deps) (WORKSPACE only) rules_cc 0.0.13 and protobuf 27.0 is now the default
31+
version used; this for Bazel 8+ support (previously version was rules_cc 0.0.9
32+
and no protobuf version specified)
33+
([2310](https://github.com/bazelbuild/rules_python/issues/2310)).
3134

3235
{#v0-0-0-fixed}
3336
### Fixed

python/private/py_repositories.bzl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,14 @@ def py_repositories():
5555
)
5656
http_archive(
5757
name = "rules_cc",
58-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
59-
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
60-
strip_prefix = "rules_cc-0.0.9",
58+
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
59+
strip_prefix = "rules_cc-0.0.13",
60+
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
61+
)
62+
http_archive(
63+
name = "protobuf",
64+
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
65+
strip_prefix = "protobuf-27.0",
66+
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
6167
)
6268
pypi_deps()

tests/integration/compile_pip_requirements/WORKSPACE

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2-
3-
http_archive(
4-
name = "protobuf",
5-
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
6-
strip_prefix = "protobuf-27.0",
7-
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
8-
)
9-
10-
http_archive(
11-
name = "rules_cc",
12-
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
13-
strip_prefix = "rules_cc-0.0.13",
14-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
15-
)
16-
171
local_repository(
182
name = "rules_python",
193
path = "../../..",

tests/integration/ignore_root_user_error/WORKSPACE

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,5 @@
11
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
22

3-
http_archive(
4-
name = "protobuf",
5-
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
6-
strip_prefix = "protobuf-27.0",
7-
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
8-
)
9-
10-
http_archive(
11-
name = "rules_cc",
12-
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
13-
strip_prefix = "rules_cc-0.0.13",
14-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
15-
)
16-
173
local_repository(
184
name = "rules_python",
195
path = "../../..",

tests/integration/pip_parse/WORKSPACE

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2-
3-
http_archive(
4-
name = "protobuf",
5-
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
6-
strip_prefix = "protobuf-27.0",
7-
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
8-
)
9-
10-
http_archive(
11-
name = "rules_cc",
12-
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
13-
strip_prefix = "rules_cc-0.0.13",
14-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
15-
)
16-
171
local_repository(
182
name = "rules_python",
193
path = "../../..",

tests/integration/py_cc_toolchain_registered/WORKSPACE

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2-
3-
http_archive(
4-
name = "protobuf",
5-
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
6-
strip_prefix = "protobuf-27.0",
7-
url = "https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
8-
)
9-
10-
http_archive(
11-
name = "rules_cc",
12-
sha256 = "d9bdd3ec66b6871456ec9c965809f43a0901e692d754885e89293807762d3d80",
13-
strip_prefix = "rules_cc-0.0.13",
14-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.13/rules_cc-0.0.13.tar.gz"],
15-
)
16-
171
local_repository(
182
name = "rules_python",
193
path = "../../..",

0 commit comments

Comments
 (0)