Merge branch 'master' into sync-stage

pull/9030/head
Josh Haberman 3 years ago
commit 129b3e8a98
  1. 32
      CHANGES.txt
  2. 1
      Makefile.am
  3. 5
      Protobuf-C++.podspec
  4. 2
      Protobuf.podspec
  5. 2
      configure.ac
  6. 2
      csharp/Google.Protobuf.Tools.nuspec
  7. 2
      csharp/src/Google.Protobuf/Google.Protobuf.csproj
  8. 2
      java/bom/pom.xml
  9. 2
      java/core/pom.xml
  10. 2
      java/kotlin-lite/pom.xml
  11. 2
      java/kotlin/pom.xml
  12. 2
      java/lite/pom.xml
  13. 2
      java/pom.xml
  14. 2
      java/util/pom.xml
  15. 2
      js/package.json
  16. 3
      kokoro/linux/php_all/build.sh
  17. 2
      kokoro/release/python/linux/build_artifacts.sh
  18. 4
      php/ext/google/protobuf/array.c
  19. 41
      php/ext/google/protobuf/def.c
  20. 9
      php/ext/google/protobuf/def.h
  21. 4
      php/ext/google/protobuf/map.c
  22. 55
      php/ext/google/protobuf/package.xml
  23. 33
      php/ext/google/protobuf/protobuf.c
  24. 14
      php/ext/google/protobuf/protobuf.h
  25. 2
      php/tests/GeneratedClassTest.php
  26. 13
      php/tests/memory_leak_test.php
  27. 40
      php/tests/memory_leak_test.sh
  28. 74
      php/tests/multirequest.sh
  29. 21
      php/tests/valgrind.supp
  30. 2
      protobuf_version.bzl
  31. 2
      protoc-artifacts/pom.xml
  32. 2
      python/MANIFEST.in
  33. 2
      python/google/protobuf/__init__.py
  34. 3
      python/release.sh
  35. 2
      ruby/Rakefile
  36. 1
      ruby/ext/google/protobuf_c/repeated_field.c
  37. 2
      ruby/google-protobuf.gemspec
  38. 4
      ruby/lib/google/protobuf/descriptor_dsl.rb
  39. 12
      ruby/tests/basic.rb
  40. 7
      ruby/tests/basic_test.proto
  41. 3
      src/Makefile.am
  42. 4
      src/google/protobuf/any.pb.h
  43. 4
      src/google/protobuf/api.pb.h
  44. 4
      src/google/protobuf/compiler/plugin.pb.h
  45. 3
      src/google/protobuf/compiler/ruby/ruby_generated_code.proto
  46. 2
      src/google/protobuf/compiler/ruby/ruby_generated_code_pb.rb
  47. 3
      src/google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto
  48. 5
      src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_import.proto
  49. 2
      src/google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb
  50. 41
      src/google/protobuf/compiler/ruby/ruby_generator.cc
  51. 20
      src/google/protobuf/compiler/ruby/ruby_generator_unittest.cc
  52. 4
      src/google/protobuf/descriptor.pb.h
  53. 4
      src/google/protobuf/duration.pb.h
  54. 2
      src/google/protobuf/dynamic_message.cc
  55. 4
      src/google/protobuf/empty.pb.h
  56. 4
      src/google/protobuf/field_mask.pb.h
  57. 8
      src/google/protobuf/port_def.inc
  58. 4
      src/google/protobuf/source_context.pb.h
  59. 4
      src/google/protobuf/struct.pb.h
  60. 8
      src/google/protobuf/stubs/common.h
  61. 4
      src/google/protobuf/timestamp.pb.h
  62. 4
      src/google/protobuf/type.pb.h
  63. 4
      src/google/protobuf/wrappers.pb.h
  64. 2
      toolchain/cc_toolchain_config.bzl

