PROTOBUF_SYNC_PIPER
pull/9836/head^2
Joshua Haberman 3 years ago
parent 9bd67b6aac
commit a27ce12d3a
  1. 5
      CHANGES.txt
  2. 14
      protobuf_deps.bzl
  3. 19
      python/google/protobuf/internal/api_implementation.py

@ -1,3 +1,8 @@
Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Compiler
* Require package names to be less than 512 bytes in length
2022-04-05 version 3.20.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
PHP

@ -30,10 +30,10 @@ def protobuf_deps():
if not native.existing_rule("com_google_absl"):
# Abseil LTS from November 2021
http_archive(
name = "com_google_absl",
sha256 = "b4e20d9e752a75c10636675691b1e9c2698e0764cb404987d0ffa77223041c19",
urls = ["https://github.com/abseil/abseil-cpp/archive/215105818dfde3174fe799600bb0f3cae233d0bf.zip"],
strip_prefix = "abseil-cpp-215105818dfde3174fe799600bb0f3cae233d0bf",
name = "com_google_absl",
sha256 = "b4e20d9e752a75c10636675691b1e9c2698e0764cb404987d0ffa77223041c19",
urls = ["https://github.com/abseil/abseil-cpp/archive/215105818dfde3174fe799600bb0f3cae233d0bf.zip"],
strip_prefix = "abseil-cpp-215105818dfde3174fe799600bb0f3cae233d0bf",
)
if not native.existing_rule("zlib"):
@ -88,10 +88,10 @@ def protobuf_deps():
http_archive(
name = "rules_pkg",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.7.0/rules_pkg-0.7.0.tar.gz",
],
sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d",
sha256 = "8a298e832762eda1830597d64fe7db58178aa84cd5926d76d5b744d6558941c2",
)
if not native.existing_rule("io_bazel_rules_kotlin"):

@ -59,10 +59,25 @@ except ImportError:
pass # Unspecified by compiler flags.
def _CanImport(mod_name):
try:
mod = importlib.import_module(mod_name)
# Work around a known issue in the classic bootstrap .par import hook.
if not mod:
raise ImportError(mod_name + ' import succeeded but was None')
return True
except ImportError:
return False
if _implementation_type is None:
_implementation_type = 'python'
if _CanImport('google._upb._message'):
_implementation_type = 'upb'
elif _CanImport('google.protobuf.pyext._message'):
_implementation_type = 'cpp'
else:
_implementation_type = 'python'
# This environment variable can be used to switch to a certain implementation
# of the Python API, overriding the compile-time constants in the
@ -98,7 +113,7 @@ if _implementation_type == 'cpp':
if _implementation_type == 'upb':
try:
# pylint: disable=g-import-not-at-top
from google.protobuf.pyext import _upb_message as _message
from google._upb import _message
_c_module = _message
del _message
except ImportError:

Loading…
Cancel
Save