Skip to content

Commit 1a60329

Browse files
committed
Add new version of upb
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 546a3a2 commit 1a60329

6 files changed

+100
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module(
2+
name = "upb",
3+
version = "0.0.0-20240321-e7430e6",
4+
compatibility_level = 1,
5+
)
6+
bazel_dep(name = "bazel_skylib", version = "1.0.3")
7+
bazel_dep(name = "rules_proto", version = "4.0.0")
8+
bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf")
9+
bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl")
10+
bazel_dep(name = "rules_pkg", version = "0.7.0")
11+
bazel_dep(name = "platforms", version = "0.0.5")
12+
13+
# Do not take the effort to convert utf8_range to Bzlmod as this has been moved to protobuf/third_party
14+
# See https://github.com/protocolbuffers/utf8_range/commit/1d1ea7e3fedf482d4a12b473c1ed25fe0f371a45
15+
non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
16+
use_repo(non_module_deps, "utf8_range")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
--- /dev/null
2+
+++ b/MODULE.bazel
3+
@@ -0,0 +1,11 @@
4+
+module(
5+
+ name = "upb",
6+
+ version = "0.0.0-20240321-e7430e6",
7+
+ compatibility_level = 1,
8+
+)
9+
+bazel_dep(name = "bazel_skylib", version = "1.0.3")
10+
+bazel_dep(name = "rules_proto", version = "4.0.0")
11+
+bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf")
12+
+bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl")
13+
+bazel_dep(name = "rules_pkg", version = "0.7.0")
14+
+bazel_dep(name = "platforms", version = "0.0.5")
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--- a/MODULE.bazel
2+
+++ b/MODULE.bazel
3+
@@ -9,3 +9,8 @@ bazel_dep(name = "protobuf", version = "23.1", repo_name = "com_google_protobuf"
4+
bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl")
5+
bazel_dep(name = "rules_pkg", version = "0.7.0")
6+
bazel_dep(name = "platforms", version = "0.0.5")
7+
+
8+
+# Do not take the effort to convert utf8_range to Bzlmod as this has been moved to protobuf/third_party
9+
+# See https://github.com/protocolbuffers/utf8_range/commit/1d1ea7e3fedf482d4a12b473c1ed25fe0f371a45
10+
+non_module_deps = use_extension("//:non_module_deps.bzl", "non_module_deps")
11+
+use_repo(non_module_deps, "utf8_range")
12+
diff --git a/non_module_deps.bzl b/non_module_deps.bzl
13+
new file mode 100644
14+
index 00000000..5cc13d7f
15+
--- /dev/null
16+
+++ b/non_module_deps.bzl
17+
@@ -0,0 +1,19 @@
18+
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
19+
+
20+
+def _github_archive(repo, commit, **kwargs):
21+
+ repo_name = repo.split("/")[-1]
22+
+ http_archive(
23+
+ urls = [repo + "/archive/" + commit + ".zip"],
24+
+ strip_prefix = repo_name + "-" + commit,
25+
+ **kwargs
26+
+ )
27+
+
28+
+def _non_module_deps_impl(ctx):
29+
+ _github_archive(
30+
+ name = "utf8_range",
31+
+ repo = "https://github.com/protocolbuffers/utf8_range",
32+
+ commit = "de0b4a8ff9b5d4c98108bdfe723291a33c52c54f",
33+
+ sha256 = "5da960e5e5d92394c809629a03af3c7709d2d3d0ca731dacb3a9fb4bf28f7702",
34+
+ )
35+
+
36+
+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,12 @@
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_targets:
9+
- '@upb//:upb'
10+
- '@upb//:descriptor_upb_proto'
11+
- '@upb//:textformat'
12+
- '@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-YSOPeNFt006ghZRI1D056RQ1USwCodZnjXMw6pAPhKc=",
8+
"0002-Add-utf8_range-dependency.patch": "sha256-L9jPxcjZqoJh5t9mH4BR01puRI5aUY4jtYptZt5T/p8=",
9+
"0003-Add-textformat-alias.patch": "sha256-IHkHImqzDKY8zQqheZGwuluHqtkFbZgj0wfNXmvHf3w="
10+
}
11+
}

0 commit comments

Comments
 (0)