@ -25,8 +25,18 @@ Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Kotlin
* Generated Kotlin code is Explicit API mode compatible
Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
2021-09-13 version 3.18.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
C++
* Fix warnings raised by clang 11 (#8664)
* Make StringPiece constructible from std::string_view (#8707)
* Add missing capability attributes for LLVM 12 (#8714)
* Stop using std::iterator (deprecated in C++17). (#8741)
* Move field_access_listener from libprotobuf-lite to libprotobuf (#8775)
* Fix #7047 Safely handle setlocale (#8735)
* Remove deprecated version of SetTotalBytesLimit() (#8794)
* Support arena allocation of google::protobuf::AnyMetadata (#8758)
* Fix undefined symbol error around SharedCtor() (#8827)
* Fix default value of enum(int) in json_util with proto2 (#8835)
* Better Smaller ByteSizeLong
* Introduce event filters for inject_field_listener_events
* Reduce memory usage of DescriptorPool
@ -50,6 +60,8 @@ Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
* Reduce memory usage of the DescriptorPool type.
Java
* Fix errorprone conflict (#8723)
* Removing deprecated TimeUtil class. (#8749)
* Optimized FieldDescriptor.valueOf() to avoid array copying.
* Removing deprecated TimeUtil class.
* Add Durations.parseUnchecked(String) and Timestamps.parseUnchecked(String)
@ -60,6 +72,24 @@ Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
* Fix for optimization when reading doubles from binary wire format
* Replace toArray implementation with toJSON.
Python
* Drops support for 2.7 and 3.5.
PHP
* Migrate PHP & Ruby to ABSL wyhash (#8854)
* Added support for PHP 8.1 (currently in RC1) to the C extension (#8964)
* Fixed PHP SEGV when constructing messages from a destructor. (#8969)
Ruby
* Move DSL implementation from C to pure Ruby (#8850)
* Fixed a memory bug with RepeatedField#+. (#8970)
Other
* [csharp] ByteString.CreateCodedInput should use ArraySegment offset and count (#8740)
* [ObjC] Add support for using the proto package to prefix symbols. (#8760)
* field_presence.md: fix Go example (#8788)
Kotlin
* Suppress NOTHING_TO_INLINE in Kotlin generated inline functions.

@ -967,6 +967,7 @@ php_EXTRA_DIST= \
php/tests/GeneratedServiceTest.php \
php/tests/MapFieldTest.php \
php/tests/memory_leak_test.php \
php/tests/memory_leak_test.sh \
php/tests/multirequest.php \
php/tests/multirequest.sh \
php/tests/PhpImplementationTest.php \

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Protobuf-C++'
s.version = '3.17.3'
s.version = '3.18.0'
s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License'
@ -21,7 +21,8 @@ Pod::Spec.new do |s|
'src/google/**/*_unittest.{h,cc}',
'src/google/protobuf/test_util*.{h,cc}',
'src/google/protobuf/map_lite_test_util.{h,cc}',
'src/google/protobuf/map_test_util*.{h,cc,inc}'
'src/google/protobuf/map_test_util*.{h,cc,inc}',
'src/google/protobuf/reflection_tester.{h,cc}'
s.header_mappings_dir = 'src'

@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.17.3'
s.version = '3.18.0'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License'

@ -17,7 +17,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.)
AC_INIT([Protocol Buffers],[3.17.3],[protobuf@googlegroups.com],[protobuf])
AC_INIT([Protocol Buffers],[3.18.0],[protobuf@googlegroups.com],[protobuf])
AM_MAINTAINER_MODE([enable])

@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
<version>3.17.3</version>
<version>3.18.0</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>

@ -4,7 +4,7 @@
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
<Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
<VersionPrefix>3.17.3</VersionPrefix>
<VersionPrefix>3.18.0</VersionPrefix>
<!-- C# 7.2 is required for Span/BufferWriter/ReadOnlySequence -->
<LangVersion>7.2</LangVersion>
<Authors>Google Inc.</Authors>

@ -4,7 +4,7 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
<packaging>pom</packaging>
<name>Protocol Buffers [BOM]</name>

@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
</parent>
<artifactId>protobuf-java</artifactId>

@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
</parent>
<artifactId>protobuf-kotlin-lite</artifactId>

@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
</parent>
<artifactId>protobuf-kotlin</artifactId>

@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
</parent>
<artifactId>protobuf-javalite</artifactId>

@ -4,7 +4,7 @@
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
<packaging>pom</packaging>
<name>Protocol Buffers [Parent]</name>

@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
</parent>
<artifactId>protobuf-java-util</artifactId>

@ -1,6 +1,6 @@
{
"name": "google-protobuf",
"version": "3.17.3",
"version": "3.18.0",
"description": "Protocol Buffers for JavaScript",
"main": "google-protobuf.js",
"files": [

@ -15,6 +15,9 @@ docker run $(test -t 0 && echo "-it") -v$PWD:/workspace gcr.io/protobuf-build/ph
docker run $(test -t 0 && echo "-it") -v$PWD:/workspace gcr.io/protobuf-build/php/linux:7.4.18-dbg-14a06550010c0649bf69b6c9b803c1ca609bbb6d "composer test && composer test_c"
docker run $(test -t 0 && echo "-it") -v$PWD:/workspace gcr.io/protobuf-build/php/linux:8.0.5-dbg-14a06550010c0649bf69b6c9b803c1ca609bbb6d "composer test && composer test_c"
# Run specialized memory leak & multirequest tests.
docker run $(test -t 0 && echo "-it") -v$PWD:/workspace gcr.io/protobuf-build/php/linux:8.0.5-dbg-14a06550010c0649bf69b6c9b803c1ca609bbb6d "composer test_c && tests/multirequest.sh && tests/memory_leak_test.sh"
# Most of our tests use a debug build of PHP, but we do one build against an opt
# php just in case that surfaces anything unexpected.
docker run $(test -t 0 && echo "-it") -v$PWD:/workspace gcr.io/protobuf-build/php/linux:8.0.5-14a06550010c0649bf69b6c9b803c1ca609bbb6d "composer test && composer test_c"

@ -37,8 +37,6 @@ build_artifact_version() {
before_install
clean_code $REPO_DIR $BUILD_COMMIT
sed -i '/Wno-sign-compare/a \ \ \ \ \ \ \ \ extra_compile_args.append("-std=c++11")' $REPO_DIR/python/setup.py
cat $REPO_DIR/python/setup.py
build_wheel $REPO_DIR/python $PLAT

@ -640,8 +640,8 @@ void Array_ModuleInit() {
repeated_field_methods);
RepeatedField_class_entry = zend_register_internal_class(&tmp_ce);
zend_class_implements(RepeatedField_class_entry, 3, spl_ce_ArrayAccess,
zend_ce_aggregate, spl_ce_Countable);
zend_class_implements(RepeatedField_class_entry, 3, zend_ce_arrayaccess,
zend_ce_aggregate, zend_ce_countable);
RepeatedField_class_entry->ce_flags |= ZEND_ACC_FINAL;
RepeatedField_class_entry->create_object = RepeatedField_create;

@ -730,45 +730,26 @@ static DescriptorPool *GetPool(const zval* this_ptr) {
return (DescriptorPool*)Z_OBJ_P(this_ptr);
}
/**
* Object handler to create an DescriptorPool.
*/
static zend_object* DescriptorPool_create(zend_class_entry *class_type) {
DescriptorPool *intern = emalloc(sizeof(DescriptorPool));
zend_object_std_init(&intern->std, class_type);
intern->std.handlers = &DescriptorPool_object_handlers;
intern->symtab = upb_symtab_new();
// Skip object_properties_init(), we don't allow derived classes.
return &intern->std;
}
/**
* Object handler to free an DescriptorPool.
*/
static void DescriptorPool_destructor(zend_object* obj) {
DescriptorPool* intern = (DescriptorPool*)obj;
if (intern->symtab) {
upb_symtab_free(intern->symtab);
}
intern->symtab = NULL;
// We can't free our underlying symtab here, because user code may create
// messages from destructors that will refer to it. The symtab will be freed
// by our RSHUTDOWN() handler in protobuf.c
zend_object_std_dtor(&intern->std);
}
void DescriptorPool_CreateWithSymbolTable(zval *zv, upb_symtab *symtab) {
ZVAL_OBJ(zv, DescriptorPool_create(DescriptorPool_class_entry));
if (symtab) {
DescriptorPool *intern = GetPool(zv);
upb_symtab_free(intern->symtab);
intern->symtab = symtab;
}
}
DescriptorPool *intern = emalloc(sizeof(DescriptorPool));
zend_object_std_init(&intern->std, DescriptorPool_class_entry);
intern->std.handlers = &DescriptorPool_object_handlers;
intern->symtab = symtab;
upb_symtab *DescriptorPool_Steal(zval *zv) {
DescriptorPool *intern = GetPool(zv);
upb_symtab *ret = intern->symtab;
intern->symtab = NULL;
return ret;
ZVAL_OBJ(zv, &intern->std);
}
upb_symtab *DescriptorPool_GetSymbolTable() {
@ -1120,7 +1101,7 @@ void Def_ModuleInit() {
DescriptorPool_methods);
DescriptorPool_class_entry = zend_register_internal_class(&tmp_ce);
DescriptorPool_class_entry->ce_flags |= ZEND_ACC_FINAL;
DescriptorPool_class_entry->create_object = DescriptorPool_create;
DescriptorPool_class_entry->create_object = CreateHandler_ReturnNull;
h = &DescriptorPool_object_handlers;
memcpy(h, &std_object_handlers, sizeof(zend_object_handlers));
h->dtor_obj = DescriptorPool_destructor;

@ -38,15 +38,10 @@
// Initializes the Def module, which defines all of the descriptor classes.
void Def_ModuleInit();
// Creates a new DescriptorPool to wrap the given symtab. The DescriptorPool
// takes ownership of the given symtab. If symtab is NULL, the DescriptorPool
// will create an empty symtab instead.
// Creates a new DescriptorPool to wrap the given symtab, which must not be
// NULL.
void DescriptorPool_CreateWithSymbolTable(zval *zv, upb_symtab *symtab);
// Given a zval representing a DescriptorPool, steals and returns its symtab,
// which is now owned by the caller.
upb_symtab *DescriptorPool_Steal(zval *zv);
upb_symtab *DescriptorPool_GetSymbolTable();
// Returns true if the global descriptor pool already has the given filename.

@ -636,8 +636,8 @@ void Map_ModuleInit() {
MapField_methods);
MapField_class_entry = zend_register_internal_class(&tmp_ce);
zend_class_implements(MapField_class_entry, 3, spl_ce_ArrayAccess,
zend_ce_aggregate, spl_ce_Countable);
zend_class_implements(MapField_class_entry, 3, zend_ce_arrayaccess,
zend_ce_aggregate, zend_ce_countable);
MapField_class_entry->ce_flags |= ZEND_ACC_FINAL;
MapField_class_entry->create_object = MapField_create;

@ -10,11 +10,11 @@
<email>protobuf-opensource@google.com</email>
<active>yes</active>
</lead>
<date>2021-06-04</date>
<time>21:17:28</time>
<date>2021-09-13</date>
<time>11:30:58</time>
<version>
<release>3.17.3</release>
<api>3.17.3</api>
<release>3.18.0</release>
<api>3.18.0</api>
</version>
<stability>
<release>stable</release>
@ -22,7 +22,7 @@
</stability>
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
<notes>
* No new changes in 3.17.2
* No new changes in 3.18.0
</notes>
<contents>
<dir baseinstalldir="/" name="/">
@ -1038,5 +1038,50 @@ G A release.
<notes>
</notes>
</release>
<release>
<version>
<release>3.18.0RC1</release>
<api>3.18.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2021-08-18</date>
<time>15:23:47</time>
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
<notes>
</notes>
</release>
<release>
<version>
<release>3.18.0RC2</release>
<api>3.18.0</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<date>2021-08-27</date>
<time>14:37:43</time>
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
<notes>
</notes>
</release>
<release>
<version>
<release>3.18.0</release>
<api>3.18.0</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<date>2021-09-13</date>
<time>11:30:58</time>
<license uri="https://opensource.org/licenses/BSD-3-Clause">3-Clause BSD License</license>
<notes>
</notes>
</release>
</changelog>
</package>

@ -66,7 +66,7 @@ ZEND_BEGIN_MODULE_GLOBALS(protobuf)
// to rebuild it from scratch. When keep_descriptor_pool_after_request==true,
// we steal the upb_symtab from the global DescriptorPool object just before
// destroying it.
upb_symtab *saved_symtab;
upb_symtab *global_symtab;
// Object cache (see interface in protobuf.h).
HashTable object_cache;
@ -82,6 +82,13 @@ ZEND_BEGIN_MODULE_GLOBALS(protobuf)
HashTable descriptors;
ZEND_END_MODULE_GLOBALS(protobuf)
void free_protobuf_globals(zend_protobuf_globals *globals) {
zend_hash_destroy(&globals->name_msg_cache);
zend_hash_destroy(&globals->name_enum_cache);
upb_symtab_free(globals->global_symtab);
globals->global_symtab = NULL;
}
ZEND_DECLARE_MODULE_GLOBALS(protobuf)
const zval *get_generated_pool() {
@ -146,14 +153,14 @@ const zval *get_generated_pool() {
// discouraged by the documentation: https://serverfault.com/a/231660
static PHP_GSHUTDOWN_FUNCTION(protobuf) {
if (protobuf_globals->saved_symtab) {
upb_symtab_free(protobuf_globals->saved_symtab);
if (protobuf_globals->global_symtab) {
free_protobuf_globals(protobuf_globals);
}
}
static PHP_GINIT_FUNCTION(protobuf) {
ZVAL_NULL(&protobuf_globals->generated_pool);
protobuf_globals->saved_symtab = NULL;
protobuf_globals->global_symtab = NULL;
}
/**
@ -164,12 +171,15 @@ static PHP_GINIT_FUNCTION(protobuf) {
static PHP_RINIT_FUNCTION(protobuf) {
// Create the global generated pool.
// Reuse the symtab (if any) left to us by the last request.
upb_symtab *symtab = PROTOBUF_G(saved_symtab);
upb_symtab *symtab = PROTOBUF_G(global_symtab);
if (!symtab) {
PROTOBUF_G(global_symtab) = symtab = upb_symtab_new();
zend_hash_init(&PROTOBUF_G(name_msg_cache), 64, NULL, NULL, 0);
zend_hash_init(&PROTOBUF_G(name_enum_cache), 64, NULL, NULL, 0);
}
DescriptorPool_CreateWithSymbolTable(&PROTOBUF_G(generated_pool), symtab);
zend_hash_init(&PROTOBUF_G(object_cache), 64, NULL, NULL, 0);
zend_hash_init(&PROTOBUF_G(name_msg_cache), 64, NULL, NULL, 0);
zend_hash_init(&PROTOBUF_G(name_enum_cache), 64, NULL, NULL, 0);
zend_hash_init(&PROTOBUF_G(descriptors), 64, NULL, ZVAL_PTR_DTOR, 0);
return SUCCESS;
@ -182,15 +192,12 @@ static PHP_RINIT_FUNCTION(protobuf) {
*/
static PHP_RSHUTDOWN_FUNCTION(protobuf) {
// Preserve the symtab if requested.
if (PROTOBUF_G(keep_descriptor_pool_after_request)) {
zval *zv = &PROTOBUF_G(generated_pool);
PROTOBUF_G(saved_symtab) = DescriptorPool_Steal(zv);
if (!PROTOBUF_G(keep_descriptor_pool_after_request)) {
free_protobuf_globals(ZEND_MODULE_GLOBALS_BULK(protobuf));
}
zval_dtor(&PROTOBUF_G(generated_pool));
zend_hash_destroy(&PROTOBUF_G(object_cache));
zend_hash_destroy(&PROTOBUF_G(name_msg_cache));
zend_hash_destroy(&PROTOBUF_G(name_enum_cache));
zend_hash_destroy(&PROTOBUF_G(descriptors));
return SUCCESS;
@ -296,7 +303,7 @@ static const zend_module_dep protobuf_deps[] = {
PHP_INI_BEGIN()
STD_PHP_INI_ENTRY("protobuf.keep_descriptor_pool_after_request", "0",
PHP_INI_SYSTEM, OnUpdateBool,
PHP_INI_ALL, OnUpdateBool,
keep_descriptor_pool_after_request, zend_protobuf_globals,
protobuf_globals)
PHP_INI_END()

@ -52,7 +52,7 @@ const zval *get_generated_pool();
#define PROTO_RETURN_VAL zval*
#endif
// Sine php 8.0, the Object Handlers API was changed to receive zend_object*
// Since php 8.0, the Object Handlers API was changed to receive zend_object*
// instead of zval* and zend_string* instead of zval* for property names.
// https://github.com/php/php-src/blob/php-8.0.0beta1/UPGRADING.INTERNALS#L37-L39
#if PHP_VERSION_ID < 80000
@ -74,6 +74,16 @@ const zval *get_generated_pool();
#define PROTO_STRLEN_P(obj) ZSTR_LEN(obj)
#endif
// In PHP 8.1, several old interfaces are removed:
// https://github.com/php/php-src/blob/14f599ea7def7c7a59c40aff763ce8b105573e7a/UPGRADING.INTERNALS#L27-L31
//
// We now use the new interfaces (zend_ce_arrayaccess and zend_ce_countable).
// However we have to polyfill zend_ce_countable, which was only introduced in
// PHP 7.2.0.
#if PHP_VERSION_ID < 70200
#define zend_ce_countable spl_ce_Countable
#endif
ZEND_BEGIN_ARG_INFO(arginfo_void, 0)
ZEND_END_ARG_INFO()
@ -81,7 +91,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_setter, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
#define PHP_PROTOBUF_VERSION "3.17.3"
#define PHP_PROTOBUF_VERSION "3.18.0"
// ptr -> PHP object cache. This is a weak map that caches lazily-created
// wrapper objects around upb types:

@ -565,7 +565,7 @@ class GeneratedClassTest extends TestBase
$m->setMapInt32Int32($dict);
$this->assertSame(0, count($m->getMapInt32Int32()));
$dict = array(5 => 5, 6.1 => 6.1, "7" => "7");
$dict = array(5 => 5, 6 => 6.1, "7" => "7");
$m->setMapInt32Int32($dict);
$this->assertTrue($m->getMapInt32Int32() instanceof MapField);
$this->assertSame(3, count($m->getMapInt32Int32()));

@ -2,9 +2,22 @@
# phpunit has memory leak by itself. Thus, it cannot be used to test memory leak.
class HasDestructor
{
function __construct() {
$this->foo = $this;
}
function __destruct() {
new Foo\TestMessage();
}
}
require_once('../vendor/autoload.php');
require_once('test_util.php');
$has_destructor = new HasDestructor();
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBType;
use Foo\TestAny;

@ -0,0 +1,40 @@
#!/bin/bash
cd $(dirname $0)
set -ex
PORT=12345
TIMEOUT=10
./compile_extension.sh
run_test() {
echo
echo "Running memory leak test, args: $@"
EXTRA_ARGS=""
ARGS="-d xdebug.profiler_enable=0 -d display_errors=on -dextension=../ext/google/protobuf/modules/protobuf.so"
for i in "$@"; do
case $i in
--keep_descriptors)
EXTRA_ARGS=-dprotobuf.keep_descriptor_pool_after_request=1
shift
;;
esac
done
export ZEND_DONT_UNLOAD_MODULES=1
export USE_ZEND_ALLOC=0
if valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --suppressions=valgrind.supp --num-callers=100 php $ARGS $EXTRA_ARGS memory_leak_test.php; then
echo "Memory leak test SUCCEEDED"
else
echo "Memory leak test FAILED"
exit 1
fi
}
run_test
run_test --keep_descriptors

@ -5,28 +5,58 @@ cd $(dirname $0)
set -e
PORT=12345
TIMEOUT=10
./compile_extension.sh
nohup php -d protobuf.keep_descriptor_pool_after_request=1 -dextension=../ext/google/protobuf/modules/protobuf.so -S localhost:$PORT multirequest.php 2>&1 &
sleep 1
wget http://localhost:$PORT/multirequest.result -O multirequest.result
wget http://localhost:$PORT/multirequest.result -O multirequest.result
pushd ../ext/google/protobuf
phpize --clean
popd
PID=`ps | grep "php" | awk '{print $1}'`
echo $PID
if [[ -z "$PID" ]]
then
echo "Failed"
exit 1
else
kill $PID
echo "Succeeded"
fi
run_test() {
echo
echo "Running multirequest test, args: $@"
RUN_UNDER=""
EXTRA_ARGS=""
ARGS="-d xdebug.profiler_enable=0 -d display_errors=on -dextension=../ext/google/protobuf/modules/protobuf.so"
for i in "$@"; do
case $i in
--valgrind)
RUN_UNDER="valgrind --error-exitcode=1"
shift
;;
--keep_descriptors)
EXTRA_ARGS=-dprotobuf.keep_descriptor_pool_after_request=1
shift
;;
esac
done
export ZEND_DONT_UNLOAD_MODULES=1
export USE_ZEND_ALLOC=0
rm -f nohup.out
nohup $RUN_UNDER php $ARGS $EXTRA_ARGS -S localhost:$PORT multirequest.php >nohup.out 2>&1 &
PID=$!
if ! timeout $TIMEOUT bash -c "until echo > /dev/tcp/localhost/$PORT; do sleep 0.1; done" > /dev/null 2>&1; then
echo "Server failed to come up after $TIMEOUT seconds"
cat nohup.out
exit 1
fi
seq 2 | xargs -I{} wget -nv http://localhost:$PORT/multirequest.result -O multirequest{}.result
REQUESTS_SUCCEEDED=$?
if kill $PID > /dev/null 2>&1 && [[ $REQUESTS_SUCCEEDED == "0" ]]; then
wait
echo "Multirequest test SUCCEEDED"
else
echo "Multirequest test FAILED"
cat nohup.out
exit 1
fi
}
run_test
run_test --keep_descriptors
run_test --valgrind
run_test --valgrind --keep_descriptors

@ -10,3 +10,24 @@
obj:/usr/bin/php7.3
fun:__scandir64_tail
}
{
PHP_ModuleLoadingLeaks
Memcheck:Leak
...
fun:php_module_startup
}
{
PHP_ModuleLoadingLeaks
Memcheck:Leak
...
fun:php_module_startup
}
{
PHP_ModuleLoadingLeaks2
Memcheck:Leak
...
fun:php_load_shlib
}

@ -1 +1 @@
PROTOBUF_VERSION = '3.17.3'
PROTOBUF_VERSION = '3.18.0'

@ -8,7 +8,7 @@
</parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protoc</artifactId>
<version>3.17.3</version>
<version>3.18.0</version>
<packaging>pom</packaging>
<name>Protobuf Compiler</name>
<description>

@ -15,3 +15,5 @@ global-exclude *.dll
global-exclude *.pyc
global-exclude *.pyo
global-exclude *.so
include LICENSE

@ -30,4 +30,4 @@
# Copyright 2007 Google Inc. All Rights Reserved.
__version__ = '3.17.3'
__version__ = '3.18.0'

@ -73,6 +73,9 @@ else
sed -i -r "s/__version__ = '.*'/__version__ = '${VERSION}.${DEV}'/" python/google/protobuf/__init__.py
fi
# Copy LICENSE
cp LICENSE python/LICENSE
cd python
# Run tests locally.

@ -61,7 +61,7 @@ unless ENV['IN_DOCKER'] == 'true'
output_file = proto_file.sub(/\.proto$/, "_pb.rb")
genproto_output << output_file
file output_file => proto_file do |file_task|
sh "#{protoc_command} -I../src -I. --ruby_out=. #{proto_file}"
sh "#{protoc_command} -I../src -I. -I./tests --ruby_out=. #{proto_file}"
end
end
end

@ -551,6 +551,7 @@ VALUE RepeatedField_plus(VALUE _self, VALUE list) {
RepeatedField* dupped = ruby_to_RepeatedField(dupped_);
upb_array *dupped_array = RepeatedField_GetMutable(dupped_);
upb_arena* arena = Arena_get(dupped->arena);
Arena_fuse(list_rptfield->arena, arena);
int size = upb_array_size(list_rptfield->array);
int i;

@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "google-protobuf"
s.version = "3.17.3"
s.version = "3.18.0"
git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag
s.licenses = ["BSD-3-Clause"]
s.summary = "Protocol Buffers"

@ -301,8 +301,8 @@ module Google
internal_add_field(:LABEL_REQUIRED, name, type, number, type_class, options)
end
def repeated(name, type, number, type_class = nil)
internal_add_field(:LABEL_REPEATED, name, type, number, type_class, nil)
def repeated(name, type, number, type_class = nil, options=nil)
internal_add_field(:LABEL_REPEATED, name, type, number, type_class, options)
end
def oneof(name, &block)

@ -168,6 +168,17 @@ module BasicTest
assert_equal nil, m.singular_msg
end
def test_import_proto2
m = TestMessage.new
assert !m.has_optional_proto2_submessage?
m.optional_proto2_submessage = ::FooBar::Proto2::TestImportedMessage.new
assert m.has_optional_proto2_submessage?
assert TestMessage.descriptor.lookup('optional_proto2_submessage').has?(m)
m.clear_optional_proto2_submessage
assert !m.has_optional_proto2_submessage?
end
def test_clear_repeated_fields
m = TestMessage.new
@ -487,6 +498,7 @@ module BasicTest
:optional_int64=>0,
:optional_msg=>nil,
:optional_msg2=>nil,
:optional_proto2_submessage=>nil,
:optional_string=>"foo",
:optional_uint32=>0,
:optional_uint64=>0,

@ -6,6 +6,7 @@ import "google/protobuf/wrappers.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "test_import_proto2.proto";
message Foo {
Bar bar = 1;
@ -32,6 +33,7 @@ message TestMessage {
optional bytes optional_bytes = 9;
optional TestMessage2 optional_msg = 10;
optional TestEnum optional_enum = 11;
optional foo_bar.proto2.TestImportedMessage optional_proto2_submessage = 24;
repeated int32 repeated_int32 = 12;
repeated int64 repeated_int64 = 13;
@ -208,3 +210,8 @@ message MyStruct {
string string = 1;
google.protobuf.Struct struct = 2;
}
message WithJsonName {
optional int32 foo_bar = 1 [json_name="jsonFooBar"];
repeated WithJsonName baz = 2 [json_name="jsonBaz"];
}

@ -18,7 +18,7 @@ else
PTHREAD_DEF =
endif
PROTOBUF_VERSION = 28:3:0
PROTOBUF_VERSION = 29:0:0
if GCC
# Turn on all warnings except for sign comparison (we ignore sign comparison
@ -541,6 +541,7 @@ EXTRA_DIST = \
google/protobuf/compiler/package_info.h \
google/protobuf/compiler/ruby/ruby_generated_code.proto \
google/protobuf/compiler/ruby/ruby_generated_code_pb.rb \
google/protobuf/compiler/ruby/ruby_generated_code_proto2_import.proto \
google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto \
google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb \
google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto \

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -2,6 +2,8 @@ syntax = "proto3";
package A.B.C;
import "ruby_generated_code_proto2_import.proto";
message TestMessage {
int32 optional_int32 = 1;
int64 optional_int64 = 2;
@ -14,6 +16,7 @@ message TestMessage {
bytes optional_bytes = 9;
TestEnum optional_enum = 10;
TestMessage optional_msg = 11;
TestImportedMessage optional_proto2_submessage = 12;
repeated int32 repeated_int32 = 21;
repeated int64 repeated_int64 = 22;

@ -1,6 +1,7 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ruby_generated_code.proto
require 'ruby_generated_code_proto2_import_pb'
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
@ -17,6 +18,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :optional_bytes, :bytes, 9
optional :optional_enum, :enum, 10, "A.B.C.TestEnum"
optional :optional_msg, :message, 11, "A.B.C.TestMessage"
optional :optional_proto2_submessage, :message, 12, "A.B.C.TestImportedMessage"
repeated :repeated_int32, :int32, 21
repeated :repeated_int64, :int64, 22
repeated :repeated_uint32, :uint32, 23

@ -2,6 +2,8 @@ syntax = "proto2";
package A.B.C;
import "ruby_generated_code_proto2_import.proto";
message TestMessage {
optional int32 optional_int32 = 1 [default = 1];
optional int64 optional_int64 = 2 [default = 2];
@ -14,6 +16,7 @@ message TestMessage {
optional bytes optional_bytes = 9 [default = "\0\1\2\100fubar"];
optional TestEnum optional_enum = 10 [default = A];
optional TestMessage optional_msg = 11;
optional TestImportedMessage optional_proto2_submessage = 12;
repeated int32 repeated_int32 = 21;
repeated int64 repeated_int64 = 22;

@ -0,0 +1,5 @@
syntax = "proto2";
package A.B.C;
message TestImportedMessage {}

@ -1,6 +1,7 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: ruby_generated_code_proto2.proto
require 'ruby_generated_code_proto2_import_pb'
require 'google/protobuf'
Google::Protobuf::DescriptorPool.generated_pool.build do
@ -17,6 +18,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :optional_bytes, :bytes, 9, default: "\x00\x01\x02\x40\x66\x75\x62\x61\x72".force_encoding("ASCII-8BIT")
optional :optional_enum, :enum, 10, "A.B.C.TestEnum", default: 1
optional :optional_msg, :message, 11, "A.B.C.TestMessage"
optional :optional_proto2_submessage, :message, 12, "A.B.C.TestImportedMessage"
repeated :repeated_int32, :int32, 21
repeated :repeated_int64, :int64, 22
repeated :repeated_uint32, :uint32, 23

@ -490,43 +490,6 @@ bool UsesTypeFromFile(const Descriptor* message, const FileDescriptor* file,
return false;
}
// Ruby doesn't currently support proto2. This causes a failure even for proto3
// files that import proto2. But in some cases, the proto2 file is only being
// imported to extend another proto2 message. The prime example is declaring
// custom options by extending FileOptions/FieldOptions/etc.
//
// If the proto3 messages don't have any proto2 submessages, it is safe to omit
// the dependency completely. Users won't be able to use any proto2 extensions,
// but they already couldn't because proto2 messages aren't supported.
//
// If/when we add proto2 support, we should remove this.
bool MaybeEmitDependency(const FileDescriptor* import,
const FileDescriptor* from,
io::Printer* printer,
std::string* error) {
if (from->syntax() == FileDescriptor::SYNTAX_PROTO3 &&
import->syntax() == FileDescriptor::SYNTAX_PROTO2) {
for (int i = 0; i < from->message_type_count(); i++) {
if (UsesTypeFromFile(from->message_type(i), import, error)) {
// Error text was already set by UsesTypeFromFile().
return false;
}
}
// Ok to omit this proto2 dependency -- so we won't print anything.
GOOGLE_LOG(WARNING) << "Omitting proto2 dependency '" << import->name()
<< "' from proto3 output file '"
<< GetOutputFilename(from->name())
<< "' because we don't support proto2 and no proto2 "
"types from that file are being used.";
return true;
} else {
printer->Print(
"require '$name$'\n", "name", GetRequireName(import->name()));
return true;
}
}
bool GenerateDslDescriptor(const FileDescriptor* file, io::Printer* printer,
std::string* error) {
printer->Print(
@ -572,9 +535,7 @@ bool GenerateFile(const FileDescriptor* file, io::Printer* printer,
"filename", file->name());
for (int i = 0; i < file->dependency_count(); i++) {
if (!MaybeEmitDependency(file->dependency(i), file, printer, error)) {
return false;
}
printer->Print("require '$name$'\n", "name", GetRequireName(file->dependency(i)->name()));
}
// TODO: Remove this when ruby supports extensions for proto2 syntax.

@ -57,7 +57,7 @@ std::string FindRubyTestDir() {
// Some day, we may integrate build systems between protoc and the language
// extensions to the point where we can do this test in a more automated way.
void RubyTest(string proto_file) {
void RubyTest(string proto_file, string import_proto_file = "") {
std::string ruby_tests = FindRubyTestDir();
google::protobuf::compiler::CommandLineInterface cli;
@ -77,9 +77,23 @@ void RubyTest(string proto_file) {
test_input,
true));
// Copy generated_code_import.proto to the temporary test directory.
std::string test_import;
if (!import_proto_file.empty()) {
GOOGLE_CHECK_OK(File::GetContents(
ruby_tests + import_proto_file + ".proto",
&test_import,
true));
GOOGLE_CHECK_OK(File::SetContents(
TestTempDir() + import_proto_file + ".proto",
test_import,
true));
}
// Invoke the proto compiler (we will be inside TestTempDir() at this point).
std::string ruby_out = "--ruby_out=" + TestTempDir();
std::string proto_path = "--proto_path=" + TestTempDir();
std::string proto_target = TestTempDir() + proto_file + ".proto";
const char* argv[] = {
"protoc",
@ -105,11 +119,11 @@ void RubyTest(string proto_file) {
}
TEST(RubyGeneratorTest, Proto3GeneratorTest) {
RubyTest("/ruby_generated_code");
RubyTest("/ruby_generated_code", "/ruby_generated_code_proto2_import");
}
TEST(RubyGeneratorTest, Proto2GeneratorTest) {
RubyTest("/ruby_generated_code_proto2");
RubyTest("/ruby_generated_code_proto2", "/ruby_generated_code_proto2_import");
}
TEST(RubyGeneratorTest, Proto3ImplicitPackageTest) {

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -354,7 +354,7 @@ DynamicMessage::DynamicMessage(DynamicMessageFactory::TypeInfo* type_info,
SharedCtor(lock_factory);
}
void* DynamicMessage::MutableRaw(int i) {
inline void* DynamicMessage::MutableRaw(int i) {
return OffsetToPointer(
OffsetValue(type_info_->offsets[i], type_info_->type->field(i)->type()));
}

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -153,17 +153,17 @@
#ifdef PROTOBUF_VERSION
#error PROTOBUF_VERSION was previously defined
#endif
#define PROTOBUF_VERSION 3017003
#define PROTOBUF_VERSION 3018000
#ifdef PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC
#error PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC was previously defined
#endif
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3017000
#define PROTOBUF_MIN_HEADER_VERSION_FOR_PROTOC 3018000
#ifdef PROTOBUF_MIN_PROTOC_VERSION
#error PROTOBUF_MIN_PROTOC_VERSION was previously defined
#endif
#define PROTOBUF_MIN_PROTOC_VERSION 3017000
#define PROTOBUF_MIN_PROTOC_VERSION 3018000
#ifdef PROTOBUF_VERSION_SUFFIX
#error PROTOBUF_VERSION_SUFFIX was previously defined
@ -356,7 +356,7 @@
// The minimum library version which works with the current version of the
// headers.
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3017000
#define GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION 3018000
#ifdef PROTOBUF_RTTI
#error PROTOBUF_RTTI was previously defined

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -82,7 +82,7 @@ namespace internal {
// The current version, represented as a single integer to make comparison
// easier: major * 10^6 + minor * 10^3 + micro
#define GOOGLE_PROTOBUF_VERSION 3017003
#define GOOGLE_PROTOBUF_VERSION 3018000
// A suffix string for alpha, beta or rc releases. Empty for stable releases.
#define GOOGLE_PROTOBUF_VERSION_SUFFIX ""
@ -90,15 +90,15 @@ namespace internal {
// The minimum header version which works with the current version of
// the library. This constant should only be used by protoc's C++ code
// generator.
static const int kMinHeaderVersionForLibrary = 3017000;
static const int kMinHeaderVersionForLibrary = 3018000;
// The minimum protoc version which works with the current version of the
// headers.
#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3017000
#define GOOGLE_PROTOBUF_MIN_PROTOC_VERSION 3018000
// The minimum header version which works with the current version of
// protoc. This constant should only be used in VerifyVersion().
static const int kMinHeaderVersionForProtoc = 3017000;
static const int kMinHeaderVersionForProtoc = 3018000;
// Verifies that the headers and libraries are compatible. Use the macro
// below to call this.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -8,12 +8,12 @@
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3017000
#if PROTOBUF_VERSION < 3018000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3017003 < PROTOBUF_MIN_PROTOC_VERSION
#if 3018000 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.

@ -31,7 +31,7 @@ def _impl(ctx):
tool_paths = [
tool_path(
name = "gcc",
path = "/usr/bin/clang",
path = "/usr/local/bin/clang",
),
tool_path(
name = "ld",

Loading…
Cancel
Save