Commit Graph

8076 Commits

Author SHA1 Message Date
Florian Simon
a4e7b97bd6 Create a CMake option to control whether or not RTTI is enabled
This is useful for Conan recipes that build Protobuf, in which
whatever we want to enable has to be enabled in the initial command line.
Without this, the people maintaining the recipe have to patch the CMake
setup of Protobuf before building the binaries.

Closes #5541
2021-03-02 11:09:28 -08:00
Anton Danielsson
630028a4c6 Fix cmake install on iOS
Fixes:
INSTALL TARGETS given no BUNDLE DESTINATION for MACOSX_BUNDLE executable
2021-03-01 17:32:31 -08:00
Romain Geissler
9d203953a9 Fix gcc error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
This fixes the following build error:
In file included from no_warning_test.cc:7:
../../src/google/protobuf/parse_context.h: In instantiation of 'const char* google::protobuf::internal::EpsCopyInputStream::AppendUntilEnd(const char*, const A&) [with A = google::protobuf::internal::EpsCopyInputStream::AppendString(const char*, std::string*)::<lambda(const char*, ptrdiff_t)>]':
../../src/google/protobuf/parse_context.h:366:70:   required from here
../../src/google/protobuf/stubs/logging.h:161:48: error: comparison of unsigned expression in '>= 0' is always true [-Werror=type-limits]
  161 | #define GOOGLE_CHECK_GE(A, B) GOOGLE_CHECK((A) >= (B))
      |                                                ^
../../src/google/protobuf/stubs/logging.h:151:5: note: in definition of macro 'GOOGLE_LOG_IF'
  151 |   !(CONDITION) ? (void)0 : GOOGLE_LOG(LEVEL)
      |     ^~~~~~~~~
../../src/google/protobuf/stubs/logging.h:161:31: note: in expansion of macro 'GOOGLE_CHECK'
  161 | #define GOOGLE_CHECK_GE(A, B) GOOGLE_CHECK((A) >= (B))
      |                               ^~~~~~~~~~~~
../../src/google/protobuf/stubs/logging.h:201:26: note: in expansion of macro 'GOOGLE_CHECK_GE'
  201 | #define GOOGLE_DCHECK_GE GOOGLE_CHECK_GE
      |                          ^~~~~~~~~~~~~~~
../../src/google/protobuf/parse_context.h:351:7: note: in expansion of macro 'GOOGLE_DCHECK_GE'
  351 |       GOOGLE_DCHECK_GE(chunk_size, static_cast<size_t>(0));
      |       ^~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
