Commit Graph

77 Commits

Author SHA1 Message Date
Rob Widmer
48234f5f01 Make the new multi-level ruby tests fit the existing structure better and add them to the makefile 2021-01-14 12:26:04 -08:00
Paul Yang
823f351448
Port for php8 (#8105)
* Port for php8

* Port php c extension for php8

* Update composer.json

* Drop php7.0 support

* Update phpunit for php7.1 in c extension test

* Add back support for php7.0

* Add badge for php8 continuous build
2020-12-04 13:46:34 -08:00
Adam Cozzette
58f4260e8e Merged 3.13.x into master 2020-08-17 11:06:11 -07:00
Paul Yang
d4ca92962c
Port php c extension to php8 (#7793)
* Only ported c extension to php8.
* Didn't fixed the issue of throwing warnings for missing arginfo in bundled files.
* Tests not fixed, because syntax of phpunit (<7 vs >9.3) are not compatible.
* In next release, needs to drop php5 and php7.0 support (in order to use phpunit > 7)
2020-08-11 19:30:46 -07:00
Peter Newman
e2cc2de304
Fix lots of spelling errors (#7751)
* Fix a typo

* Fix lots of spelling errors

* Fix a few more spelling mistakes

* s/parsable/parseable/

* Don't touch the third party files

* Cloneable is the preferred C# term

* Copyable is the preferred C++ term

* Revert "s/parsable/parseable/"

This reverts commit 534ecf7675.

* Revert unparseable->unparsable corrections
2020-08-10 11:08:25 -07:00
Paul Yang
0929596575 Check realoneof in json parsing (#7763)
* Check realoneof in json parsing

* Fix whichoneof to also work for synthetic oneof
2020-08-07 14:44:49 -07:00
James Newton-King
d4abad8731
Optimize reading strings across segments 2020-07-01 20:32:29 +12:00
Tim Swast
29c83baecc
python: add sphinx docs (#6525)
* python: generate documentation with Sphinx and Read the Docs

Background:

Formerly, the Python protobuf reference documentation was built with
[Epydoc](http://epydoc.sourceforge.net/). This package has not been
updated since 2008, and it has inconsistent formatting (see internal
issue 131415575) with most Python documentation. Sphinx is used for the
official docs.python.org docs as well as most other Python packages,
including the Google client libraries and related packages, such as
https://googleapis.dev/python/google-api-core/latest/

To build the docs with Sphinx:

1. Install the needed packages (`sphinx`, `sphinxcontrib-napoleon` for
Google-style docstring support). I've created a conda environment file
to make this easier:

```
conda env create -f python/docs/environment.yml
```

2. (Optional) Generate reference docs files and regenerate index:

```
cd python
python generate_docs.py
cd ..
```

3. Run Sphinx.

```
cd python/docs
make html
```

About this change:

The script at `python/generate_docs.py` creates a ReStructured Text file
for each public module in the protobuf Python package. The script also
updates the table of contents in `python/docs/index.rst` to point to
these module references.

Future work:

Testing the docs build on PRs requires contributors to actually do some
setup work to configure builds on their fork. It'd be better if CI had a
docs build session to verify that the Sphinx docs generation at least
runs.

There are many warnings due to not-quite-correct docstrings in the
actual Python code itself. I'm choosing to ignore these errors to keep
the PR small, but I recommend you fix these and then enable "fail on
warnings" in the docs build on CI.

* add docs to EXTRA_DIST

* add instructions to build documentation to generate_docs.py

* exclude python/odcs from cpp_distcheck
2020-02-11 11:40:17 -08:00
Paul Yang
fe1790ca0d
Fix Multiple Request for PHP (#7008)
* Add scripts to test multirequest

* chmod ug+x multirequest.sh

* Add continuous test

* Compile c extension

* Class entry is obsolete in the second request
1) Needes to use class name in persistent map
2) Invalidate class entry stored in descriptor

* Add new files to dist

* Fix compile_extension

* Cleanup outputs for phpize
2019-12-12 13:59:51 -08:00
Paul Yang
c53e5b8e11
Avoid too much overhead in layout_init (#6716)
* Avoid initializing primitive fields in layout_init

* Avoid initializing string/bytes/message fields in layout_init

* Lazily create map when needed

* Lazily create repeated fields

* Change layout_init to only do memcpy

* Fix test for php-7.0

* Fix conformance test where default value of string/message map is not encoded

* Fix test for zts

* Clean up

* Fix comments
2019-10-29 12:48:24 -07:00
Paul Yang
ce942bcae1
Add binary conformance tests for map fields (#6560)
* Add binary conformance tests for map fields

* Update failure list

* Fix php conformance test

* Fix php conformance test

In 32-bit platform, int64 should be string. However, map iterator returns string key as integer.

* Add more test cases for map

* Update failure list
2019-09-03 10:47:32 -07:00
ST-DDT
5af81a442b
Use parameter name comment 2019-06-26 20:39:03 +02:00
Paul Yang
d7c4409589
Php 7.3 fix (#5434)
* Inherit from message instead of implement

When regestering class (implmenets other class) during MINIT, zend_class_implements
would call zend_class_entry->interface_gets_implemented(). In PHP-7.3 interface_gets_implemented shares the same location with create_object.
However, during MINIT, the global object storeage hasn't been initialized. And thus, caused segment fault in php 7.3.

* Use zend_string_init where interned string may be the value.
zend_string_dup will keep using the existing interned string.
In php 7.3, interned string cannot be destroyed from user's code.

* Uncommment debug code

* Use latest phpunit for each php versions

* Revert change in Dockerfile

* Update php test to use the new docker image

* Update composer

* Change docker organization

* Update phpunit

* Debug phpunit

* Store phpunit into bin dir in docker image

* Install valgrind to docker

* Fix compatibility test

* Remove generated_service_test from compatibility c extension test

* Update 32bit php test to the new docker image

* Install bison

* Fix build.sh

* Fix DOCKERIMAGE_PREFIX

* Fix basename

* Add comment to build_and_run_docker2.sh

* Remove commented code

* Fix comments
2018-12-18 10:57:03 -08:00
michaelbausor
6a51c03823 PHP: Add support for primitive types in setters (#5126)
* Add support for primitive types in setters

* Update to address PR feedback

* Add tests and fixes for repeated fields

* Remove repeated field code, add getters

* Cleanup, test getters and oneofs

* Move boxing logic into separate class

* Add tests for wrapper type constructor args

* Update to add new setXXXValue methods

* Fix tests for invalid values

* Fix c extension for wrapper accessors

* Fix the bug that well known types didn't call Message_construct

* Address PR comments

* Refactoring init message with array logic

* Add include path to protoc

* Add missing TSRM_LS defintion

* Fix TSRM_LS

* Fix dist check
2018-10-07 16:56:41 -07: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
Yuzhang Hu
9c7655c9fc Ignore python .egg file to make git status clean #5004 2018-08-05 02:58:30 -07:00
mkosieradzki
d6775fa8d6
Added support for Visual Studio 2017 in gitignore 2018-07-22 11:00:35 +02:00
Feng Xiao
143851ed25
Remove js_embed binary. (#4709)
* Remove js_embed binary.
2018-06-01 11:00:04 -07:00
Paul Yang
9ccc3e536c
Adopt ruby_package in ruby generated code. (#4627)
* Adopt ruby_package in ruby generated code.

* Add test for ruby_package
2018-05-17 17:11:06 -07:00
Thomas Hisch
451e0446ab Add __init__.py files to compiler and util subpackages (#4117)
The compiler and util subpackages are created by the build_py class in
setup.py. This has caused an issue in the protobuf package in
conda-forge (https://github.com/conda-forge/protobuf-feedstock/issues/40),
which is fixed by this commit.
2018-04-09 12:43:10 -07:00
Adam Cozzette
612b670086 Updated .gitignore to exclude downloaded gmock/ directory 2018-03-27 09:54:33 -07:00
Carlos O'Ryan
3c5442a95d Include googletest as a submodule (#3993)
Add googletest as a submodule in third_party/googletest.
2018-03-26 13:54:32 -07:00
Paul Yang
23adfeb003 Reserve unknown in Ruby (#3763)
* Reserve unknown in ruby

* Revert ruby tests. Wait for cpp impl for conformance test

* Add conformance test for preserving unknown

* Add unknown field conformance test to csharp failure list.

* Fix comments

* Fix comment

* Fix comments

* Fix typo

* Use stringsink_string directly

* Mark hd unused

* Remove unused encodeunknown_handlerfunc
2017-10-26 14:41:43 -07:00
Paul Yang
cd5f49d094 Fix ruby segment fault (#3708)
* Fix ruby segment fault

1) rb_ary_new cannot be called during allocate function. During allocate
fucntion, the containing object hasn't been marked and rb_ary_new may
invoke gc to collect containing object.
2) The global map should be marked before allocating it. Otherwise it
may be garbage collected.

* Add test

* Remove commented code

* Fix grammer error
2017-10-03 17:28:49 -07:00
Yilun Chong
91da852c50 update .gitignore 2017-06-28 11:39:05 -07:00
Yilun Chong
0255431ca7 revert .gitignore 2017-06-28 11:35:11 -07:00
Yilun Chong
0fa4e58525 change ignore 2017-06-27 18:31:44 -07:00
Jakob Buchgraber
d0e6f3b9ab bazel: add bazel symlinks to .gitignore 2017-06-16 12:39:32 +02:00
Paul Yang
25abd7b7e7 Add compatibility test for php. (#3041)
* Add compatibility test for php.

* Revert API incompatible change.
2017-05-05 11:14:11 -07:00
Adam Cozzette
9053033a50 Merge remote-tracking branch 'remotes/google/3.3.x' into merge-3.3-to-master 2017-04-27 14:55:53 -07:00
Paul Yang
190b5270c8 Make PHP c extension work with PHP7 (#2951) 2017-04-19 16:23:51 -07:00
Adam Cozzette
37c7b766b3 Merge pull request #2930 from anuraaga/dev_rag
Fix error message for int64 parse failure.
2017-04-04 09:31:14 -07:00
Adam Cozzette
10ea25133d Added compatibility tests for version 3.0.0 2017-04-03 12:55:20 -07:00
Anuraag Agrawal
11c902ea2e Add IntelliJ project to gitignore for java project. 2017-04-03 17:32:08 +09:00
Thomas Van Lenten
8adf57e0fa Add some new ignores for things generated in conformance. 2017-03-28 11:04:58 -04:00
Paul Yang
39756643df Add conformance test for php (#2655) 2017-02-01 12:47:58 -08:00
Adam Cozzette
1b3a0c16e6 Auto-generate well_known_types_embed.cc
Until now this file was just checked into the repo, but actually it
should be generated from any.js, struct.js, and timestamp.js. This
change updates the build system to make this happen. To make it work I
also had to remove some C++11 features from embed.cc.
2016-12-19 14:38:21 -08:00
Paul Yang
46ae90dc5e Make php generated code conform to PSR-4. (#2435)
1. Generate single file for each message.
2. Lazily initiate metadata.
2016-12-08 11:16:49 -08:00
Adam Cozzette
25dbc8b1ea Updated .gitignore with Java and JavaScript build artifacts 2016-09-29 16:20:43 -07:00
Bo Yang
c6fa9c71a5 Auto-generate proto files for tests. 2016-09-15 17:59:49 -07:00
Paul Yang
e0e54661f7 Check in php implementation. (#2052)
This pull request includes two implementation: C extension and PHP
package. Both implementations support encode/decode of singular,
repeated and map fields.
2016-09-15 11:09:01 -07:00
Thomas Van Lenten
80f65d2df8 Add note about JSON tests maybe being wrong. (#1992)
Add note about JSON tests maybe being wrong.

- Add note about the JSON test maybe not being correct yet.
- Add test to checks the generated names for double underscores to be sure they
  are what is expected.
2016-08-23 08:19:45 -04:00
Thomas Van Lenten
81564101ee Fix up ignores and conformance generation
- Update ruby conformance generation for rename of generated files that seems
  to have happened.
- Update gitignores for the above and for the no-warnings-test.
2016-08-15 16:33:22 -04:00
Thomas Van Lenten
daec44fa52 Expand the OS X/Xcode gitignores
- Add the folder CocoaPods will add to the root folder.
- Move and expand the entries in the objectivec directory.
2016-05-19 10:08:51 -04:00
Thomas Van Lenten
f367642103 Add two missing ignores for conformance directory. 2016-05-06 11:44:42 -04:00
CH Albach
5477f8cdba Manually down-integrate python JSON struct support from internal code base. 2016-01-29 18:10:50 -08:00
Thomas Van Lenten
1745f7eae9 Add support for the conformance test for objc when run on OS X 2015-11-18 11:58:19 -05:00
Thomas Van Lenten
42f2eee932 Cleanups of deps and ignores for conformance
- Hopefully complete the deps for other languages for the generated conformance proto sources.
- List the generated sources for cleanup by make's clean rules.
- Make the toplevel nuke the pyc files that can get created in the ObjC dir.
2015-11-16 11:29:59 -05:00
Thomas Van Lenten
f0411ec974 Update the Mac build script to include the conformance tests
- Kick off the conformance tests
- Add missing ignore for something generated by a build on the conformance directory.
2015-11-04 15:14:54 -05:00