Commit Graph

8606 Commits

Author SHA1 Message Date
xidang
914c6fe101
Fix #8748 tests.exe link failure under mingw/mingw64 (#8751) 2021-07-30 09:04:40 -07:00
Yuriy Chernyshov
7326b571d2
Fix undefined symbol error around SharedCtor() (#8827)
* Fix undefined symbol error around SharedCtor()

Apparently, #8532 was incorrect if applied to 3.17.x branch.

3.17.x changed code generation to mark `SharedCtor()` and `SharedDtor()` as inline in .pb.cc.

It looks like we have a compile-time undefined behavior in C++ now. As cppreference.com [says](https://en.cppreference.com/w/cpp/language/inline):

_The definition of an inline function <...> must be reachable in the translation unit where it is accessed (not necessarily before the point of access)._

As protobuf allows custom plugins to generate custom code, there is no limitation on where SharedCtor couble be possible referenced from. In our case we have SharedCtor invoked from corresponding `.pb.h` code, thus triggering:
```
ld: error: undefined symbol: package::Message::SharedCtor()`
>>> referenced by file.pb.h:$$$$
```

If this patch is not applicable, I can take a look into changing the code generation, but doing this will be harder then removing _inline_.

* Regenerate checked-in generated .pb.cc files
2021-07-29 14:05:00 -07:00
Matt Kulukundis
d835808b7a remove various broken build status tags 2021-07-29 10:14:29 -04:00
deannagarcia
53365065d9
Merge pull request #8821 from georgthegreat/patch-1
Fix some -Wunused-parameter warnings in cpp_helpers.h
2021-07-26 15:19:43 -07:00
deannagarcia
81cda3dfd1
Merge pull request #8832 from busunkim96/patch-1
Add syntax highlighting and fix Ruby and Python comment syntax
2021-07-26 15:19:00 -07:00
Andrew Parmet
18b1b21aba
update protokt options reference (#8834) 2021-07-26 11:11:02 -07:00
Bu Sun Kim
6e0a456c77
Fix comment syntax for Ruby and Python 2021-07-20 17:58:29 -06:00
Bu Sun Kim
c9baf39caa
Add syntax highlighting for code blocks 2021-07-20 17:50:27 -06:00
Adam Cozzette
d662ec9c2e
Update the automake and Bazel configs to be consistent about field_access_listener.cc (#8823)
In an earlier change I moved field_access_listener.cc from the lite
runtime to the full runtime in the CMake configuration, but this caused
//:build_files_updated_unittest to start failing because it expects all
three build systems to be consistent. To fix that, I updated the
Automake configuration and then ran ./update_file_lists.sh to propagate
that change to the other configs.
2021-07-16 12:26:09 -07:00
Yuriy Chernyshov
f2effd8c67
Fix some -Wunused-parameter warnings in cpp_helpers.h 2021-07-16 13:18:52 +03:00
Derek Perez
b90ec9c242
updating caliper to latest maven version. (#8813)
Fixes #8665
2021-07-13 15:58:40 -07:00
Damon Cai
a420f23d4c
Remove JvmField annotations from Kotlin private properties (#8804) (#8811) 2021-07-13 15:25:00 -07:00
Yuriy Chernyshov
7b1f7938bc
Support arena allocation of google::protobuf::AnyMetadata (#8758) 2021-07-12 11:47:03 -07:00
Thomas Van Lenten
4b3da9f618 Revert "Add option for eliding property metadata from messages"
This reverts commit ca3674b7d5.

While there are savings, it ends up being to easy/common to run into issues with
AppStore validation since the selector usage now appears to be a possible match
for private apis vs. for selectors/properties in the generated code.
2021-07-12 09:47:16 -04:00
Thomas Van Lenten
378238eae8 Add some knobs tweak what is generated.
These aren't "official" options and could changed/removed in the future, and
that wouldn't be considered a breaking change.
2021-07-09 17:19:52 -04:00
Yuriy Chernyshov
cda795437d
Remove deprecated version of SetTotalBytesLimit() (#8794)
* Remove deprecated version of SetTotalBytesLimit()

It has been depcated for at least 3 years.
Worst (backward incompatible) things happened during this period.

I think this method could be safely removed, as the client code fix is trivial.

* Fix coded_stream_unittest.cc
2021-07-09 14:07:36 -07:00
Brent Shaffer
2126123b53
PHP: add new keywords to missing test (#8801) 2021-07-08 12:54:08 -07:00
Florin Crișan
0444e07dc9
Fix #7047 Safely handle setlocale (#8735)
* fix #7074 Safely handle setlocale

`setlocale` returns a pointer to a buffer containing the current locale name.
This needs to be copied into a `std::string` or it will be overwritten by the next call.

Trying to call `setlocale` with a non-null, invalid pointer can have unpredictable results, such as
```
[ RUN      ] StringPrintfTest.Multibyte
minkernel\crts\ucrt\src\appcrt\convert\mbstowcs.cpp(246) : Assertion failed: (pwcs == nullptr && sizeInWords == 0) || (pwcs != nullptr && sizeInWords > 0)
```

`setlocale` can also return a `nullptr` if it fails, but we assert against that.

* stringprintf_unittest.cc: Replace `new char[n+1]` with `std::array`

Prefer safer alternative to naked pointers.

This is a follow-up to 1dd313cd0611ac13257c075a977d46c874c42652
2021-07-08 11:14:49 -07:00
c-parsons
d652d8059c
Update rules_jvm_external to 4.1 (#8800) 2021-07-08 09:05:05 -07:00
Damien Neil
3588a77a86
field_presence.md: fix Go example (#8788)
Go generated code does not have Has methods.

Remove extraneous parentheses and semicolons.
2021-07-07 17:22:34 -07:00
Brent Shaffer
d2c82dff39
fix: missing comma in PHP names.c and generator.cc (#8787)
* Update names.c

* Update php_generator.cc
2021-07-07 13:02:34 -07:00
Thomas Van Lenten
4b77b73369 ObjC: Fix logic error in exception loading. 2021-07-01 12:16:39 -04:00
Thomas Van Lenten
e60ec85b9f Allow suppression of objc prefix checks.
- Accept "-" as the expected prefixes file and turn off all validations of
  prefixes (even the Apple conventions).
- Reflow some of the prefix checks to hopefully make things a little easier
  to follow.
- Don't print warnings about updates to the expected prefix file until there is
  a file.
2021-06-30 12:51:05 -04:00
Matt Fowles Kulukundis
9087da2b7c
Merge pull request #7268 from bshaffer/patch-2
PHP: Adds "finally", "fn", "match", and "yield" to reserved names
2021-06-29 13:00:01 -04:00
Brent Shaffer
d995c1c182 update counts 2021-06-29 09:17:25 -07:00
Brent Shaffer
bade043986 update reserved names: add finally, fn, match, yield 2021-06-29 07:56:08 -07:00
Adam Cozzette
336ed1820a
Move field_access_listener from libprotobuf-lite to libprotobuf (#8775)
This should fix #8768. The field access listener code can't build
successfully as part of protobuf-lite because it relies on descriptors.
2021-06-28 16:07:28 -07:00
Derek Perez
c684434ecb
creating a single target to rollup maven artifacts (#8776) 2021-06-28 14:38:25 -07:00
Derek Perez
5df472af15
use our java tests target instead of recursive walk (#8777) 2021-06-28 14:31:56 -07:00
Marcel Lanz
01ac995c94
I've requested a block of 5 extension numbers. We already have two concrete extensions that we need ids for. Our project is under active development and we can imagine a number of other extensions that we will want in future, so we thought we'd start by registering a block of 5, instead of raising a new PR here each time we need a new one (#8772) 2021-06-28 11:52:54 -07:00
Arthur O'Dwyer
ed8b2e6f62
Stop using std::iterator (deprecated in C++17). (#8741) 2021-06-28 11:46:00 -07:00
deannagarcia
09b8ade1d5
Merge pull request #8770 from deannagarcia/updateBzlVersion
Adding protobuf_version.bzl to update_version.py
2021-06-28 10:40:17 -07:00
Ilya Konstantinov
991bcada05
Raise ParseError when JSON string is expected and not given (#7935)
Raise ParseError when JSON string is expected and not given
2021-06-27 06:57:47 +08:00
Deanna Garcia
66d26f3fe6 Adding protobuf_version.bzl to get updated version in python script 2021-06-25 21:07:31 +00:00
deannagarcia
611a08ee00
Merge pull request #8752 from deannagarcia/rulesJvmExternal
Create java_export targets
2021-06-25 13:49:30 -07:00
Derek Perez
9276968326
Detect Windows vs Non-Windows execution context in tests. (#8767) 2021-06-25 12:55:11 -07:00
deannagarcia
318a48ac25
Merge pull request #8762 from deannagarcia/fixUtilBug
Fix failing java7 linux test
2021-06-25 10:13:43 -07:00
Deanna Garcia
1e8457f8f8 Adding util tests 2021-06-24 22:06:55 +00:00
Dave MacLachlan
3fd4d3fe8e Fix up objectivec sources to simplfy import into Google. 2021-06-24 17:46:51 -04:00
Thomas Van Lenten
cf12bffd9d [ObjC] Add support for using the proto package to prefix symbols.
This likely should have been the default from the start, as without it is way to
common to get symbol collisions between different proto files. It would be nice
to support a "migration" mode where both names are created to aid it moving code
to this model, but with ObjC `@class` decls being very common to avoid header
imports to control rebuilds/etc., it doesn't work as an `@class` usage will
error if one also uses `@compatibility_alias`. Falling back to `#define` the two
together also doesn't work as the header with the `@class` will cause methods to
get defined with one interface, but when methods taking those types are define
will likely #import the generate header and thus get the define and end up with
a different signature. So for now, there is no migration support and code has to
be updated in one shot with enable the new prefixing.

- Add a generation option to enable this change in generation.
- Add a second generation option to provide a list of proto package that are
  exceptions from using the proto package. This allows easier
  migration/updating of code one package at a time.
2021-06-24 16:09:41 -04:00
Deanna Garcia
41e89c7d5c Don't test kotlin if not in jdk8 2021-06-24 18:21:49 +00:00
Derek Perez
2ea5c9951c
Fix for WIndows Bazel CI (#8761) 2021-06-24 10:58:39 -07:00
Dave MacLachlan
ca3674b7d5 Add option for eliding property metadata from messages
Adds an option to protoc `--objc_opt=elide_message_metadata` to remove all the property
metadata from message classes. This significantly reduces the codegen size of the clases.
The downside is that iterating through properties using objective c runtime calls will no
longer function. This is mitigated by the fact that most (all?) of the information that
folks are interested in can be extracted via the message descriptor.

We do this by defining our own classes using the `GPB_MESSAGE_SUBCLASS_IMPL` macro.
2021-06-23 14:23:23 -04:00
Jie Luo
e7440d2f13
Install python38/39 on windows (#8757)
Create install_python_interpreters.ps1
Install python38/39 on windows
2021-06-23 13:40:30 +08:00
Derek Perez
91bbdc90e3
Ensure testdata text always uses \n newlines. (#8756) 2021-06-22 11:48:33 -07:00
Deanna Garcia
c02b5824d0 Adding new pom template files to Makefile. 2021-06-22 17:04:03 +00:00
Derek Perez
e9ffe09c8f
avoid using Bazel latest. (#8753) 2021-06-22 09:35:30 -07:00
Deanna Garcia
1f1ed9c62f Changing one more instance of VERSION 2021-06-21 23:07:29 +00:00
Deanna Garcia
96cffb3ac3 Removing dependencies and renaming bazel version file 2021-06-21 23:03:51 +00:00
Deanna Garcia
89a9f459e9 Changing BUILD files and adding pom templates 2021-06-21 22:28:17 +00:00