Skip to content

Commit 4efd963

Browse files
committed
Move to .bcr.1 instead
1 parent 9890dcb commit 4efd963

File tree

5 files changed

+229
-25
lines changed

5 files changed

+229
-25
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel
2+
# https://github.com/protocolbuffers/protobuf/issues/14313
3+
4+
module(
5+
name = "protobuf",
6+
version = "30.0-rc1.bcr.1", # Automatically updated on release
7+
compatibility_level = 1,
8+
repo_name = "com_google_protobuf",
9+
)
10+
11+
# LOWER BOUND dependency versions.
12+
# Bzlmod follows MVS:
13+
# https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution
14+
# Thus the highest version in their module graph is resolved.
15+
bazel_dep(name = "abseil-cpp", version = "20240722.0", repo_name = "com_google_absl")
16+
bazel_dep(name = "bazel_skylib", version = "1.7.1")
17+
bazel_dep(name = "jsoncpp", version = "1.9.6")
18+
bazel_dep(name = "rules_apple", version = "3.13.0", repo_name = "build_bazel_rules_apple")
19+
bazel_dep(name = "apple_support", version = "1.15.1", repo_name = "build_bazel_apple_support")
20+
bazel_dep(name = "rules_cc", version = "0.0.17")
21+
bazel_dep(name = "rules_fuzzing", version = "0.5.2")
22+
bazel_dep(name = "rules_java", version = "8.6.1")
23+
bazel_dep(name = "rules_jvm_external", version = "6.3")
24+
bazel_dep(name = "rules_kotlin", version = "1.9.6")
25+
bazel_dep(name = "rules_license", version = "1.0.0")
26+
bazel_dep(name = "rules_pkg", version = "1.0.1")
27+
bazel_dep(name = "rules_python", version = "1.0.0")
28+
bazel_dep(name = "rules_rust", version = "0.51.0")
29+
bazel_dep(name = "platforms", version = "0.0.10")
30+
bazel_dep(name = "zlib", version = "1.3.1.bcr.5")
31+
bazel_dep(name = "bazel_features", version = "1.23.0", repo_name = "proto_bazel_features")
32+
bazel_dep(
33+
name = "rules_shell",
34+
version = "0.2.0",
35+
)
36+
37+
# Proto toolchains
38+
register_toolchains("//bazel/private/toolchains:all")
39+
40+
SUPPORTED_PYTHON_VERSIONS = [
41+
"3.9",
42+
"3.10",
43+
"3.11",
44+
"3.12",
45+
]
46+
47+
# TODO: Support hermetic / system python in bzlmod.
48+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
49+
50+
[
51+
python.toolchain(
52+
# Disable root warning for .pyc cache misses since CI runs as root.
53+
# See https://github.com/bazelbuild/rules_python/pull/713
54+
ignore_root_user_error = True,
55+
is_default = python_version == SUPPORTED_PYTHON_VERSIONS[-1],
56+
python_version = python_version,
57+
)
58+
for python_version in SUPPORTED_PYTHON_VERSIONS
59+
]
60+
61+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
62+
63+
[
64+
pip.parse(
65+
hub_name = "protobuf_pip_deps",
66+
python_version = python_version,
67+
requirements_lock = "//python:requirements.txt",
68+
)
69+
for python_version in SUPPORTED_PYTHON_VERSIONS
70+
]
71+
72+
use_repo(pip, "protobuf_pip_deps")
73+
74+
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate", dev_dependency = True)
75+
crate.spec(
76+
package = "googletest",
77+
version = ">0.0.0",
78+
)
79+
crate.spec(
80+
package = "paste",
81+
version = ">=1",
82+
)
83+
crate.from_specs()
84+
use_repo(crate, crate_index = "crates")
85+
86+
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True)
87+
maven.install(
88+
name = "protobuf_maven",
89+
artifacts = [
90+
"com.google.caliper:caliper:1.0-beta-3",
91+
"com.google.code.findbugs:jsr305:3.0.2",
92+
"com.google.code.gson:gson:2.8.9",
93+
"com.google.errorprone:error_prone_annotations:2.5.1",
94+
"com.google.j2objc:j2objc-annotations:2.8",
95+
"com.google.guava:guava:32.0.1-jre",
96+
"com.google.guava:guava-testlib:32.0.1-jre",
97+
"com.google.testparameterinjector:test-parameter-injector:1.18",
98+
"com.google.truth:truth:1.1.2",
99+
"junit:junit:4.13.2",
100+
"org.mockito:mockito-core:4.3.1",
101+
"biz.aQute.bnd:biz.aQute.bndlib:6.4.0",
102+
"info.picocli:picocli:4.6.3",
103+
],
104+
repositories = [
105+
"https://repo1.maven.org/maven2",
106+
"https://repo.maven.apache.org/maven2",
107+
],
108+
)
109+
use_repo(maven, "protobuf_maven")
110+
111+
# Development dependencies
112+
bazel_dep(name = "googletest", version = "1.14.0", dev_dependency = True, repo_name = "com_google_googletest")
113+
bazel_dep(name = "rules_buf", version = "0.3.0", dev_dependency = True)
114+
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
115+
bazel_dep(
116+
name = "abseil-py",
117+
version = "2.1.0",
118+
dev_dependency = True,
119+
repo_name = "com_google_absl_py",
120+
)
121+
122+
# For clang-cl configuration
123+
cc_configure = use_extension("@rules_cc//cc:extensions.bzl", "cc_configure_extension")
124+
use_repo(cc_configure, "local_config_cc")
125+
126+
# rules_proto are needed for @com_google_protobuf_v25.0 used in //compatibility/... tests
127+
bazel_dep(name = "rules_proto", version = "4.0.0", dev_dependency = True)

