Commit Graph

163 Commits

Author SHA1 Message Date
Adam Cozzette
bd5ab154da Merge pull request #2482 from andreaseger/fix_ruby_timestamp_accuracy
[Ruby] fix floating point accuracy problem in Timestamp#to_f
2017-07-06 08:11:50 -07:00
Joshua Haberman
1325588982 Updated upb to fix JSON conformance issues. (#3206)
* Fixed a bunch of Ruby conformance errors.

* Fixed some more Ruby conformance errors in JSON.
2017-06-19 15:13:24 -07:00
Joshua Haberman
b28617b813 Merge pull request #2815 from devwout/ruby_json_emit_defaults
Ruby version optionally emits default values in JSON encoding.
2017-05-15 08:05:27 -07:00
Andreas Eger
78cb804063 change test for nanosecond accurate timestamps 2017-05-13 22:20:45 +02:00
Andreas Eger
ad203bcb2b fix floating point accuracy problem in Timestamp#to_f
`.quo` return the most exact devision which fixes accuracy problems for the
timestamp coercion
2017-05-13 21:38:15 +02:00
Feng Xiao
80f0c0ac40 Update version number and changelog for 3.3.0 2017-04-05 17:32:17 -07:00
Adam Cozzette
ea5ef14aa0 Ruby: only link against specific version of memcpy if we're using glibc
We have some special code in wrap_memcpy.c to ensure that we use the
2.2.5 version of memcpy, for compatibility with older versions of glibc.
However, we need to make sure we only attempt to do this when we are
actually building with glibc, so that the code can also build
successfully against other libc implementations such as musl.
2017-03-17 11:23:01 -07:00
Ewout
aec0711075 Ruby tests compare parsed JSON instead of raw JSON 2017-03-17 10:28:17 +01:00
Joshua Haberman
2957703a01 Merge pull request #2847 from haberman/ruby-toh
Ruby: fixed Message#to_h for map fields.
2017-03-16 09:28:09 -07:00
Adam Cozzette
e77a09e1e9 Incremented Ruby version number to 3.2.0.1 2017-03-15 14:16:49 -07:00
Josh Haberman
8c40b5149a Ruby: update Gemspec. 2017-03-15 14:16:49 -07:00
Josh Haberman
014a5507fb Ruby: build packages for Ruby 2.4. 2017-03-15 14:16:49 -07:00
Josh Haberman
324a299a55 Made formatting more consistent. 2017-03-15 10:35:15 -07:00
Josh Haberman
9c6b8cb9bf Ruby: fixed Message#to_h for map fields. 2017-03-14 14:27:16 -07:00
Ewout
008dc92c9d Ruby version optionally emits default values in JSON encoding.
Usage: Message.encode_json(m, emit_defaults: true)
Message fields that are nil will still not appear in the encoded JSON.
2017-03-09 20:47:56 +01:00
Adam Cozzette
9fa40314fc 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 10:03:22 -08:00
Feng Xiao
8610d0a9dd Merge pull request #2755 from xfxyjwf/rubycomp
Add Ruby compatibilty test against 3.0.0.
2017-03-02 14:33:02 -08:00
Sebastian Schuberth
902af0816e Prefer the term "3-Clause BSD License" over "New BSD License"
The first is the newer name, which is also more telling.
2017-02-28 09:58:24 +01:00
Sebastian Schuberth
6395a1cbd9 Fix links to the New BSD License in meta-data
The "New BSD License" is the "3-Clause BSD License", but the links were
pointing to the "2-Clause BSD License".
2017-02-28 09:54:21 +01:00
Feng Xiao
9118ad659b Add Ruby compatibilty test against 3.0.0. 2017-02-27 17:38:54 -08:00
Paul Yang
7f3e237071 Merge 3.2.x branch into master (#2648)
* Down-integrate internal changes to github.

* Update conformance test failure list.

* Explicitly import used class in nano test to avoid random test fail.

* Update _GNUC_VER to use the correct implementation of atomic operation
on Mac.

* 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.

* Added well_known_types_embed.cc to CLEANFILES so that it gets cleaned up

* Updated Makefile.am to fix out-of-tree builds

* 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.

* Update _GNUC_VER to use the correct implementation of atomic operation on Mac.

* Add new js file in extra dist.

* Bump version number to 3.2.0

* Fixed issue with autoloading - Invalid paths (#2538)

* PHP fix int64 decoding (#2516)

* fix int64 decoding

* fix int64 decoding + tests

* Fix int64 decoding on 32-bit machines.

* 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) {
                                ^

* 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

* 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.

* 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.

* Fix generation of extending nested messages in JavaScript (#2439)

* Fix generation of extending nested messages in JavaScript

* Added missing test8.proto to build

* Fix generated code when there is no namespace but there is enum definition.

* Decoding unknown field should succeed.

* Add embed.cc in src/Makefile.am to fix dist check.

* 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.

* Remove redundent embed.cc from src/Makefile.am

* Update version number to 3.2.0-rc.1 (#2578)

* Change protoc-artifacts version to 3.2.0-rc.1

* Update version number to 3.2.0rc2

* Update change logs for 3.2.0 release.

* Update php README

* 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.

* 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

* Fix typo that breaks builds on big-endian (#2632)

* Bump version number to 3.2.0
2017-01-31 09:17:32 -08:00
Joshua Haberman
057389cae3 Ruby: removed redundant RepeatedField#slice. (#2449) 2016-12-07 13:39:09 -08:00
Joshua Haberman
f1ce60e7b4 Factored Conformance and Benchmark test messages into shared test schema. (#1971)
* Factored Conformance test messages into shared test schema.

* Updated benchmarks to use new proto3 message locations.

* Fixed include path.

* Conformance: fixed include of Python test messages.

* Make maven in Rakefile use --batch-mode.

* Revert changes to benchmarks.

On second thought I think a separate schema for
CPU benchmarking makes sense.

* Try regenerating C# protos for new test protos.

* Removed benchmark messages from test proto.

* Added Jon Skeet's fixes for C#.

* Removed duplicate/old test messages C# file.

* C# fixes for test schema move.

* Fixed C# to use the correct TestAllTypes message.

* Fixes for Objective C test schema move.

* Added missing EXTRA_DIST file.
2016-12-03 11:51:25 -05:00
Adam Cozzette
65479cb7b1 Fixed Ruby tests for JRuby 1.7
This makes a couple of changes to fix the tests for JRuby 1.7:
- Avoid using assert_false since that assertion seems not to exist in
  older versions
- Disable a test related to respond_to? for JRuby. It's hard to tell
  what is going wrong here but it looks like probably a JRuby bug that
  has been fixed in more recent versions.
2016-11-23 08:57:27 -08:00
Marcin Wyszynski
74a636a7a2 Move variable declarations before actual code 2016-11-14 21:45:37 +01:00
Marcin Wyszynski
cb81314b1b Fix copy pasta in test 2016-11-03 15:00:40 +01:00
Marcin Wyszynski
3bdaaa5dda More Ruby-eqsue interface 2016-11-03 14:19:10 +01:00
Jason Lunn
9ec7a47ee8 Use git clean before installing via bundler 2016-10-14 01:01:08 -04:00
Feng Xiao
f933d10fbe Update version number.
[skip ci]

Change-Id: I1ba6f6372a08b5796570851336e1a548602f60da
2016-10-10 11:44:21 -07:00
Bo Yang
89d8e43428 Fix travis, jenkins environment issues. 2016-10-10 11:43:48 -07:00
Bo Yang
15f4db6cb1 Bump version number to 3.1.0-alpha-1. 2016-10-10 11:24:31 -07:00
Jason Lunn
6005648c2c Add development dependency requirements
Uses values from the removed `Gemfile.lock` as a baseline for version requirements, though it has been observed to work with the latest versions of all the referenced gems - see https://travis-ci.org/google/protobuf/builds/163625616 for details
2016-09-29 17:31:11 -04:00
Jason Lunn
d94ff4142a Delete Gemfile.lock
Avoid [failures in travis](https://travis-ci.org/google/protobuf/jobs/163611664) under jruby
2016-09-29 02:18:32 -04:00
Jason Lunn
07f3cab3dd Set platform to "java" under JRuby
Proposed fix for #1594
2016-09-29 00:18:55 -04:00
Brendan Ribera
05aa0df532 Fix hash computation for JRuby's RubyMessage
`System.identityHashCode` returns a hash that does not consider a
Message's values. This means two Messages with identical values will not
have identical hashCodes.

This patch uses the pattern from RubyMap to combine the hashCodes from
all values in a given message and produce a unique, consistent,
value-based hash.
2016-09-20 11:07:42 -07:00
Joshua Haberman
b5bbdb0967 Merge pull request #2037 from abscondment/fix-2036-ruby-hash
Fix #2036 (Ruby `hash` broken for Messages with repeated fields.)
2016-09-18 21:38:51 -07:00
Jisi Liu
58860c021f Merge remote-tracking branch 'origin/3.0.x' into merge 2016-09-14 09:37:48 -07:00
Jisi Liu
6e11540b32 Bump version number to 3.0.2 2016-09-02 11:57:49 -07:00
Brendan Ribera
de028631fc fix #2036: use rb_hash_* to accumulate hashes
Instead of shifting/xoring the hash at each field, use the built-in ruby
apis for generating a hash from multiple input values.

Now returns a Fixnum.
2016-08-30 16:22:49 -07:00
Brendan Ribera
047419a172 failing test for #2036:
* add a repeated field to the tested hash
* also assert that two messages with identical values produce identical hashes
2016-08-30 16:21:33 -07:00
Joshua Haberman
dd45c0b9fd Merge pull request #2012 from haberman/rubymapgcfix
Ruby: make sure map parsing frames are GC-rooted.
2016-08-30 09:57:50 -07:00
Josh Haberman
3a674ffe05 upb bugfix: JSON map entry keys were passing the wrong closure. 2016-08-29 15:28:59 -07:00
Josh Haberman
d4213d839f Ruby: make sure map parsing frames are GC-rooted. 2016-08-26 09:03:55 -07:00
Nicolas Noble
866d3e5327 Fixing regular expression...
This will allow loading the extension for Ruby 2.1.10...
2016-08-23 22:46:26 -07:00
Joshua Haberman
8d8115bf52 Merge pull request #1878 from haberman/rubywkt
Ruby: added API support for well-known types.
2016-08-01 17:31:00 -07:00
Josh Haberman
3cec2ea8d6 Ruby: added custom Struct exception type and fixed Makefile.am. 2016-08-01 14:34:54 -07:00
Josh Haberman
a207a2bd00 Fix for JRuby (assert_true is not present). 2016-07-28 17:54:16 -07:00
Josh Haberman
e3094a8d80 Ruby: added API support for well-known types. 2016-07-28 17:02:33 -07:00
Joshua Haberman
234ec01795 Merge pull request #1847 from haberman/GAfixes
GA fixes
2016-07-26 10:55:34 -07:00
Josh Haberman
6d92233e72 Added unit test for PascalCasing package names in Ruby. 2016-07-25 15:16:23 -07:00