From 7471a0ac1ea1fd58492b35753d3dfb5f9d1f6be5 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Tue, 19 Nov 2019 15:45:51 -0800 Subject: [PATCH 1/9] Update CHANGES.txt with 3.11.0-RC1 release notes --- CHANGES.txt | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 5aaee7285657..b50f1f2ec866 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,61 @@ +2019-11-19 version 3.11.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) + + C++ + * Make serialization method naming consistent + * Make proto runtime + generated code free of deprecation warnings + * Moved ShutdownProtobufLibrary() to message_lite.h. For backward compatibility a declaration is still available in stubs/common.h, but users should prefer message_lite.h + * Removed non-namespace macro EXPECT_OK() + * Removed mathlimits.h from stubs in favor of using std::numeric_limits from C++11 + * Fixed bug in parser when ending on a group tag + * Add a helper function to UnknownFieldSet to deal with the changing return value of message::unknown_fields() + * Fix incorrect use of string_view iterators + * Support direct pickling of nested messages + * Skip extension tag validation for MessageSet if unknown dependencies are allowed + * Updated deprecation macros to annotate deprecated code (#6612) + * Remove conversion warning in MapEntryFuncs::ByteSizeLong (#6766) + * Make shared libraries be able to link to MSVC static runtime libraries (#6780) + + Java + * Remove the usage of MethodHandle, so that Android users prior to API version 26 can use protobuf-java + * Improved Javadoc for ByteString + * Publish ProGuard config for javalite + * Fix for StrictMode disk read violation in ExtensionRegistryLite + * Include part of the ByteString's content in its toString(). + * Include unknown fields when merging proto3 messages in Java lite builders + + Python + * Clarify the behavior of text_format.Parse/Merge on non-repeated fields when the input proto is non-empty + * Add float_precision option in json format printer + * Improve error message when using unbuffered streams with delimited messages + * Optionally print bytes fields as messages, if possible + * FieldPath: fix testing IsSet on root path '' + + JavaScript + * Change hiddenES6Property to @package rather than @private to avoid unused private property check + * Remove guard for Symbol iterator for jspb.Map + * Use string template to construct parameter + * Introduce jspb.Message.deserializeWithCtor to replace jspb.Message.deserialize method + + PHP + * Avoid too much overhead in layout_init (#6716) + * Lazily Create Singular Wrapper Message (#6833) + + Ruby + * Ruby lazy wrappers optimization (#6797) + + C# + * (RepeatedField): Capacity property to resize the internal array (#6530) + * C# Proto2 feature : Finale (#5936) + * Add length checks to ExtensionCollection (#6759) + * Optimize parsing of some primitive and wrapper types (#6843) + * Document proto2 feature implementations in Google.Protobuf (#6499) + * Use 3 parameter Encoding.GetString for default string values (#6828) + * Change _Extensions property to normal body rather than expression (#6856) + + Objective C + * Remove OSReadLittle* due to alignment requirements (#6678) + + 2019-09-03 version 3.10.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) C++ From bc0e3c98ec0b6166cd14c8731d1f9336044020b9 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Tue, 19 Nov 2019 16:17:52 -0800 Subject: [PATCH 2/9] Update the description of Python changes --- CHANGES.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b50f1f2ec866..219a9694e2b3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,11 +24,10 @@ * Include unknown fields when merging proto3 messages in Java lite builders Python - * Clarify the behavior of text_format.Parse/Merge on non-repeated fields when the input proto is non-empty * Add float_precision option in json format printer - * Improve error message when using unbuffered streams with delimited messages - * Optionally print bytes fields as messages, if possible + * Optionally print bytes fields as messages in unknown fields, if possible * FieldPath: fix testing IsSet on root path '' + * Experimental code gen (fast import protobuf module) which only work with cpp generated code linked in JavaScript * Change hiddenES6Property to @package rather than @private to avoid unused private property check From 7ab517311eb13ff723cdd16dcab7b542c68696a6 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Tue, 19 Nov 2019 16:22:53 -0800 Subject: [PATCH 3/9] Expand the section on C# Proto2 support Co-Authored-By: ObsidianMinor --- CHANGES.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 219a9694e2b3..0d28aca7b093 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -44,7 +44,8 @@ C# * (RepeatedField): Capacity property to resize the internal array (#6530) - * C# Proto2 feature : Finale (#5936) + * Experimental proto2 support is now officially available (#4642, #5183, #5350, #5936) + * Getting started doc: https://github.com/protocolbuffers/protobuf/blob/master/docs/csharp/proto2.md * Add length checks to ExtensionCollection (#6759) * Optimize parsing of some primitive and wrapper types (#6843) * Document proto2 feature implementations in Google.Protobuf (#6499) From 2ac5df293a57086dea91dc211f5eac165ee245d9 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Tue, 19 Nov 2019 16:25:01 -0800 Subject: [PATCH 4/9] Removed the C# Proto2 feature implementation PR in favour of the getting strated doc. --- CHANGES.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 0d28aca7b093..403ec41c4613 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -45,10 +45,9 @@ C# * (RepeatedField): Capacity property to resize the internal array (#6530) * Experimental proto2 support is now officially available (#4642, #5183, #5350, #5936) - * Getting started doc: https://github.com/protocolbuffers/protobuf/blob/master/docs/csharp/proto2.md + * Getting started doc: https://github.com/protocolbuffers/protobuf/blob/master/docs/csharp/proto2.md * Add length checks to ExtensionCollection (#6759) * Optimize parsing of some primitive and wrapper types (#6843) - * Document proto2 feature implementations in Google.Protobuf (#6499) * Use 3 parameter Encoding.GetString for default string values (#6828) * Change _Extensions property to normal body rather than expression (#6856) From d0dbd1972b6ac09060b28281f98e42c05e4d94fb Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Wed, 20 Nov 2019 10:35:18 -0800 Subject: [PATCH 5/9] Updated release notes for Obj-C --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 403ec41c4613..ec09e3a8b686 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -52,7 +52,7 @@ * Change _Extensions property to normal body rather than expression (#6856) Objective C - * Remove OSReadLittle* due to alignment requirements (#6678) + * Fixed unaligned reads for 32bit arm with newer Xcode versions (#6678) 2019-09-03 version 3.10.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) From 2b6acbd3e38fa7e4f666d9f65a97cc62ff5801a1 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Wed, 20 Nov 2019 10:43:50 -0800 Subject: [PATCH 6/9] Removed unnecessary/internal changes from Java and Javascript --- CHANGES.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ec09e3a8b686..fc909c416bf2 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -17,7 +17,6 @@ Java * Remove the usage of MethodHandle, so that Android users prior to API version 26 can use protobuf-java - * Improved Javadoc for ByteString * Publish ProGuard config for javalite * Fix for StrictMode disk read violation in ExtensionRegistryLite * Include part of the ByteString's content in its toString(). @@ -30,10 +29,7 @@ * Experimental code gen (fast import protobuf module) which only work with cpp generated code linked in JavaScript - * Change hiddenES6Property to @package rather than @private to avoid unused private property check * Remove guard for Symbol iterator for jspb.Map - * Use string template to construct parameter - * Introduce jspb.Message.deserializeWithCtor to replace jspb.Message.deserialize method PHP * Avoid too much overhead in layout_init (#6716) From 677b77f5b50cb4937108ad821264a4ed567a7093 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Wed, 20 Nov 2019 14:59:31 -0800 Subject: [PATCH 7/9] Revert "Make shared libraries be able to link to MSVC static runtime libraries, so that VC runtime is not required." This reverts commit 129a7c875fc89309a2ab2fbbc940268bbf42b024. We are seeing errors when building Python release artifacts in Windows: " error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MT_StaticRelease' in descriptor.obj". --- cmake/CMakeLists.txt | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0ae54356762c..8e5e68073bc1 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -40,6 +40,8 @@ else (BUILD_SHARED_LIBS) endif (BUILD_SHARED_LIBS) option(protobuf_BUILD_SHARED_LIBS "Build Shared Libraries" ${protobuf_BUILD_SHARED_LIBS_DEFAULT}) include(CMakeDependentOption) +cmake_dependent_option(protobuf_MSVC_STATIC_RUNTIME "Link static runtime libraries" ON + "NOT protobuf_BUILD_SHARED_LIBS" OFF) set(protobuf_WITH_ZLIB_DEFAULT ON) option(protobuf_WITH_ZLIB "Build with zlib support" ${protobuf_WITH_ZLIB_DEFAULT}) set(protobuf_DEBUG_POSTFIX "d" @@ -153,22 +155,22 @@ if (protobuf_BUILD_SHARED_LIBS) set(protobuf_SHARED_OR_STATIC "SHARED") else (protobuf_BUILD_SHARED_LIBS) set(protobuf_SHARED_OR_STATIC "STATIC") + # In case we are building static libraries, link also the runtime library statically + # so that MSVCR*.DLL is not required at runtime. + # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx + # This is achieved by replacing msvc option /MD with /MT and /MDd with /MTd + # http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F + if (MSVC AND protobuf_MSVC_STATIC_RUNTIME) + foreach(flag_var + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + if(${flag_var} MATCHES "/MD") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + endif(${flag_var} MATCHES "/MD") + endforeach(flag_var) + endif (MSVC AND protobuf_MSVC_STATIC_RUNTIME) endif (protobuf_BUILD_SHARED_LIBS) -# In case we are linking the runtime library statically so that MSVCR*.DLL is not required at runtime. -# https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx -# This is achieved by replacing msvc option /MD with /MT and /MDd with /MTd -# http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_build_my_MSVC_application_with_a_static_runtime.3F -if (MSVC AND protobuf_MSVC_STATIC_RUNTIME) - foreach(flag_var - CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif(${flag_var} MATCHES "/MD") - endforeach(flag_var) -endif (MSVC AND protobuf_MSVC_STATIC_RUNTIME) - if (MSVC) # Build with multiple processes add_definitions(/MP) From 481f676fad779accfc7afeb98b69216265dcc771 Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Wed, 20 Nov 2019 15:14:01 -0800 Subject: [PATCH 8/9] Remove the line from CHANGES.txt that mentions #6780 --- CHANGES.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index fc909c416bf2..3b6da26d084c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,7 +13,6 @@ * Skip extension tag validation for MessageSet if unknown dependencies are allowed * Updated deprecation macros to annotate deprecated code (#6612) * Remove conversion warning in MapEntryFuncs::ByteSizeLong (#6766) - * Make shared libraries be able to link to MSVC static runtime libraries (#6780) Java * Remove the usage of MethodHandle, so that Android users prior to API version 26 can use protobuf-java From 2a1a5b3c6f21c584a3e4b88e80b32333884b956a Mon Sep 17 00:00:00 2001 From: Rafi Kamal Date: Wed, 20 Nov 2019 16:37:05 -0800 Subject: [PATCH 9/9] Marked update_compatibility_version.py as executable --- update_compatibility_version.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 update_compatibility_version.py diff --git a/update_compatibility_version.py b/update_compatibility_version.py old mode 100644 new mode 100755