modules/protobuf/30.0-rc1.bcr.1/patches/remove-redundant-clang-cl-msvc-constraint.patch

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
bcr_test_module:
2+
module_path: examples
3+
matrix:
4+
# Removing ubuntu just for this release candidate
5+
platform: ["debian10", "macos"]
6+
bazel: [7.x, 8.x]
7+
8+
tasks:
9+
verify_targets:
10+
name: "Verify build targets"
11+
platform: ${{ platform }}
12+
bazel: ${{ bazel }}
13+
build_flags:
14+
- '--host_cxxopt=-std=c++17'
15+
- '--cxxopt=-std=c++17'
16+
build_targets:
17+
- '@protobuf//:protobuf'
18+
- '@protobuf//:protobuf_lite'
19+
- '@protobuf//:protobuf_python'
20+
- '@protobuf//:protobuf_java'
21+
- '@protobuf//:protoc'
22+
- '@protobuf//:test_messages_proto2_cc_proto'
23+
- '@protobuf//:test_messages_proto3_cc_proto'
24+
# Separating windows for different c++ build flags.
25+
verify_targets_windows:
26+
name: "Verify windows build targets"
27+
platform: windows
28+
bazel: ${{ bazel }}
29+
build_flags:
30+
- '--cxxopt=/std:c++17'
31+
- '--host_cxxopt=/std:c++17'
32+
- '--extra_execution_platforms=@protobuf//build_defs:x64_windows-clang-cl'
33+
- '--host_platform=@protobuf//build_defs:x64_windows-clang-cl'
34+
- '--extra_toolchains=@local_config_cc//:cc-toolchain-x64_windows-clang-cl'
35+
build_targets:
36+
- '@protobuf//:protobuf'
37+
- '@protobuf//:protobuf_lite'
38+
- '@protobuf//:protobuf_python'
39+
- '@protobuf//:protobuf_java'
40+
- '@protobuf//:protoc'
41+
- '@protobuf//:test_messages_proto2_cc_proto'
42+
- '@protobuf//:test_messages_proto3_cc_proto'
43+
44+
bcr_test_module:
45+
module_path: "examples"
46+
matrix:
47+
# Removing ubuntu just for this release candidate
48+
platform: ["debian10", "macos"]
49+
bazel: [7.x, 8.x]
50+
tasks:
51+
run_test_module:
52+
name: "Run test module"
53+
platform: ${{ platform }}
54+
bazel: ${{ bazel }}
55+
build_flags:
56+
- '--host_cxxopt=-std=c++17'
57+
- '--cxxopt=-std=c++17'
58+
build_targets:
59+
- "//..."
60+
run_test_module_windows:
61+
name: "Run windows test module"
62+
platform: windows
63+
bazel: ${{ bazel }}
64+
build_flags:
65+
- '--cxxopt=/std:c++17'
66+
- '--host_cxxopt=/std:c++17'
67+
build_targets:
68+
- "//..."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"integrity": "sha256-p0wGf/NH7knNqhLEz3bbmNIsvL6iOrOBPX1TwGAToWA=",
3+
"patches": {
4+
"remove-redundant-clang-cl-msvc-constraint.patch": "sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU="
5+
},
6+
"strip_prefix": "protobuf-30.0-rc1",
7+
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v30.0-rc1/protobuf-30.0-rc1.zip"
8+
}

