Commit Graph

7562 Commits

Author SHA1 Message Date
Joshua Haberman
ef7cc81116
Added changelog entry for removing binary gems for Ruby <2.5. (#7454) 2020-05-01 13:10:28 -07:00
Joshua Haberman
e19bfc0e28
Stop building binary gems for ruby <2.5. (#7453)
It is no longer possible to "bundle install" these versions:

$ bundle install
Fetching gem metadata from https://rubygems.org/.................
reline-0.1.3 requires ruby version >= 2.5, which is incompatible with the current version, ruby 2.4.9p362
2020-05-01 12:35:09 -07:00
Jon Skeet
ed5c874de3 Fix to C# support library code
(This was the only use of a HasXyz property for a message type.)
2020-05-01 09:06:44 +01:00
Jon Skeet
9926c9504b Regenerate C# code based on the previous commit
(This removes the Has/Clear members for message types in proto2.)
2020-05-01 09:06:44 +01:00
Jon Skeet
9d74aafbe1 Don't generate Has/Clear members for proto2 message fields.
This is a breaking change in terms of proto2 code generation: users who were previously using these members will have to change to null checks for message fields.
After toying with removing Has/Clear for proto2 oneof fields, I've left them alone in this commit, for consistency with other languages. The inconsistency between proto2 and proto3 won't come up here, because proto3 oneof fields can never be explicitly optional.

Fixes #7395.
2020-05-01 09:06:44 +01:00
Joshua Haberman
a9f11d7d64
Updated version to 3.12.0-rc1. (#7449) 2020-04-30 15:34:10 -07:00
Joshua Haberman
26bec4b84c
Added changelog for 3.12.x. (#7442)
* Added changelog for 3.12.x.

* Updated the wording of the changelog for proot3 presence.

Also removed notice for change that was rolled back for
Java enums.

* A bit more teaking of the wording.
2020-04-29 17:16:03 -07:00
Michael WERLE
02f182e829 Clean up nortti fix based on comments from @acozzette
Also moved the macro into the only function which is using it to keep the fix local to the issue.
2020-04-29 10:42:37 -07:00
Michael WERLE
1d461e7825 Fix when compiling without RTTI 2020-04-29 10:42:37 -07:00
Jan Tattermusch
ff999c9d42 clarify docs 2020-04-29 08:57:53 +02:00
Jan Tattermusch
673245f212 remove unnecessary cast 2020-04-29 08:50:59 +02:00
Thomas Van Lenten
2db0e9812a Use the new helpers from Descriptor. 2020-04-28 16:22:53 -04:00
Jan Tattermusch
402ce8b17f add back GetOption tests 2020-04-28 19:25:06 +02:00
Jan Tattermusch
062c2dc24b add back GetOption methods, but mark them as obsolete 2020-04-28 19:14:27 +02:00
Joshua Haberman
4b4e667435
Merge pull request #7435 from haberman/sync-stage
Integrate from Piper for C++, Java, and Python
2020-04-28 09:52:24 -07:00
Nick Presta
75553e9ec8 Update shell format in installation instructions. 2020-04-28 08:51:04 -07:00
Joshua Haberman
32e5deb1ac Sync from Piper @308829107
PROTOBUF_SYNC_PIPER
2020-04-28 08:40:38 -07:00
Joshua Haberman
140e1bb70e Merge branch 'sync-piper' into sync-stage 2020-04-28 08:40:38 -07:00
Jan Tattermusch
f4ff22026b add a few more tests 2020-04-28 13:59:54 +02:00
Jan Tattermusch
9720ae41c2 adjust CustomOptionsTest.cs 2020-04-28 12:49:29 +02:00
Jan Tattermusch
944055a683 expose Options property on descriptors 2020-04-28 10:49:49 +02:00
Greg Steuck
4059c61f27
Typo in 'disciplines' (#7423) 2020-04-27 08:21:52 -07:00
Jan Tattermusch
7134d25eb8 Merge remote-tracking branch 'upstream/master' into protobuf_csharp_new_parsing 2020-04-27 13:18:07 +02:00
Thomas Van Lenten
dddeed298b [ObjC] Typos and comment improvements. 2020-04-24 16:36:15 -04:00
Thomas Van Lenten
7b6016e343 [ObjC] Add tests for proto3 optional behaviors. 2020-04-24 16:36:15 -04:00
Thomas Van Lenten
b0e2792842 [ObjC] Generation changes around proto3 optional.
- Bump the version marker in the generated code.
- Set the flag to say clear on zero is known.
- Set clear on zero for proto3 optional fields that aren't tagged as optional.
- Also tweak the call from some C generated code to use different apis with
  better validation.
- Mark the ObjC generator as supporting the proto3 optional feature.
- Regenerate the WKTs to get the new flags.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
3c8e959b60 [ObjC] Update oneof clearing internals.
- Add/document an public api for clearing oneofs.
- Move the current library internals to a new api and keep a shim for old
  generated code.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
e1e5b8af79 [ObjC] Update some library internals to not pass syntax versions.
- With the new flags, the syntax isn't needed, so don't pass it.
- To keep library binary compatibility, rename the helpers since one
  "Internal" method was called from generated code. Keep a shim with
  the old signature to support those generated sources.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
8d224b4c48 [ObjC] Runtime support for proto3 optional.
- Add a Descriptor flag to capture if the field should clear on being zeroed.
- Update the runtime to use the new clear on zero flag.
- Add a flag on message initialization to indicate the sources were generated
  with/without this support so the runtime can backfill the flag for older
  generated sources.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
e9b0c92659 [ObjC] Update oneof generation for proto3 optional.
- Don't make an OneofGenerator for synthetic oneofs.
- Update the field calculations that determine if hasbits are needed to
  know about synthetic oneofs and ignore them.
2020-04-24 16:36:15 -04:00
Thomas Van Lenten
59f8dd5faf [ObjC] Move over some custom logic to Descriptor provided info.
FieldDescriptor::has_presence works as a replacement for the custom logic we
had for FieldGenerator::WantsHasProperty(), and is already proto3 optional
aware.
2020-04-24 16:36:15 -04:00
Masaki Hara
f494cb222d
Test in Ruby 2.7 (#7386)
* Test in Ruby 2.7

* Turn off GC.stress for 'require' in Ruby 2.7

* Backport 2c8364b to compatibility_tests/v3.0.0
2020-04-24 09:50:27 -07:00
Jon Skeet
81c9b85dee Add new files into Makefile.am 2020-04-24 17:39:14 +01:00
Jon Skeet
97737072f9 Add reflection support for proto3 optional fields
This is more involved than might be expected because the synthetic oneofs don't generate the properties we would usually expect to see.
2020-04-24 17:39:14 +01:00
Jon Skeet
bad9d753ae Add unit tests for proto3 optional fields
(This isn't as exhaustive as it might be, but the behavior is basically the same as proto2 optional fields.)
2020-04-24 17:39:14 +01:00
Jon Skeet
b0649a088a Regenerate C# code with the new generator, adding unittest_proto3_optional.proto
The changes in the existing proto2 code are solely around presence bits. The new generator allocated presence bits more efficiently. (Previously bits were sometimes allocated but never used.)
2020-04-24 17:39:14 +01:00
Jon Skeet
4dcafd12cb Support proto3 optional fields in the C# generator
Most changes are:

- Introducing new helpers of SupportsPresenceApi and RequiresPresenceBit. This allows calling code to be a lot clearer about what it's interested in.
- Changing most previous IsProto2 calls to use one of the two new helper methods
- Avoiding treating synthetic oneofs as regular ones
- Some slight refactoring in csharp_primitive_field to avoid code duplication
- Comments explaining what we want when, so the next maintainer doesn't need to do the detective work I did!

This change deliberately doesn't modify the API surface of any
existing code. The only change to previously-generated C# should be
making presence bits more efficient in proto2.

Once proto3 optional fields are supported, we can consider further
changes to make the proto2 and proto3 generated API surface more
consistent (e.g. adding presence API for message fields and oneofs).
2020-04-24 17:39:14 +01:00
Jon Skeet
4c9613f226 Register that the C# compiler supports proto3 presence.
(It doesn't yet, but will in the next commits...)
2020-04-24 17:39:14 +01:00
Joshua Haberman
7eddac7877
Added some info about Reflection, and a note about timeline. (#7416)
* Added some info about Reflection, and a note about timeline.

* Fixed heading levels.

* A bit more info.
2020-04-23 14:33:53 -07:00
Joshua Haberman
fda8544a59
Howto doc for implementing proto3 presence in a code generator. (#7407) 2020-04-23 13:00:30 -07:00
David L. Jones
e48c92952d
Add application note for explicit presence tracking. (#7390)
This includes instructions for enabling explicit presence tracking in proto3, and also explains implicit presence. The language examples were written by inspection, and not individually tested.
2020-04-23 12:59:51 -07:00
Joshua Haberman
6b759688a1
Implemented proto3 presence for Ruby. (#7406)
* WIP.

* WIP.

* Builds and runs. Tests need to be updated to test presence.

* Ruby: proto3 presence is passing all tests.

* Fixed a bug where empty messages has the wrong oneof count.
2020-04-23 12:54:25 -07:00
David L. Jones
94afb8ab36
Add Ruby tests for oneof cases. (#7385)
In Ruby, the oneof case returns a symbol with the name of the field that is set. These were not previously tested.
2020-04-23 12:49:04 -07:00
Jan Tattermusch
a1b9aa499e get rid of extraneous ParserInternalState.codedInputStream field 2020-04-23 16:58:59 +02:00
David L. Jones
c953182fa9
Generate documentation for internal.container. (#7294)
Since our (public) generated APIs document their use of repeated fields, we should probably document its API, too.

This includes some changes to generate_docs.py to explicitly allow named modules, since the repeated field implementation lives in the "internal" tree.
2020-04-22 21:41:12 -07:00
Jan Tattermusch
eac2a6a510 update C# distrib files in Makefile.am 2020-04-22 11:18:16 +02:00
Jan Tattermusch
eb38a3cdb8 adjust some TODOs in ParsingPrimitives.cs 2020-04-22 10:03:51 +02:00
Jan Tattermusch
dd97af88db deduplicate ExtensionSet.TryMergeFieldFrom implementation, add test 2020-04-22 09:03:15 +02:00
Jan Tattermusch
cf49962c57 actually use ParsingPrimitives.ReadBytes and ReadString 2020-04-21 16:58:32 +02:00
Jan Tattermusch
d7c1fab00b add benchmarks for parsing string and bytes 2020-04-21 16:31:32 +02:00