Commit Graph

554 Commits

Author SHA1 Message Date
Joshua Haberman
f41049a0f0 Updated upb. 2022-01-21 14:41:25 -08:00
Adam Cozzette
5bb34e9930 Merge branch '3.19.x' into merge-3.19.x 2022-01-11 18:07:17 +00:00
Adam Cozzette
cc7b1b5323 Update protobuf version 2022-01-10 18:08:15 -08:00
Adam Cozzette
eb94f17a8b Update protobuf version 2022-01-05 10:05:11 -08:00
Adam Cozzette
0e02f95b87 Fix Ruby release build by pinning rake-compiler-dock version (#9372)
Our Ruby release build broke at some point in the past day or so, and I
strongly suspect it is due to a new version (1.2.0) of
rake-compiler-dock. This commit pins the version to 1.1.0 as a temporary
fix.
2022-01-05 10:05:11 -08:00
Adam Cozzette
f681c8d9e6
Fix Ruby release build by pinning rake-compiler-dock version (#9372)
Our Ruby release build broke at some point in the past day or so, and I
strongly suspect it is due to a new version (1.2.0) of
rake-compiler-dock. This commit pins the version to 1.1.0 as a temporary
fix.
2022-01-05 08:26:20 -08:00
Adam Cozzette
9227f60f85 Merge branch '3.18.x' into merge-3.18.x 2021-12-22 23:04:07 +00:00
Adam Cozzette
1fe07f9ce2
Cherry-pick fix from #9311 into 3.18.x (#9320)
* Dropped Ruby 2.4 support for CI and releases.

* Removed Kokoro configs for old Ruby versions.

* Update Dockerfile to allow it to be rebuilt

Co-authored-by: Joshua Haberman <jhaberman@gmail.com>
2021-12-22 15:01:34 -08:00
Joshua Haberman
214180c5a2 Dropped Ruby 2.4 support for CI and releases. 2021-12-14 16:33:16 -08:00
Adam Cozzette
7ccf4d8f67
Merge pull request #9169 from protocolbuffers/3.19.x
Merge 3.19.x into master
2021-11-02 10:10:47 -07:00
Adam Cozzette
7c40b2df1f
Update protobuf version (#9167) 2021-10-28 14:07:53 -07:00
Peter Zhu
b2ac7ced50 Fix memory leak in MessageClass.encode
If the line above raises an exception, the upb_arena is lost and memory
is leaked.
2021-10-28 17:47:53 +00:00
deannagarcia
85c4bc4205
Merge pull request #8254 from jufemaiz/feature/ruby-better-from_-support-well_known_types
Improvement: better ruby from_* support in well_known_types.rb
2021-10-27 14:13:27 -07:00
Joel Courtney
bbdcea8547
Remove lib from require 2021-10-28 07:09:11 +11:00
Joel Courtney
4d94a7cd93 Fixed: incorrect tests 2021-10-27 22:20:45 +11:00
Joel Courtney
947a51a464 Test coverage: .from_ruby / #from_ruby 2021-10-26 12:43:57 +11:00
Peter Zhu
3a18299cc0 Fix memory leak in MessageClass.encode
If the line above raises an exception, the upb_arena is lost and memory
is leaked.
2021-10-25 15:55:12 -04:00
Adam Cozzette
17b30e9647
Update protobuf version (#9119) 2021-10-20 10:14:02 -07:00
Adam Cozzette
3f3e6f47c6
Update version to 3.19.0-rc2 and fix changelog about Java 7 (#9116)
* Update protobuf version

* Update CHANGES.txt to reflect that we're not yet dropping Java 7
2021-10-19 09:01:57 -07:00
Joel Courtney
21478b371e
Update well_known_types_test.rb 2021-10-19 12:25:21 +11:00
Joel Courtney
e4ce58cd60
Merge branch 'master' into feature/ruby-better-from_-support-well_known_types 2021-10-17 22:58:15 +11:00
Adam Cozzette
519340d662
Update protobuf version (#9106) 2021-10-15 14:33:06 -07:00
deannagarcia
5106dea867
Merge pull request #7938 from alusco-scratch/patch-1
Override Map.clone to use Map's dup method
2021-10-14 11:24:01 -07:00
deannagarcia
3d223dc5c5
Merge pull request #8232 from qnighy/arm64-darwin
Ruby: build extensions for arm64-darwin
2021-10-14 11:05:52 -07:00
deannagarcia
ed58b7d26b
Merge pull request #8562 from mcclymont/timestamp-from-time-class-method
Add class method Timestamp.from_time to ruby well known types
2021-10-14 11:01:11 -07:00
miyucy
3881f49ce9
Add size to Map class (#8068) 2021-10-13 12:54:49 -07:00
Postmodern
39013ab238
Remove unused rubygems-tasks development dependency (#8824)
* Cannot find any occurrence of `require 'rubygems/tasks` or `Gem::Tasks` in the source code, so I am confident that this development dependency can safely be removed.
2021-10-12 17:03:24 -07:00
Jason Lunn
b79a2f242c Add JRuby test targets for JRuby 9.2.x and 9.3.x.
Standardize on JRuby 9.2.19.0 for building and for testing the 9.2.x branch.
2021-10-07 18:56:14 -04:00
Jason Lunn
728878e98f Add JRuby test targets for JRuby 9.2.x and 9.3.x.
Standardize on JRuby 9.2.19.0 for building and for testing the 9.2.x branch.
2021-10-07 18:45:38 -04:00
Elliotte Rusty Harold
174d95c1a7
remove dependency on Jackson 2021-10-06 21:02:51 +00:00
Jason Lunn
7051d82fa9
Bump to 3.18.1 2021-10-06 11:18:11 -04:00
Adam Cozzette
2a75e8ca58 Merge branch '3.18.x' into merge-3.18.x 2021-10-05 14:04:13 -07:00
Adam Cozzette
0dab03ba7b
Update protobuf version to 3.18.1 (#9051)
* Update protobuf version

* Update PHP release notes in package.xml
2021-10-04 17:43:33 -07:00
Jason Lunn
05ddf82f20 Remove blank line 2021-10-04 17:04:03 +00:00
Jason Lunn
793c66ddf0 Include JRuby's pom.xml file when updating version numbers 2021-10-04 17:00:17 +00:00
Jason Lunn
e3ba5ec615 Add trailing backslashes at end of line consistently 2021-10-04 15:45:26 +00:00
Jason Lunn
f5ef2892b4 Add an explicit RUBYLIB path to fix a load error under JRuby 2021-10-04 15:44:38 +00:00
Jason Lunn
b5687819a6 Fix a test regression observed after branch update 2021-10-04 15:43:21 +00:00
Jason Lunn
a09c8e1c79 Fix logic to decouple from the order of fields.keySet 2021-10-04 13:57:47 +00:00
Jason Lunn
3581d85ced Update JRuby to leverage pure-Ruby DSL.
JRuby unit and conformance test fixes.
2021-10-03 18:25:43 -04:00
Adam Cozzette
55b0e11f52 Fix Ruby tests on Mac
It appears that this extra conditional in travis-test.sh is no longer
necessary, and in fact we need to avoid using a custom version of
OpenSSL since that is causing its own error.
2021-09-30 14:34:02 -07:00
Adam Cozzette
0333cb77de Update ruby/travis-test.sh to print commands 2021-09-30 11:55:04 -07:00
Masaki Hara
4111d50488 Merge branch 'master' into arm64-darwin 2021-09-29 11:50:23 +09:00
zhangskz
740c4b082d
Update ruby_generator.cc to allow proto2 imports in proto3 (#9003)
* Update ruby_generator.cc to allow proto2 imports in proto3, with updated unit tests

* Update Makefile.am with new ruby_generated_code_proto2_import.proto

* Fix ruby_generator unit test to use temporary test directory for imported protos

* Add test for imported proto2 to ruby/tests

* Fix proto_path, restore to ../src/protoc, and fix/cleanup unit test.

* Rename Proto2TestMessage to TestImportedMessage for consistency, for ruby compiler tests
2021-09-22 09:16:09 -07:00
Paul Yang
12fb2b7450
Update protobuf version (#8973)
* Update protobuf version

* Update php notes
2021-09-13 12:34:03 -07:00
Joshua Haberman
79ac88bbbb Fixed a memory bug with RepeatedField#+.
We need to fuse the arrays so that the second array's data
stays live.
2021-09-10 17:17:14 -07:00
Joshua Haberman
6d8b05bfd4 Added missing "options" parameter. 2021-08-30 22:58:58 -07:00
Bo Yang
d8f55782b0 Update protobuf version 2021-08-27 14:39:58 -07:00
Paul Yang
7cbc08615f
Update protobuf version (#8887) 2021-08-18 17:20:20 -07:00
Joshua Haberman
3d51eb5d9f Make the Ruby DSL use a unique filename for each implicit file. 2021-08-02 20:43:43 -07:00
Joshua Haberman
9d578a3a9c Ported Ruby to ABSL wyhash. 2021-08-02 15:32:01 -07:00
Joshua Haberman
b7ab6255d6 Addressed PR comments. 2021-08-02 12:59:49 -07:00
Joshua Haberman
d339e1748e Updated Ruby 3.0 test to 3.0.2. 2021-08-01 12:07:15 -07:00
Joshua Haberman
cb649b61e3 Fix for newer Rubies where you cannot #force_encoding on a frozen string. 2021-07-31 13:12:14 -07:00
Joshua Haberman
16e16eb8cd pure-Ruby DSL is passing all tests! 2021-07-31 11:13:08 -07:00
Joshua Haberman
b4b5c89c31 Merge branch 'master' into rubybuilder 2021-07-30 15:04:53 -07:00
Deanna Garcia
367851d124 Update protobuf version 2021-06-04 21:21:39 +00:00
Deanna Garcia
5b8208ecea Update protobuf version 2021-05-25 19:36:05 +00:00
Joshua Haberman
367e4691d2
Fixed memory bug: properly root repeated/map field when assigning. (#8639)
* Fixed memory bug: properly root repeated/map field when assigning.

Previously the protobuf extension would not properly root
memory from a repeated field or map when assigning to a
message field (see the attached test case).  This could cause
crashes if the repeated field is subsequently accessed.

* Add accidentally-deleted Ruby test.
2021-05-21 23:04:09 -07:00
Adam Cozzette
52784ced2f
Update protobuf version (#8633) 2021-05-19 16:43:44 -07:00
Joshua Haberman
0b87475592
Php & Ruby Cherry Picks for 3.17.1 (#8632)
* Some more updates to PHP testing infrastructure (#8576)

* WIP.

* Added build config for all of the tests.

* Use ../src/protoc if it is available, for cases where Bazel isn't available.

* Added test_php.sh.

* Fix for the broken macOS tests.

* Move all jobs to use php80 instead of lots of separate jobs.

* Only pass -t flag if we are running in a terminal.

* Updated php_all job to use new Docker stuff.

* Fixed PHP memory leaks and arginfo errors (#8614)

* Fixed a bunch of incorrect arginfo and a few incorrect error messages.

* Passes mem check test with no leaks!

* WIP.

* Fix build warning that was causing Bazel build to fail.

* Added compatibility code for PHP <8.0.

* Added test_valgrind target and made tests Valgrind-clean.

* Updated Valgrind test to fail if memory leaks are detected.

* Removed intermediate shell script so commands are easier to cut, paste, and modify.

* Passing all Valgrind tests!

* Hoist addref into ObjCache_Get().

* Removed special case of map descriptors by keying object map on upb_msgdef.

* Removed all remaining RETURN_ZVAL() macros.

* Removed all explicit reference add/del operations.

* Added REFCOUNTING.md to Makefile.am.

* Updated upb version and fixed PHP to not get unset message field. (#8621)

* Updated upb version and fixed PHP to not get unset message field.

* Updated changelog.

* Fixed preproc test to handle old versions of Clang withot __has_attribute().

* A second try at fixing __has_attribute().

* Copy __has_attribute() fix to cc file also.

* Updated failure list for PHP for fixed test.

* Updated version of upb for Ruby (#8624)

* Updated upb.

* Preserve legacy behavior for unset messages.

* Updated failure list.

* Updated CHANGES.txt.

* Added erroneously-deleted test file.

* Fixed condition on compatibility code.

* Re-introduced deleted file again, and fixed Rakefile to not delete it.

* Fix generation of test protos.
2021-05-19 15:53:47 -07:00
Adam Cozzette
652d99a8ee
Update protobuf version (#8606) 2021-05-12 16:20:18 -07:00
Adam Cozzette
f807c02226
Update protobuf version to 3.17.0-rc2 (#8586)
* Update protobuf version

* Updated Kotlin versions and updated script to handle them
2021-05-10 15:31:35 -07:00
Adam Cozzette
7025f37cde
Update protobuf version (#8575) 2021-05-07 09:51:15 -07:00
Daniel Azuma
7e3bbeda92
fix(ruby): Fix crash when calculating Message hash values on 64-bit Windows (#8565)
* fix(ruby): Fix crash when calculating Message hash values on 64-bit Windows

* Better mapping for values outside the fixnum range

* Simpler downcasting of hash values

* Fix precedence

* Fix bundle on Ruby 2.4
2021-05-06 09:45:11 -07:00
Daniel Azuma
414aca5f13
fix(ruby): Fix various exceptions in Ruby on 64-bit Windows (#8563)
* fix(ruby): Fix various exceptions in Ruby on 64-bit Windows.

Activates the secondary ObjectCache map on this platform, to prevent weak keys from being garbage collected. This happened on 64-bit Windows because pointers don't necessarily fit in a Fixnum, and were being represented as GC-able Bignums on that platform.

* Removed extraneous code, and used VALUE instead of intptr_t

* Call the C function for new object instance rather than evaling a Ruby string
2021-05-05 15:42:25 -07:00
Chris McClymont
6d847adda7 Add class method from_time to ruby well known types - Timestamp 2021-05-05 13:38:05 +10:00
Joshua Haberman
fecf7e9340
Merge pull request #8356 from lfittl/support-json-name-for-ruby
Ruby: Add support for proto3 json_name in compiler and field definitions
2021-04-20 11:21:35 -07:00
James D
68cb69ea68
Fix source gem compilation (#8471)
* Select appropriate protoc binary for gem build

This should allow gem installation when
`bundle config force_ruby_platform true` has been set.

It has the unfortunate side effect of printing the protoc version during
build, but a quiet cross-platform solution is more complicated.

* Add path to wyhash header for source gem compilation
2021-04-12 10:06:44 -07:00
Adam Cozzette
5679811239 Merge branch '3.15.x' into merge-3-15-x 2021-04-08 10:54:02 -07:00
Adam Cozzette
436bd7880e
Updated version to 3.15.8 (#8463)
* Update protobuf version

* Updated CHANGES.txt and package.xml for 3.15.8
2021-04-07 15:38:38 -07:00
Joshua Haberman
67fee915e0 Fixed memory leak of Ruby arena objects.
In our free() method, we were freeing the memory from the
upb arena but we were failing to free the memory for the
Ruby arena object. This was causing every Ruby arena object
to leak: even though the objects were getting GC'd, the
underlying memory was not getting released.
2021-04-07 10:30:51 -07:00
Lukas Fittl
93c703e816 Add test for json_name functionality 2021-04-03 18:42:54 -07:00
Lukas Fittl
07f263c7ef Address review feedback 2021-04-03 18:42:43 -07:00
Adam Cozzette
87aa9adb86 Merge branch 'master' into 3.15.x 2021-04-02 14:55:02 -07:00
Adam Cozzette
878be3569e Update protobuf version 2021-04-02 11:06:56 -07:00
Joshua Haberman
f3f8707ba5
Merge pull request #8434 from haberman/ruby-message-eq
Fixed message equality in cases where the message type is different.
2021-04-01 12:16:53 -07:00
Joshua Haberman
38e1b59258 Elided the TYPE() and msgdef checks by using CLASS_OF. 2021-04-01 10:22:35 -07:00
Joshua Haberman
d69f482883 Fixed message equality in cases where the message type is different.
If the message types are different, equality comparison must return
false.
2021-03-29 17:37:36 -07:00
Joshua Haberman
a38319b5c4
Merge pull request #8429 from haberman/ruby-gc-secondarymap
Fix unbounded memory growth for Ruby <2.7.
2021-03-29 13:31:28 -07:00
Joshua Haberman
2fe27d8764 Addressed PR comments and fixed a bug.
We now hold the mutex for both map insertions, to protect
against a concurrent GC that removes from the seconary map
before we can insert into the weak map.
2021-03-29 12:30:49 -07:00
Joshua Haberman
e1ac393725 Added some more comments and refactored slightly. 2021-03-25 11:54:50 -07:00
Joshua Haberman
f0d6fcb2da Wrap secondary map mutations in a mutex, to avoid mutation races. 2021-03-25 11:54:50 -07:00
Joshua Haberman
b75a49f9e0 GC secondary map periodically. 2021-03-25 11:54:50 -07:00
Adam Cozzette
9db84d08fb Merge branch '3.15.x' into merge-3-15-x 2021-03-12 15:05:10 -08:00
Adam Cozzette
6aa539bf01 Update protobuf version 2021-03-10 14:53:26 -08:00
Aaron Patterson
addd0615bf
Register mark objects so Protobuf is compaction friendly
This commit removes an unused reference and registers globals with the
GC so that they will never die.  Ruby is getting a compacting GC, and it
means that these references can move.  Registering them with
`rb_gc_register_mark_object` will ensure the constants don't move and
will not be collected.
2021-03-10 13:54:04 -08:00
Joshua Haberman
b2991b8419
Merge pull request #8386 from haberman/ruby-string-compare
[Ruby] Fixed bug in string comparison logic.
2021-03-05 12:36:22 -08:00
Joshua Haberman
bb322c2b39 [Ruby] Fixed bug in string comparison logic. 2021-03-05 08:23:42 -08:00
Adam Cozzette
4fff47a418 Update protobuf version 2021-03-04 13:35:04 -08:00
Joshua Haberman
9b5e357df5 Fixed quadratic memory use in array append for PHP and Ruby. 2021-03-04 09:12:29 -08:00
Adam Cozzette
fd8aabf32d Update protobuf version 2021-03-03 11:37:48 -08:00
Joshua Haberman
cf7d81f88c
Merge pull request #8363 from haberman/ruby-nil-fix
Fixed SEGV when users pass nil messages. This also disallows `nil` in RepeatedField or Map.
2021-03-02 17:26:46 -08:00
Joshua Haberman
7d63b996e1 Removed compatibility test that tries to append "nil" to repeated field. 2021-03-02 15:20:06 -08:00
Joshua Haberman
dfa54577d6 [Ruby] Fixed SEGV when users pass nil messages. 2021-03-02 12:44:16 -08:00
Lukas Fittl
2c354c6626 Ruby: Add support for proto3 json_name in compiler and field definitions 2021-03-01 00:25:18 -08:00
Adam Cozzette
983d115bd9 Update protobuf version 2021-02-25 09:20:20 -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
d7e943b8d2 Update protobuf version 2021-02-23 13:21:42 -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