modules/protobuf/metadata.json

+26-25
Original file line numberDiff line numberDiff line change
@@ -22,76 +22,76 @@
2222
"name": "Jerry Berg"
2323
},
2424
{
25+
"do_not_notify": true,
2526
"email": "[email protected]",
2627
"github": "acozzette",
27-
"name": "Adam Cozzette",
28-
"do_not_notify": true
28+
"name": "Adam Cozzette"
2929
},
3030
{
31+
"do_not_notify": true,
3132
"email": "[email protected]",
3233
"github": "deannagarcia",
33-
"name": "Deanna Garcia",
34-
"do_not_notify": true
34+
"name": "Deanna Garcia"
3535
},
3636
{
37+
"do_not_notify": true,
3738
"email": "[email protected]",
3839
"github": "esrauchg",
39-
"name": "Em Rauch",
40-
"do_not_notify": true
40+
"name": "Em Rauch"
4141
},
4242
{
43+
"do_not_notify": true,
4344
"email": "[email protected]",
4445
"github": "haberman",
45-
"name": "Josh Haberman",
46-
"do_not_notify": true
46+
"name": "Josh Haberman"
4747
},
4848
{
49+
"do_not_notify": true,
4950
"email": "[email protected]",
5051
"github": "honglooker",
51-
"name": "Hong Shin",
52-
"do_not_notify": true
52+
"name": "Hong Shin"
5353
},
5454
{
55+
"do_not_notify": true,
5556
"email": "[email protected]",
5657
"github": "JasonLunn",
57-
"name": "Jason Lunn",
58-
"do_not_notify": true
58+
"name": "Jason Lunn"
5959
},
6060
{
61+
"do_not_notify": true,
6162
"email": "[email protected]",
6263
"github": "anandolee",
63-
"name": "Jie Luo",
64-
"do_not_notify": true
64+
"name": "Jie Luo"
6565
},
6666
{
67+
"do_not_notify": true,
6768
"email": "[email protected]",
6869
"github": "salo",
69-
"name": "Eric Salo",
70-
"do_not_notify": true
70+
"name": "Eric Salo"
7171
},
7272
{
73+
"do_not_notify": true,
7374
"email": "[email protected]",
7475
"github": "sbenzaquen",
75-
"name": "Samuel Benzaquen",
76-
"do_not_notify": true
76+
"name": "Samuel Benzaquen"
7777
},
7878
{
79+
"do_not_notify": true,
7980
"email": "[email protected]",
8081
"github": "shaod2",
81-
"name": "Dennis Shao",
82-
"do_not_notify": true
82+
"name": "Dennis Shao"
8383
},
8484
{
85+
"do_not_notify": true,
8586
"email": "[email protected]",
8687
"github": "theodorerose",
87-
"name": "Theodore Rose",
88-
"do_not_notify": true
88+
"name": "Theodore Rose"
8989
},
9090
{
91+
"do_not_notify": true,
9192
"email": "[email protected]",
9293
"github": "tonyliaoss",
93-
"name": "Tony Liao",
94-
"do_not_notify": true
94+
"name": "Tony Liao"
9595
}
9696
],
9797
"repository": [
@@ -132,7 +132,8 @@
132132
"29.1",
133133
"29.2",
134134
"29.3",
135-
"30.0-rc1"
135+
"30.0-rc1",
136+
"30.0-rc1.bcr.1"
136137
],
137138
"yanked_versions": {
138139
"3.19.0": "CVE-2022-3171 (https://github.com/advisories/GHSA-h4h5-3hr4-j3g2)",

0 commit comments

Comments
 (0)