Update protobuf and upb pinned Bazel versions

These cross dependencies will be going away soon when we merge protobuf and upb
into a single Bazel repo, but I thought it would be good to update these just
in case we need to do a release before that merge happens.

PiperOrigin-RevId: 560756369
pull/13711/head
Adam Cozzette 1 year ago committed by Copybara-Service
parent 3e6f8ee152
commit 7050c6b0ae
  1. 8
      protobuf_deps.bzl
  2. 40
      upb/bazel/protobuf.patch
  3. 5
      upb/bazel/workspace_deps.bzl

@ -147,9 +147,9 @@ def protobuf_deps():
)
if not native.existing_rule("upb"):
_github_archive(
http_archive(
name = "upb",
repo = "https://github.com/protocolbuffers/upb",
commit = "57636ce03ac1e2aab3a362a61a6664981e21cda5",
sha256 = "75da534db927e165cb550d232c35e2dec4b5153b3b47989b250d75febbfc1710",
url = "https://github.com/protocolbuffers/protobuf/archive/f85a338d79f05938d1725fba3b2c603a8d06462e.zip",
strip_prefix = "protobuf-f85a338d79f05938d1725fba3b2c603a8d06462e/upb",
sha256 = "cd28ae63e40a146ec1a2d41e96f53e637aaa5d6c746e7120d013aafc65092882",
)

@ -1,40 +0,0 @@
--- python/google/protobuf/internal/test_util.py
+++ python/google/protobuf/internal/test_util.py
@@ -39,6 +39,7 @@ __author__ = 'robinson@google.com (Will Robinson)'
import numbers
import operator
import os.path
+import pathlib
from google.protobuf import unittest_import_pb2
from google.protobuf import unittest_pb2
@@ -617,17 +618,22 @@ def ExpectAllFieldsSet(test_case, message):
message.default_import_enum)
+def _SearchUp(path, filename):
+ path = pathlib.Path(path).resolve()
+ for parent in [path] + list(path.parents):
+ file_path = parent / ('google/protobuf/testdata/' + filename)
+ if file_path.exists():
+ # Found it. Load the golden file from the testdata directory.
+ return file_path.open('rb')
+ return None
+
def GoldenFile(filename):
"""Finds the given golden file and returns a file object representing it."""
# Search up the directory tree looking for the C++ protobuf source code.
- path = '.'
- while os.path.exists(path):
- if os.path.exists(os.path.join(path, 'src/google/protobuf')):
- # Found it. Load the golden file from the testdata directory.
- full_path = os.path.join(path, 'src/google/protobuf/testdata', filename)
- return open(full_path, 'rb')
- path = os.path.join(path, '..')
+ f = _SearchUp('.', filename) or _SearchUp(__file__, filename)
+ if f:
+ return f
# Search internally.
path = '.'

@ -23,9 +23,8 @@ def upb_deps():
_github_archive,
name = "com_google_protobuf",
repo = "https://github.com/protocolbuffers/protobuf",
commit = "22e845e279bd79ad013bff4b79660b8c8b72d935",
sha256 = "276215041e767973f274299783b5d7b7de1a3c55628b9890bd9eb064dfa5daaf",
patches = ["@upb//bazel:protobuf.patch"],
commit = "f85a338d79f05938d1725fba3b2c603a8d06462e",
sha256 = "cd28ae63e40a146ec1a2d41e96f53e637aaa5d6c746e7120d013aafc65092882",
)
maybe(

Loading…
Cancel
Save