2021-03-01 16:38:00 -08:00
Yannic
88367afa1f
[C++] Delete StringPiecePod (#8353)
Protobuf no longer supports C++ < 11, so this type is no longer
required.
2021-03-01 16:29:00 -08:00
Yuriy Chernyshov
e9091e6d8c
Fix some constness / char literal issues being found by MSVC standard conforming mode (#8344)
* Fix some constness / char literal issues being found by MSVC standard conforming mode

* Switch to const_cast from C-style casts
2021-03-01 12:59:39 -08:00
Joshua Haberman
f645c7ed07 Fixed spelling errors surfaced by CodeSpell. 2021-02-26 10:54:13 -08:00
Joshua Haberman
d6f0c9b187 Updated changelog. 2021-02-26 10:45:41 -08:00
Joshua Haberman
899c276248 Merge tag 'refs/tags/sync-piper' into sync-stage 2021-02-26 10:37:38 -08:00
Joshua Haberman
9df42757f9 Sync from Piper @359788468
PROTOBUF_SYNC_PIPER
2021-02-26 10:37:37 -08:00
Adam Cozzette
8080bebf1f
Merge pull request #8348 from acozzette/3.15.x-202102251545
Merge 3.15.x into master
2021-02-25 17:02:41 -08:00
Adam Cozzette
e54403190b Merge branch '3.15.x' into 3.15.x-202102251545 2021-02-25 15:54:09 -08:00
Adam Cozzette
983d115bd9 Update protobuf version 2021-02-25 09:20:20 -08:00
Adam Cozzette
eb542e606b Updated CHANGES.txt for 3.15.3 release 2021-02-25 09:19:24 -08:00
Joshua Haberman
80ec787928
Merge pull request #8341 from haberman/ruby-2.5-gc
Ruby <2.7now uses WeakMap too, which prevents memory leaks.
2021-02-24 17:49:02 -08:00
Adam Cozzette
a6c28fb207
Merge pull request #8338 from acozzette/3.15.x-202102231541
Merge 3.15.x into master
2021-02-24 16:46:27 -08:00
Joshua Haberman
9879f423ff Ruby <2.7now uses WeakMap too, which prevents memory leaks.
Ruby <2.7 does not allow non-finalizable objects to be WeakMap
keys: https://bugs.ruby-lang.org/issues/16035

We work around this by using a secondary map for Ruby <2.7 which
maps the non-finalizable integer to a distinct object.

For now we accept that the entries in the secondary map wil never
be collected.  If this becomes a problem we can perform a GC pass
every so often that looks at the contents of the object cache to
decide what can be deleted from the secondary map.
2021-02-24 16:41:35 -08:00
Adam Cozzette
d8254a67ce Merge branch '3.15.x' into 3.15.x-202102231541 2021-02-23 15:51:34 -08:00
Adam Cozzette
d7e943b8d2 Update protobuf version 2021-02-23 13:21:42 -08:00
Adam Cozzette
1af4657b80 Updated CHANGES.txt 2021-02-23 13:21:42 -08:00
Yuriy Chernyshov
09f94e7311 Fix PROTOBUF_CONSTINIT macro redifinition
The #ifdef block is duplicated with the above (which was fixed in 3.15.1).

It would be great to have this fix backported to 3.15.1 (and released as 3.15.2).
2021-02-23 13:21:27 -08:00
Adam Cozzette
a43ddfbd56
Merge pull request #8323 from georgthegreat/patch-1
Fix PROTOBUF_CONSTINIT macro redefinition
2021-02-23 11:20:03 -08:00
Joshua Haberman
2ff31d34aa
Merge pull request #8330 from haberman/rubyfix
[Ruby] Fix for FieldDescriptor.get(msg).
2021-02-22 18:19:44 -08:00
Joshua Haberman
4e3ea74e42 [Ruby] Fix for FieldDescriptor.get(msg).
This fix is similar to the previous bug found in
Message.[]. The fix is the same: we need to handle
arrays and maps properly.

Fixes: https://github.com/protocolbuffers/protobuf/issues/8325
2021-02-22 17:14:46 -08:00
Adam Cozzette
326ea555ba
Merge pull request #8329 from acozzette/merge-3-15-x
Merge 3.15.x into master
2021-02-22 12:29:27 -08:00
Adam Cozzette
6e84adc9ff Merge branch '3.15.x' into merge-3-15-x 2021-02-22 11:03:32 -08:00
Thomas Van Lenten
5911099659 Move the class map to a CFDictionary.
Since the keys are `Class`-s, there's no need to hash/copy/etc. them. This
avoids causing `+initialize` on the classes just when building up a registry.
2021-02-22 13:08:32 -05:00
Yuriy Chernyshov
2e47e3bc64
Fix PROTOBUF_CONSTINIT macro redifinition
The #ifdef block is duplicated with the above (which was fixed in 3.15.1).

It would be great to have this fix backported to 3.15.1 (and released as 3.15.2).
2021-02-20 12:09:52 +03:00
Adam Cozzette
052dc799d2 Update protobuf version 2021-02-19 15:12:24 -08:00
Adam Cozzette
24d8a554ea Updated CHANGES.txt 2021-02-19 15:12:24 -08:00
Adam Cozzette
d721e36ecc Made some small fixes for MinGW and for C++20 with GCC
Our use of constinit does not seem to work with GCC yet (see
https://github.com/protocolbuffers/protobuf/issues/8310), so this
commit disables it on GCC for now.

This commit also updates mutex.h to work around the fact that MinGW's
std::mutex apparently does not have a constexpr constructor. We already
have this kind of workaround for MSVC, so we can just use the same
workaround.
2021-02-19 15:11:34 -08:00
Joshua Haberman
b12ab0cf53
Merge pull request #8320 from haberman/ruby-duration-fix
[Ruby] Fix for truncating behavior when converting Float to Duration.
2021-02-19 15:03:42 -08:00
Joshua Haberman
3b3aac95a6 [Ruby] Fix for truncating behavior when converting Float to Duration. 2021-02-19 13:58:19 -08:00
Elliotte Rusty Harold
947e2e189a
deps: update JUnit and Truth 2021-02-19 21:36:09 +00:00
Joshua Haberman
4f961c8a70
Merge pull request #8313 from haberman/ruby-crash-fix
[Ruby] Bugfix for Message.[] for repeated or map fields.
2021-02-19 10:15:59 -08:00
Joshua Haberman
256f1327ea [Ruby] Bugfix for Message.[] for repeated or map fields. 2021-02-19 09:29:06 -08:00
Adam Cozzette
133e5e7526 Update protobuf version 2021-02-18 16:53:24 -08:00
Adam Cozzette
de701c660b Update protobuf version 2021-02-18 16:53:24 -08:00
Adam Cozzette
ea2412e6ed Updated collect_all_artifacts.sh for Ubuntu Xenial 2021-02-18 16:53:24 -08:00
Adam Cozzette
0533d042b3 Delete root-owned files in Kokoro builds
Some of our Kokoro builds have been failing because Kokoro is unable to
copy root-owned files when the build is complete. This commit fixes the
problem by deleting these files at the end.
2021-02-18 16:53:24 -08:00
Joshua Haberman
3722935054 Added to the changelog entries for Ruby & PHP. 2021-02-18 16:53:24 -08:00
Adam Cozzette
8aa0063bef Updated collect_all_artifacts.sh to avoid installing apt-transport-https
The installation of apt-transport-https is failing and causing this
script to exit early. I suspect the package is no longer needed since
recent versions have moved it into the apt package, so this change
updates the script to stop trying to install apt-transport-https.
2021-02-18 16:53:24 -08:00
Joshua Haberman
a94870872c Added more information to "file already loaded" warning.
Also changed it to zend_error() so it is more easily suppressed.
2021-02-18 16:53:24 -08:00
Adam Cozzette
76bfd89090 Added PHP changes for 3.15.0 into package.xml 2021-02-18 16:53:24 -08:00
Adam Cozzette
983ea052ce Updated CHANGES.txt for the 3.15.0 release 2021-02-18 16:53:24 -08:00
Adam Cozzette
ac9218c5d9 Update protobuf version 2021-02-18 16:53:24 -08:00
Adam Cozzette
ae50d9b990 Update protobuf version 2021-02-18 11:50:15 -08:00
Christopher Hunt
c908fdbd0c
Some doc on AOT compilation and protobuf (#8294)
* Create jvm_native_images.md

Some initial text pertaining to the use of protobuf with AOT compilation tools such as the one provided by GraalVM native-image.

* Update jvm_native_images.md

Fixed spelling

* Update and rename jvm_native_images.md to jvm_aot.md
2021-02-17 16:10:42 -08:00
Adam Cozzette
8260126500 Update protobuf version 2021-02-17 10:51:33 -08:00
Yuhanun Citgez
c741c46604 Resovled issue in the .pb.cc files 2021-02-17 10:51:21 -08:00
Yuhanun Citgez
eef276412e Resolved an issue where NO_DESTROY and CONSTINIT were in incorrect order 2021-02-17 10:51:21 -08:00