Commit Graph

9040 Commits

Author SHA1 Message Date
Joshua Haberman
5aacba062b Resolved remaining conflict markers. 2022-02-08 18:38:48 -08:00
Joshua Haberman
42e806fbf2 Merge branch 'master' into sync-stage-2 2022-02-08 18:36:24 -08:00
Joshua Haberman
301d315dc4
Dropped support for Python < 3.7 (#9480)
* Drop Python versions <3.7.

* Updated README to clarify that Python 3.7 is the minimum.

* Removed more Python 3.5-specific code.

Also changed tests to skip missing interpreters.

* Invoke tox directly instead of through Python.

Hopefully this will pick up python3.

* Updated java_stretch image to bullseye to get Python >= 3.7.

* Use jdk11 instead of jdk8.

* Installed python2 for gtest.

* Use "python3 -m venv" instead of "virtualenv."

* Install python3-venv.
2022-02-08 18:31:50 -08:00
Joshua Haberman
f739286b1a For GCC < 4.9.0 use ::max_align_t instead of std::max_align_t. 2022-02-08 10:31:54 -08:00
Dimitris Koutsogiorgas
b5ab0b7a18 objective-c: Add objc_class_prefix generation option. 2022-02-08 08:22:51 -05:00
Florin Crișan
9ebb31726c
Add option to use external GTest in CMake (#8736)
If `-Dprotobuf_USE_EXTERNAL_GTEST=ON` is passed to CMake, it will use an external Google Test copy (i.e. by calling `find_package(GTest REQUIRED)`) rather than the one provided as a submodule.

This makes sense for larger projects that might already include Google Test and want to use a more standard CMake approach.

Also updated build instructions with this information, and more idiomatic usage.

Co-authored-by: Adam Cozzette <acozzette@google.com>
2022-02-07 20:41:29 -08:00
Florin Crișan
18c951efb1
Enable testing via CTest (#8737)
Convenience feature: enable users to test via the familiar `ctest` command rather than making the `check` target.

They would be able to use the familiar CMake pattern:
```
cmake -S source/protobuf -B build/protobuf ...
cmake --build build/protobuf
ctest --test-dir build/protobuf
cmake --install build/protobuf
```

This is a follow-up to 9f447fc9d3da93da29b8301f1a8ca57b1ea812d7
2022-02-07 17:38:38 -08:00
appledragon
5a0887fc65
for ios shared library export api visibility (#9160)
* for ios shared library export api visibility

* for shared library export api visibility

* for shared library export api visibility
2022-02-07 15:50:16 -08:00
Joshua Haberman
3ea30d8084
Merge pull request #9307 from owent-contrib/fix_9306
[CMAKE] `protobuf::libprotoc` and `protobuf::protoc` should be optional in legacy `protobuf-module.cmake` when crossing compiling.
2022-02-04 09:38:25 -08:00
Elliotte Rusty Harold
867436c0b8
add test for clone of non-empty message (#9193)
* add test for clone

* use var

* reorder
2022-02-04 16:54:43 +00:00
Deanna Garcia
c8b388a6cb Fixing java test 2022-02-04 00:23:34 +00:00
Deanna Garcia
8dc77b9957 Fix more tests 2022-02-03 20:46:48 +00:00
Deanna Garcia
5e0fc2f1df Fix java tests 2022-02-03 18:02:13 +00:00
Phil Clay
3be46483ba
Resolve more java field accessor name conflicts (#8198)
* Remove javanano from .gitignore.
Ignore java/lite/target

* Resolve more java field accessor name conflicts.

Previously, some proto field names would cause the java code generator to generate accessor names that conflict with method names from the message super classes/interfaces.
A list of field names that cause such conflicts previously existed, but the list did not contain every field name that would cause a conflict.
Additionally, only snake_case field names would be detected. If the field name was in camelCase, the conflict would not be detected.

This change adds the complete set of field names that will cause assessor name conflicts, and detects conflicts in both snake_case and camelCase field names.

Fixes #8142

* Prevent java accessor name conflicts for fields with leading underscores.
Previously, some protobuf field names beginning with leading underscores (e.g. _class) would cause uncompilable java code to be generated due to assessor name conflicts.
Now, non-conflicting java accessor method names are created for those fields

* Improve comments/documentation for conversion from snake case to camel case
Rename snakeCaseToCamelCase to snakeCaseToLowerCamelCase
Add snakeCaseToUpperCamelCase
Add clarifying in-line comments for field name generation
Remove explicit version numbers from references.

* Fix indents and typo

* Unnest <pre> tag

* improve grammar in comments
are colliding -> collide

* Remove ternary operator and improve comments

* Fix typo in comment
2022-02-03 12:49:57 -05:00
Nipunn Koorapati
937b56f57b
Match service argument names to abstract interface (#9418)
The base class/documentation suggest that the argument
names are `self` and `done`, while the runtime used
argument names `srvc` and `callback`.

`mypy.stubtest` was able to identify this - as it compares
the types (autogenerated by
[`mypy-protobuf`](https://github.com/dropbox/mypy-protobuf/))
to the actual code generated by protoc at runtime.

Since the stubs assume the generated code matches the abstract
interface in service.py - it saw these differences.
2022-02-03 09:14:44 -08:00
Deanna Garcia
ab2593041d Merge branch 'sync-stage' of github.com:deannagarcia/protobuf into sync-stage 2022-02-03 01:09:33 +00:00
Deanna Garcia
369388b472 More test fixes. 2022-02-03 01:09:18 +00:00
Deanna Garcia
b2ff4f82c2 Fixing tests 2022-02-03 01:05:20 +00:00
deannagarcia
fa4ba87aff
Merge branch 'master' into sync-stage 2022-02-02 15:24:33 -08:00
Stephen Kennedy
8495372e1e
[cleanup] Msvc warnings (#9263)
* Fix and reenable signed/unsigned warning C4018

* Only disable unary minus warning C4146 in tests
2022-02-02 15:10:15 -08:00
Deanna Garcia
2d87ce3cfe Fix test 2022-02-02 23:10:04 +00:00
Deanna Garcia
a2f7cfab27 Fixing more tests 2022-02-02 22:21:04 +00:00
Joshua Haberman
8c8fb0ec97
Merge pull request #9370 from brettmc/bugfix/php-8.1-deprecations
fixing php 8.1 deprecation warnings
2022-02-02 14:17:43 -08:00
Deanna Garcia
7dff52929f Fixing tests 2022-02-02 21:08:44 +00:00
Deanna Garcia
000da39ada Fix python tests 2022-02-02 19:21:42 +00:00
Deanna Garcia
d2ca349c2a Fix python tests 2022-02-02 18:48:58 +00:00
Deanna Garcia
e56d6936f3 Fix spelling 2022-02-02 18:35:49 +00:00
JCooky
55645ca513
Add cmake option protobuf_INSTALL for installation files (#7123) 2022-02-02 08:29:25 -08:00
Deanna Garcia
fc9fb726f1 Fix python and kotlin tests 2022-02-02 01:02:08 +00:00
Joel Johnson
a9cf69a0ed
Use matching soname when building with CMake as Makefile (#9178)
This updates the CMake support to additionally symlink the soversion value
to the generated shared library when so generated. This aligns the
generated soversion with that traditionally used by the Makefile build
workflow and provides cross-compatibility irrespective of build approach
used.

The primary version of the non-symlink library retains the actual
(non-SO) project version for clarity and compatibility with
installations built using prior versions of CMake support. An example of
the net resulting symlink structures is shown below, where the most
important aspect is that the symlink matching the embedded SONAME is
present (libprotobuf.so.30 in the example case).

Makefile:

    libprotobuf.so -> libprotobuf.so.30.0.0
    libprotobuf.so.30 -> libprotobuf.so.30.0.0
    libprotobuf.so.30.0.0

CMake:

    libprotobuf.so -> libprotobuf.so.30
    libprotobuf.so.30 -> libprotobuf.so.3.19.0.0
    libprotobuf.so.3.19.0.0

Fixes: #8635
2022-02-01 15:27:56 -08:00
Deanna Garcia
349738dde5 Fixing java and protoc builds 2022-02-01 23:22:23 +00:00
Biswapriyo Nath
7e5bfe8883
Fix checking Windows platform with preprocessor (#9460)
Check _WIN32 instead of _MSC_VER because the later one is for MSVC only.
This fixes building with mingw-w64 toolchain which uses GCC or Clang.
2022-02-01 13:58:39 -08:00
Deanna Garcia
b7fe12e367 Syncing from internal 2022-02-01 21:30:49 +00:00
Deanna Garcia
ab4585a695 Sync from Piper @425656941
PROTOBUF_SYNC_PIPER
2022-02-01 18:24:53 +00:00
deannagarcia
aa896f6389
Merge pull request #9459 from protocolbuffers/deannagarcia-patch-2
Update package.xml
2022-01-31 16:29:48 -08:00
deannagarcia
a6a66a9ac8
Update package.xml
Have PHP release notes link back to general release notes .
2022-01-31 16:10:49 -08:00
deannagarcia
c756e61878
Merge pull request #9430 from xoofx/fix-csharp-fielddesc-ispacked
Fixes NullReferenceException when accessing FieldDescriptor.IsPacked
2022-01-31 11:10:20 -08:00
Ivo List
15add1af49
Selectively add source or gen dir to includes. (#9438)
When both directories are added this results in protoc emitting a
"warning: directory does not exist.". This makes sense because when
there are no inputs from the other directory, it is also not present
n the sandbox where protoc is executed.
2022-01-28 16:44:42 -08:00
Adam Cozzette
fa57149caa
Merge pull request #9452 from acozzette/merge-3.19.x
Merge 3.19.x into master
2022-01-28 16:44:20 -08:00
Elliotte Rusty Harold
749243db7e
Must build project before running benchmarks (#9454)
* Must build project before running benchmarks

That is, it does not test the version downloaded from Maven central.

* Update README.md
2022-01-28 21:50:35 +00:00
Adam Cozzette
18521f6055 Merge branch '3.19.x' into merge-3.19.x 2022-01-28 17:42:21 +00:00
Jon Skeet
b926a7d209 Add ToProto() method to all C# descriptor classes
Fixes #9425.
2022-01-28 14:17:56 +00:00
Adam Cozzette
22d0e265de
Update protobuf version for 3.19.4 (#9449)
I also updated the PHP release notes in
php/ext/google/protobuf/package.xml.
2022-01-27 19:35:56 -08:00
Joshua Haberman
afeb6d8181
Merge pull request #9451 from haberman/ruby-dataloss-bugfix
Fixed data loss bug in Ruby extension
2022-01-27 18:20:42 -08:00
Joshua Haberman
98b8e055d5 Merge branch '3.19.x' into ruby-dataloss-bugfix 2022-01-27 18:17:23 -08:00
Joshua Haberman
eb301e1a33
Merge pull request #9450 from haberman/php-dataloss-bugfix
Fixed data loss bug in PHP C extension
2022-01-27 18:02:14 -08:00
Joshua Haberman
aceff710f4 Fixed data loss bug in Ruby extension. 2022-01-27 17:29:12 -08:00
Joshua Haberman
35a21c1249 Added CHANGES.txt entry. 2022-01-27 17:14:07 -08:00
Joshua Haberman
67995fb4e9 Fixed data loss bug with PHP C extension. 2022-01-27 17:06:41 -08:00
Adam Cozzette
779b97260d
Update CHANGES.txt for 3.19.4 release (#9448) 2022-01-27 16:27:45 -08:00