Commit Graph

6293 Commits

Author SHA1 Message Date
Sydney Acksman
2b0a18b270 Add C# compiler option to add System.SerializableAttribute to generated message classes (#5208) 2018-10-05 11:06:02 -07:00
Kevin James
f50a1f843e fix(python): fix deprecated collections.abc usage (#5195)
Many classes within collections were moved to collections.abc in Python
3.3 -- their usage as imported directly from collections is now
deprecated as of Python 3.7 and will be removed soon.

The fallback import added in this PR can be removed entirely when
support for versions of Python prior to 3.3 is dropped.
2018-10-04 16:06:53 -07:00
Paul Yang
011f67035c
Fix broken tests by #4816 (#5221)
* Fix dist check for ruby

* Fix dist check
2018-10-04 10:29:21 -07:00
Adam Cozzette
b20bc69625
Merge pull request #5218 from cliffburdick/master
Fixed unsigned warning
2018-10-04 10:13:54 -07:00
cburdick
ad47ec5060 Used C++ style casts 2018-10-03 20:11:45 +00:00
Adam Cozzette
c27d6a5646
Merge pull request #5212 from GregTho/win32close
Use ::_close rather than ::close in Win32 stubs.
2018-10-02 15:43:17 -07:00
Cliff Burdick
ccacd40c32 Fixed unsigned warning 2018-10-02 21:00:25 +00:00
Thomas Van Lenten
8c1748f1cd Add tests to confirm strings/bytes are copied. 2018-10-02 13:45:18 -04:00
Thomas Van Lenten
09c001e999 Copy the value when setting message/data fields.
Follow ObjC conventions and how the generated header labels things by
copying NSStrings/NSData fields when setting them.
2018-10-02 13:45:18 -04:00
Thomas Van Lenten
97d03abb85 Turn off ALWAYS_SEARCH_USER_PATHS.
Causes a warning in newer Xcodes.
2018-10-02 13:45:18 -04:00
Thomas Van Lenten
561413523f Remove stray 'return'. 2018-10-02 13:45:18 -04:00
Elliotte Harold
feea49b5b5 remove obsolete parent 2018-10-02 07:11:47 -04:00
GregTho
703f11123a
Use ::_close rather than ::close in Win32 stubs.
The former is the proper converse of _open, which is used in
::google::protobuf::internal::win32::open. This resolves issue #5209.
2018-10-02 12:16:14 +02:00
Adam Cozzette
4265a1d36c
Merge pull request #5210 from jstandish/patch-1
Added VSCode extension link
2018-10-01 13:52:45 -07:00
John Standish
bac4c8ec56
Update third_party.md
Added link to VSCode-Proto3 extension in Other Utilities section
2018-10-01 12:41:19 -07:00
Nazarbek Altybay
887f5e5f39 Fixed typo (#5206) 2018-09-30 20:59:54 -07:00
Markus Heß
1509e8e3b3 Revert "protobuf_generate(): add relative path to output dir"
This reverts commit 93f6b67eb2.

Protoc adds already the relative path to the output directory.
Therefore, we have to remove this again from the output directory
to prevent adding it twice.
2018-09-28 11:00:55 +02:00
Joshua Haberman
19ef4ab1c2
Merge pull request #4816 from hrsht/hrsht/zanker-proto2
Basic Proto2 support for Ruby gem
2018-09-27 15:23:10 -07:00
Harshit Chopra
d0535cc09e Adds support for proto2 syntax for Ruby gem.
This change only adds basic proto2 support without advanced features
like extensions, custom options, maps, etc.

The protoc binary now generates ruby code for proto2 syntax.
However, for now, it is restricted to proto2 files without advanced features
like extensions, in which case it still errors out.

This change also modifies the DSL to add proto messages to the DescriptorPool.
There is a new DSL Builder#add_file to create a new FileDescriptor. With this,
the generated ruby DSL looks something like:

Google::Protobuf::DescriptorPool.generated_pool.build do
  add_file "test.proto" do
    add_message "foo" do
      optional :val, :int32, 1
    end
  end
end
2018-09-27 14:21:16 -04:00
Yilun Chong
dfa53e2fa2 fix comment out 2018-09-26 10:39:13 -07:00
Yilun Chong
cee0447fd9 Add node and php to benchmark dashboard 2018-09-25 16:05:16 -07:00
Adam Cozzette
4426cb5733
Merge pull request #5172 from shields/smear-comments
Smear comments
2018-09-24 13:52:52 -07:00
Sydney Acksman
54176b26a9 C# Proto2 feature : Field presence and default values (#4642)
* Compiler changes

* Generated code changes

* Library changes

* Compiler style changes

* Generated style changes

* Fix Windows build errors

* Implement changes from review

* Reintroduce proto2 check

* Compiler changes (required handling review)

* Generated code changes (required handling review)

* Library changes (required handling review

* Field presence rewrite (compiler changes)

* Field presence rewrite (generated code changes)

* Compiler comment

* IFieldAccessor.HasValue library implementation

* Remove Clear methods and default values from proto3 code (Compiler)

* Remove Clear methods and default values from proto3 code (Generated)

* Remove Clear methods and default values from proto3 code (Library)

* Fix distcheck error

* Rewrite default string values to use base64 and convert

* Library changes (IMessage2)

* Compiler changes (IMessage2)

* Generated changes (IMessage2)

* Rebased and regenerated

* Compiler changes (initialized extension)

* Generated changes (initialized extension)

* Library changes (initialized extension)

* Refactor MessageExtensions.IsRequired

* Move string default value creator and bytes default value creator back to seperate methods

* Dead code cleanup

* Fixed segmentation fault
Removed unused header method declarations
2018-09-24 13:42:24 -07:00
Feng Xiao
fb0a74b660
Merge pull request #5180 from mit-mit/patch-1
Dart build status
2018-09-24 10:51:52 -07:00
Yilun Chong
f1bea7a40f
Merge pull request #5182 from BSBandme/test_benchmark
fix java build by changing mvn to online
2018-09-23 22:52:56 -07:00
Yilun Chong
2b7ee3873e fix java build by changing mvn to online 2018-09-23 17:07:02 -07:00
Paul Yang
9bda1f19bf
Adopt upb change for timestamp and duration json to php (#5106)
* Adopt upb change for timestamp and duration json to php

* Remove unused code

* Re-sync upb

* Fix php implementation timestamp json parsing

* Fix strptime use local timezone on mac.

* Remove succeeding tests

* Resync

* Add tests for values

* Fix php tests

* Fix encoder handlers change default value

Previously, oneofsubmsg_handler and submsg_handler change zval's default value directly.
The fix use REPLACE_ZVAL_VALUE which create a copy of parsed value and assign it to zval.
2018-09-22 18:57:43 -07:00
Jon Skeet
47d33e752e Test locations, and add comment to clarify testing 2018-09-22 09:09:15 +01:00
Jon Skeet
6e39eaad3c Add more detailed comments for declaration properties 2018-09-22 09:09:15 +01:00
Jon Skeet
0b314d745b Add files to Makefile.am to fix dist targets 2018-09-22 09:09:15 +01:00
Jon Skeet
1376ee4e6a Simplify descriptor tests
Rather than converting the proto to a ByteString again, use the
existing SerializedData property.
2018-09-22 09:09:15 +01:00
Jon Skeet
988b381c83 Add comment about FileDescriptor not exposing a declaration 2018-09-22 09:09:15 +01:00
Jon Skeet
1711999078 Provide simple access to descriptor declarations in C#
This is primarily for access to comments, which would be expected to be available in a protoc plugin.

The implementation has two fiddly aspects:

- We use a Lazy<T> to avoid building the map before cross-linking. An alternative would be to crosslink at the end of the constructor, and remove the calls to CrossLink elsewhere. This would be generally better IMO, but deviate from the Java code.
- The casts to IReadOnlyList<DescriptorBase> are unfortunate. They'll always work, because these lists are always ReadOnlyCollection<T> for a descriptor type... but we can't use IList<DescriptorBase> as that's not covariant, and it's annoyingly fiddly to change the field to be of type ReadOnlyCollection<T>.
2018-09-22 09:09:15 +01:00
Michael Thomsen
fe1266260c
Dart build status
Add build status badge for Dart
2018-09-21 13:47:31 +02:00
Michael Shields
10360e342f Regenerate C# and Objective-C. 2018-09-19 12:54:57 -07:00
Michael Shields
5f2fcc3f6c Update comments to discuss leap smearing in detail.
Fixes #1890.
2018-09-18 19:32:50 -07:00
Feng Xiao
a6e1cc7e32
Merge pull request #5127 from xfxyjwf/merge
Merge 3.6.x branch to master
2018-09-17 13:41:25 -07:00
Jeffrey Walton
be14bf2b78
Fix compile error in generated_message_util.cc 2018-09-12 23:55:07 -04:00
Jeffrey Walton
5193bedb41
Fix compile error in common.cc 2018-09-12 23:26:00 -04:00
Jeffrey Walton
e0de5edc21
Mostly fix Sun Studio configuration using SunCC compiler
The SunCC compiler in Sun Studio 12.5 crashes on the m4 macro test test_type_deduction (line 257). The Sun Studio 12.6 compiler finishes configuring.
2018-09-12 22:18:27 -04:00
Feng Xiao
ff3891dab1
Merge pull request #5085 from scentini/compiler-flag
Route "compiler" value of config_setting through @bazel_tools/tools/cpp:compiler.
2018-09-10 16:47:22 -07:00
Jon Skeet
baa4a21130 Cross-link descriptor when building from byte strings
This performs more testing for field descriptors built from byte
strings too, but that's mostly incidental. The chief intent is to
check that cross-linking occurs.
2018-09-10 22:00:36 +01:00
Feng Xiao
f8cd9b0fac
Merge pull request #5105 from sigurdm/invoke_plugin_via_cmd
On Windows invoke plugins using cmd.exe
2018-09-10 13:47:08 -07:00
Feng Xiao
3bf0245fd2
Merge pull request #5122 from elharo/guava20
update to Guava 20
2018-09-10 13:46:38 -07:00
Benjamin Peterson
188c44b117 Remove 2to3 code from setup.py. (#5114)
Python protobuf has long been a single-source codebase. 2to3 shouldn't need to run in setup.py.
2018-09-10 13:35:38 -07:00
Feng Xiao
e49bd66034 Merge remote-tracking branch 'google/3.6.x' 2018-09-07 17:49:20 -07:00
Jan Tattermusch
f8d56e929e
Merge pull request #5125 from jtattermusch/upport_kokoro_release_python
Upport kokoro/release/python from 3.6.x branch
2018-09-07 16:47:46 -07:00
Joshua Haberman
f9d8138376
Merge pull request #5109 from haberman/integrate
Down-integrate from google3.
2018-09-07 16:15:38 -07:00
Josh Haberman
e53be9bce4 Fixed Python extension compile. 2018-09-07 13:07:20 -07:00
Jan Tattermusch
7200550afa upport kokoro/release/python from 3.6.x branch 2018-09-07 12:32:20 -07:00