Skip to content

Commit 65cfe57

Browse files
authored
Add new version of upb (#1660)
This mostly copies from the previous version, which is missing some macOS fix commits. The only change from the previous version in the bcr is adding a new patch with an alias for the textformat target which is used by grpc.
1 parent 6dd3a6d commit 65cfe57

7 files changed

+102
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module(
2+
name = "upb",
3+
version = "0.0.0-20230907-e7430e6",
4+
compatibility_level = 1,
5+
)
6+
7+
bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl")
8+
bazel_dep(name = "bazel_skylib", version = "1.0.3")
9+
bazel_dep(name = "platforms", version = "0.0.5")
10+
bazel_dep(name = "rules_cc", version = "0.0.9")
11+
bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf")
12+
bazel_dep(name = "rules_pkg", version = "0.7.0")
13+
bazel_dep(name = "rules_proto", version = "4.0.0")
14+
bazel_dep(name = "rules_python", version = "0.31.0")
15+
16+
# Do not take the effort to convert utf8_range to Bzlmod as this has been moved to protobuf/third_party
17+
# See https://github.com/protocolbuffers/utf8_range/commit/1d1ea7e3fedf482d4a12b473c1ed25fe0f371a45
18+
non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
19+
use_repo(non_module_deps, "utf8_range")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- /dev/null
2+
+++ b/MODULE.bazel
3+
@@ -0,0 +1,19 @@
4+
+module(
5+
+ name = "upb",
6+
+ version = "0.0.0-20230907-e7430e6",
7+
+ compatibility_level = 1,
8+
+)
9+
+
10+
+bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl")
11+
+bazel_dep(name = "bazel_skylib", version = "1.0.3")
12+
+bazel_dep(name = "platforms", version = "0.0.5")
13+
+bazel_dep(name = "rules_cc", version = "0.0.9")
14+
+bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf")
15+
+bazel_dep(name = "rules_pkg", version = "0.7.0")
16+
+bazel_dep(name = "rules_proto", version = "4.0.0")
17+
+bazel_dep(name = "rules_python", version = "0.31.0")
18+
+
19+
+# Do not take the effort to convert utf8_range to Bzlmod as this has been moved to protobuf/third_party
20+
+# See https://github.com/protocolbuffers/utf8_range/commit/1d1ea7e3fedf482d4a12b473c1ed25fe0f371a45
21+
+non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
22+
+use_repo(non_module_deps, "utf8_range")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--- /dev/null
2+
+++ b/non_module_deps.bzl
3+
@@ -0,0 +1,19 @@
4+
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
5+
+
6+
+def _github_archive(repo, commit, **kwargs):
7+
+ repo_name = repo.split("/")[-1]
8+
+ http_archive(
9+
+ urls = [repo + "/archive/" + commit + ".zip"],
10+
+ strip_prefix = repo_name + "-" + commit,
11+
+ **kwargs
12+
+ )
13+
+
14+
+def _non_module_deps_impl(ctx):
15+
+ _github_archive(
16+
+ name = "utf8_range",
17+
+ repo = "https://github.com/protocolbuffers/utf8_range",
18+
+ commit = "de0b4a8ff9b5d4c98108bdfe723291a33c52c54f",
19+
+ sha256 = "5da960e5e5d92394c809629a03af3c7709d2d3d0ca731dacb3a9fb4bf28f7702",
20+
+ )
21+
+
22+
+non_module_deps = module_extension(implementation = _non_module_deps_impl)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/BUILD
2+
+++ b/BUILD
3+
@@ -743,2 +743,8 @@ filegroup(
4+
#
5+
# end:google_only
6+
+
7+
+alias(
8+
+ name = "textformat",
9+
+ actual = "//upb/text:text",
10+
+ visibility = ["//visibility:public"],
11+
+)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
matrix:
2+
platform: ["debian10", "macos", "ubuntu2004", "windows"]
3+
bazel: ["6.x", "7.x"]
4+
tasks:
5+
verify_targets:
6+
platform: ${{ platform }}
7+
bazel: ${{ bazel }}
8+
build_flags:
9+
- '--cxxopt=-std=c++14'
10+
- '--host_cxxopt=-std=c++14'
11+
build_targets:
12+
- '@upb//:upb'
13+
- '@upb//:descriptor_upb_proto'
14+
- '@upb//:textformat'
15+
- '@upb//cmake:staleness_test_lib'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"integrity": "sha256-o1DZS2CWjimNFBLfUcH/fVGQ3RPtsXseB2asNpwXQAk=",
3+
"strip_prefix": "upb-e7430e66d6e51def2a88f0b66fdab62b0d9492c1",
4+
"url": "https://github.com/protocolbuffers/upb/archive/e7430e66d6e51def2a88f0b66fdab62b0d9492c1.tar.gz",
5+
"patch_strip": 1,
6+
"patches": {
7+
"0001-Add-MODULE.bazel.patch": "sha256-AC7tn9EKtF9UprYQKdPxH/PQGLF9U0jgoSZfh/rzmuc=",
8+
"0002-Add-utf8_range-dependency.patch": "sha256-zQDiCRqENGZ2Y5+WTjSgmkTWSaRHaU0vefc+XUxksaw=",
9+
"0003-Add-textformat-alias.patch": "sha256-IHkHImqzDKY8zQqheZGwuluHqtkFbZgj0wfNXmvHf3w="
10+
}
11+
}

modules/upb/metadata.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"0.0.0-20211020-160625a",
1414
"0.0.0-20220602-e5f2601",
1515
"0.0.0-20220923-a547704",
16-
"0.0.0-20230516-61a97ef"
16+
"0.0.0-20230516-61a97ef",
17+
"0.0.0-20230907-e7430e6"
1718
],
1819
"yanked_versions": {}
1920
}

0 commit comments

Comments
 (0)