Commit graph

4328 commits

Author SHA1 Message Date
Thomas Van Lenten
7d758c00bc Remove the use of dispatch_once that is heap backed.
Apple recently updated the docs on dispatch_once to point out
that the storage for the dispatch_once_t must be static or global,
but not something that was ever used before as the implementation
doesn't use a memory barrier.  So we drop the use and create the
semaphore when needed and use an atomic swap deal with any
threading races.
2017-04-04 10:17:52 -07:00
Adam Cozzette
4f44a0f4bb Merge pull request #2856 from acozzette/3.2.x
Incremented gem version to 3.2.0.2
2017-03-16 09:16:52 -07:00
Adam Cozzette
74aaca63ba Incremented gem version to 3.2.0.2
This version is to push a fix for gems containing files that were not
world-readable as they should be (issue #2853).
2017-03-15 10:11:24 -07:00
Adam Cozzette
3491ebd05e Merge pull request #2831 from acozzette/ruby-cherry-pick
Cherry-picked Ruby fix and incremented version number
2017-03-14 10:12:51 -07:00
Adam Cozzette
08e4ef3c07 Incremented Ruby version number to 3.2.0.1 2017-03-10 10:44:24 -08:00
Adam Cozzette
a7e05be8ec Ruby: wrap calls to memcpy so that gem is compatible with pre-2.14 glibc
This commit adds a __wrap_memcpy function and a linker flag to use that
in place of memcpy for our Ruby gem C extension. This allows us to
always use the 2.2.5 version of memcpy, making it possible to use the
gem on distributions with pre-2.14 versions of glibc.

Before this change:
$ objdump -T protobuf_c.so | grep memcpy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.4 __memcpy_chk
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.14  memcpy

After:
$ objdump -T protobuf_c.so | grep memcpy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.2.5 memcpy
0000000000000000      DF *UND*  0000000000000000  GLIBC_2.3.4 __memcpy_chk
0000000000042450 g    DF .text  0000000000000005  Base __wrap_memcpy

This is based on gRPC's solution to a similar problem:
5098508d2d/src/core/lib/support/wrap_memcpy.c

This fixes issue #2783.
2017-03-09 15:28:48 -08:00
Sergio Campamá
cc99e1293c Disable static analyzer for message semaphore creation (#2748)
Disable static analyzer for message semaphore creation
2017-03-03 10:14:44 -08:00
Thomas Van Lenten
4020fe427c Handing threading race resolving methods.
- Don't prune the extension registry as that can lead to failures when two
  threads are racing.
- If adding the method fails, check and see if it already is bound to decide
  the return result. Deals with threading races binding the methods.
2017-03-03 10:13:22 -08:00
Thomas Van Lenten
fa925b9893 Improve support for plugin parameters.
--[name]_opt support depended on the plugin being register, and didn't support
working with just --[name]_out directive (where the plugin is found via the
users PATH. This extends the command line handing to allow --[name]_out to
be all it takes for the _opt directive to also be supported.

Fixes https://github.com/google/protobuf/issues/2712
2017-02-14 12:26:47 -08:00
Adam Cozzette
32886f1f85 Merge pull request #2706 from podsvirov/cm-js-embed
Fix libprotoc.cmake to generate well_known_types_embed.cc
2017-02-14 07:50:22 -08:00
Joshua Haberman
d47fb8d69e Merge pull request #2675 from haberman/ruby24
Ruby: build packages for Ruby 2.4.
2017-02-13 14:46:30 -08:00
Joshua Haberman
82c7017891 Merge branch '3.2.x' into ruby24 2017-02-13 14:19:37 -08:00
Josh Haberman
f276479860 Ruby: update Gemspec. 2017-02-13 14:16:38 -08:00
Konstantin Podsvirov
750cda35e6 Fix libprotoc.cmake to generate well_known_types_embed.cc
Unfortunate typo. Just one extra ',' symbol, has led to the hidden implicit behavior.

Now everything will be fine.
2017-02-11 05:57:41 +03:00
Paul Yang
124a2f6dbc Add fixed version to phpunit used in travis (#2673) 2017-02-08 15:46:45 -08:00
Paul Yang
2edf2bdebf Bug fix: When encoding, negative int32 values should be padded to int64 (#2660)
in order to be wire compatible.
2017-02-07 21:33:28 -08:00
Josh Haberman
5adf493bf6 Ruby: build packages for Ruby 2.4. 2017-02-06 13:03:20 -08:00
Thomas Van Lenten
c7f4c7bc41 Merge pull request #2654 from TeBoring/3.2.x
Cherry-pick Objc changes
2017-02-02 14:14:42 -05:00
Sergio Campama
e3583877ac Adds nullability modifiers to resolve Xcode 8.3 warnings 2017-01-31 13:56:48 -08:00
Thomas Van Lenten
4aa2e9312e Timestamp helper fix, Duration helper cleanup.
- The Timestamp proto does not allow for negative nanos fields, so the seconds
  must be shifted and a positive nanos then applied.
- Tweak the helpers on Duration to make it clear there is no "base" time
  involved.
- Update the unittests for duration and timestamp to cover positive and
  negative NSTimeIntervals and what their impact is on the protos.
2017-01-31 13:56:29 -08:00
Bo Yang
593e917c17 Bump version number to 3.2.0 2017-01-27 15:03:40 -08:00
Orion Poplawski
2c8346a259 Fix typo that breaks builds on big-endian (#2632) 2017-01-26 14:14:34 -08:00
davidair
d1f0939a42 Reverting deployment target to 7.0 (#2618)
The Protobuf library doesn’t require the 7.1 deployment target so
reverting it back to 7.0
2017-01-24 13:35:51 -08:00
Joshua Haberman
d9668797a2 Update upb, fixes some bugs (including a hash table problem). (#2611)
* Update upb, fixes some bugs (including a hash table problem).

* Ruby: added a test for the previous hash table corruption.

Verified that this triggers the bug in the currently released
version.

* Ruby: bugfix for SEGV.

* Ruby: removed old code for dup'ing defs.
2017-01-23 11:43:57 -08:00
Bo Yang
be83f46b67 Update php README 2017-01-20 12:05:40 -08:00
Bo Yang
b22c6b090f Update change logs for 3.2.0 release. 2017-01-20 12:02:05 -08:00
Bo Yang
6eeb5c7d0f Update version number to 3.2.0rc2 2017-01-18 15:14:38 -08:00
Bo Yang
3e51b3d4b6 Change protoc-artifacts version to 3.2.0-rc.1 2017-01-12 11:00:53 -08:00
Paul Yang
5750146bd6 Update version number to 3.2.0-rc.1 (#2578) 2017-01-11 21:56:54 +00:00
Bo Yang
4447637bf7 Remove redundent embed.cc from src/Makefile.am 2017-01-10 13:20:16 -08:00
Adam Cozzette
790fc9387c Fixed "make distcheck" for the Autotools build
To make the test pass I needed to fix out-of-tree builds and update
EXTRA_DIST and CLEANFILES.
2017-01-10 13:18:47 -08:00
Bo Yang
531ebd9b94 Add embed.cc in src/Makefile.am to fix dist check. 2017-01-10 12:28:39 -08:00
Bo Yang
60d4f8af48 Decoding unknown field should succeed. 2017-01-10 11:00:23 -08:00
Bo Yang
e259b515a5 Fix generated code when there is no namespace but there is enum definition. 2017-01-10 01:02:35 +00:00
Marcus Longmuir
83fb8c7d29 Fix generation of extending nested messages in JavaScript (#2439)
* Fix generation of extending nested messages in JavaScript

* Added missing test8.proto to build
2017-01-09 11:45:52 -08:00
Thomas Van Lenten
64cbfab937 Minor fix for autocreated object repeated fields and maps.
- If setting/clearing a repeated field/map that was objects, check the class
  before checking the autocreator.
- Just to be paranoid, don’t mutate within copy/mutableCopy for the autocreated
  classes to ensure there is less chance of issues if someone does something
  really crazy threading wise.
- Some more tests for the internal AutocreatedArray/AutocreatedDictionary
  classes to ensure things are working as expected.
- Add Xcode 8.2 to the full_mac_build.sh supported list.
2017-01-09 11:43:17 -08:00
Adam Cozzette
77e434de36 Fixed cross compilations with the Autotools build
Pull request #2517 caused cross compilations to start failing, because
the js_embed binary was being built to run on the target platform
instead of on the build machine. This change updates the Autotools build
to use the AX_PROG_CXX_FOR_BUILD macro to find a suitable compiler for
the build machine and always use that when building js_embed.
2017-01-09 11:41:39 -08:00
Julien Brianceau
46dee43e25 Fix include in auto-generated well_known_types_embed.cc
Restore include style fix (e3da722) that has been trampled by
auto-generation of well_known_types_embed.cc
2017-01-09 11:41:02 -08:00
Julien Brianceau
a24ddc570f Fix warning in compiler/js/embed.cc
embed.cc: In function ‘std::string CEscape(const string&)’:
embed.cc:51:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < str.size(); ++i) {
                                ^
2017-01-09 11:39:55 -08:00
Bo Yang
d1fde361a7 Fix int64 decoding on 32-bit machines. 2017-01-09 18:37:54 +00:00
Sufir
c871ce6e7b PHP fix int64 decoding (#2516)
* fix int64 decoding

* fix int64 decoding + tests
2017-01-08 11:53:17 -08:00
Feng Xiao
911e84e706 Merge pull request #2550 from TeBoring/3.2.x
Bump version number to 3.2.0
2016-12-29 21:31:07 -08:00
NicklasWallgren
da9fea1d20 Fixed issue with autoloading - Invalid paths (#2538) 2016-12-28 13:35:11 -08:00
Bo Yang
f5cc1a54c5 Bump version number to 3.2.0 2016-12-28 13:12:18 -08:00
Bo Yang
e230283f75 Add new js file in extra dist. 2016-12-28 10:56:57 -08:00
Bo Yang
117f771641 Update _GNUC_VER to use the correct implementation of atomic operation on Mac. 2016-12-22 15:24:53 -08:00
Adam Cozzette
2f38ce1f98 Added Bazel genrule for generating well_known_types_embed.cc
In pull request #2517 I made this change for the CMake and autotools
builds but forgot to do it for the Bazel build.
2016-12-21 13:47:34 -08:00
Adam Cozzette
2d8a54477f Updated Makefile.am to fix out-of-tree builds 2016-12-21 13:47:24 -08:00
Adam Cozzette
f424c715e1 Added well_known_types_embed.cc to CLEANFILES so that it gets cleaned up 2016-12-21 13:47:09 -08:00
Adam Cozzette
c7cbf5fc37 maps_test.js: check whether Symbol is defined before using it (#2524)
Symbol is not yet available on older versions of Node.js and so this
test fails with them. This change just directly checks whether Symbol is
available before we try to use it.
2016-12-21 13:45:49 -08:00