diff --git a/CHANGES.txt b/CHANGES.txt index 4ef9bdbac5..a1cc0bfb2c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -25,9 +25,14 @@ Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) * 6x speedup in ArrayEncoder.writeUInt32NotTag Python - * Added UnknownFieldSet(message) for pure Python. The old - message.UnknownFields() will be deprecated after UnknownFieldSet(message) is - added for cpp extension. + * The C extension module for Python has been rewritten to use the upb library. + This is expected to deliver significant performance benefits, especially when + parsing large payloads. There are some minor breaking changes, but these + should not impact most users. For more information see: + https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates + * Due to the breaking changes for Python, the major version number for Python + has been incremented. + * The binary wheel for macOS now supports Apple silicon. 2022-04-21 version 3.20.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl index eab12e33cb..0f3c76aacc 100644 --- a/protobuf_deps.bzl +++ b/protobuf_deps.bzl @@ -114,6 +114,6 @@ def protobuf_deps(): _github_archive( name = "upb", repo = "https://github.com/protocolbuffers/upb", - commit = "0e8772fc20e5a0a2fa1f326c79d494374871ef94", - sha256 = "2a7ccd5a8e20c5b2f6efafb305f734c7ad1cc5615706f7a35cd4fbad436d5101", + commit = "c3cfd09b0184bcbdade71a3d788df02c83e897f2", + sha256 = "4a9f79385fc0c1e3e7ba5c34220db53f956c8c42d636bafc6a563da2facf8c3f", ) diff --git a/protobuf_version.bzl b/protobuf_version.bzl index 13955260a7..19c77cfdc6 100644 --- a/protobuf_version.bzl +++ b/protobuf_version.bzl @@ -1,6 +1,3 @@ PROTOC_VERSION = '3.20.1' PROTOBUF_JAVA_VERSION = '3.20.1' PROTOBUF_PYTHON_VERSION = '3.20.1' - -# Remove once upb has been updated to use PROTOBUF_PYTHON_VERSION instead. -PROTOBUF_VERSION = PROTOBUF_PYTHON_VERSION diff --git a/toolchain/cc_toolchain_config.bzl b/toolchain/cc_toolchain_config.bzl index 777bb82f9a..2599477778 100644 --- a/toolchain/cc_toolchain_config.bzl +++ b/toolchain/cc_toolchain_config.bzl @@ -6,6 +6,7 @@ load( "flag_group", "flag_set", "tool_path", + "with_feature_set", ) all_link_actions = [ @@ -154,10 +155,31 @@ def _impl(ctx): ), ], ), + flag_set( + actions = all_compile_actions, + flag_groups = [flag_group(flags = ["-DNDEBUG", "-O3"])], + with_features = [with_feature_set(features = ["opt"])], + ), + flag_set( + actions = all_compile_actions, + flag_groups = [flag_group(flags = ["-g"])], + with_features = [with_feature_set(features = ["dbg"])], + ), + flag_set( + actions = all_compile_actions, + flag_groups = [flag_group(flags = ["-O1"])], + with_features = [with_feature_set(features = ["fastbuild"])], + ), ], ) - features = [linker_flags, compiler_flags, sysroot_flags] + features = [ + linker_flags, + compiler_flags, + sysroot_flags, + feature(name = "dbg"), + feature(name = "opt"), + ] if "mingw" in ctx.attr.target_full_name: features.append(