Commit Graph

7725 Commits

Author SHA1 Message Date
Jan Tattermusch
6a69690464 basic version of WriteMessagesBenchmark 2020-06-11 09:28:25 +02:00
Jon Skeet
1dae8fdd62 Add support for proto2 JSON parsing in C# conformance tests 2020-06-11 06:43:29 +01:00
Jon Skeet
ff70af6cfc Changes how JSON formatting works for fields supporting presence
Fixes #7486.

Note that this changes the behavior for message fields where
"WithFormatDefaultValues(true)" has been specified. This is
effectively fixing a bug, but will need to be noted in the release
notes.

Basically, FormatDefaultValues only affects fields that don't
support presence - most commonly, singular primitive non-optional
fields in proto3.
2020-06-11 06:43:29 +01:00
Jan Tattermusch
2350e90a85 add new C# files to Makefile.am 2020-06-10 16:58:22 +02:00
Joshua Haberman
f1ce8663ac
De-duplicated code to generate PHP protos and install phpunit. (#7605)
* De-duplicated code to generate PHP protos and install phpunit.

* Removed all references to generate_php_test_proto.

* Replaced with internal_build_cpp.

* Make Timestamp::__construct() static to avoid conflicts with MongoDB.

* Replicated PHPUnit versions and added new script to Makefile.am.

* Fixed filename in Makefile.am.

* Disabled test that SEGV's on macOS.

* Removed extraneous "set -e".

* Make sure generate_protos.sh happens on every test path.

* Removed stray '$' chars.

* Added proper support for aggregate_metadata tests. But now I get a stack overflow.

Stack overflow:
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16
/Users/haberman/code/protobuf/php/tests/generated/GPBMetadata/Proto/TestDescriptors.php:16

namespace GPBMetadata\Proto;

class TestDescriptors
{
    public static $is_initialized = false;

    public static function initOnce() {
        $pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
        if (static::$is_initialized == true) {
          return;
        }
        \GPBMetadata\Proto\TestDescriptors::initOnce();
        $pool->internalAddGeneratedFile(hex2bin(
            ""
        ), true);
        static::$is_initialized = true;
    }
}

* Fixed and verified metadata aggregation testing.
2020-06-09 15:40:29 -07:00
Thomas Van Lenten
9f546ba61b ObjC Support a runtime import override.
Option to add a prefix to generated #imports incase ObjC Protos are
used in a build system where one wants to avoid adding a header
search path and have more complete imports.
2020-06-09 13:05:50 -04:00
Jan Tattermusch
549dc9a412 optimize writing fixed32 and fixed64, fix benchmark 2020-06-09 17:59:32 +02:00
Jan Tattermusch
5eec497d3b fix C# CompatibilityTests 2020-06-09 16:43:24 +02:00
Thomas Van Lenten
ce8b7af46b Update the brew workflow
- Remove the `brew install`; the kokoro image already has it, just
  update/upgrade instead.
- Remove `prune`, logs had:
    """
    Error: Unknown command: prune
    """
- Remove `uninstall`, logs had:
    """
    Error: Refusing to uninstall /usr/local/Cellar/cmake/3.16.4 and /usr/local/Cellar/icu4c/64.2
    because they are required by ceres-solver, ffmpeg, harfbuzz, libass and opencv, which are currently installed.
    You can override this and force removal with:
      brew uninstall --ignore-dependencies node icu4c cmake wget
    """
- Skip installing some things since they are already in the base image, logs
  had:
    """
    Warning: gflags 2.2.2 is already installed and up-to-date
    To reinstall 2.2.2, run `brew reinstall gflags`
    Warning: openssl@1.1 1.1.1g is already installed and up-to-date
    To reinstall 1.1.1g, run `brew reinstall openssl@1.1`
    Warning: pcre 8.44 is already installed and up-to-date
    To reinstall 8.44, run `brew reinstall pcre`
    """
- Don't install gpg gpg2 as gnupg is already installed, also use gpg instead of
  gpg2 for commands (and update the commands), logs had:
    """
    kokoro/macos/prepare_build_macos_rc: line 44: gpg2: command not found
    kokoro/macos/prepare_build_macos_rc: line 45: gpg2: command not found
    """
- Add env guards to control all the option installs and only request them be
  installed in the cases that need it.  This avoids having to install/update
  the things like ruby when some other tool only needed in some configs is
  install differently and could have conflicts.
- Switch to brew for cocoapods to avoid compat issues on the supporting
  libraries.
2020-06-09 09:57:17 -04:00
Bart Hertog
2655a0aa0f Added Embedded Proto to third_party.md. 2020-06-08 11:12:51 -07:00
Jan Tattermusch
e346fde63b remove commented out code 2020-06-08 17:19:19 +02:00
Jan Tattermusch
c06812b0b2 address a few TODOs 2020-06-08 17:13:15 +02:00
Jan Tattermusch
19c0d73fb9 test WriteContext writing with multiple flushes 2020-06-08 17:03:51 +02:00
Jan Tattermusch
53708e2f15 test writing to a stackalloc buffer 2020-06-08 17:03:03 +02:00
Jan Tattermusch
e14a5c8fe6 address a few TODOs 2020-06-08 16:23:33 +02:00
Jan Tattermusch
43dcee2fa9 remove some todos 2020-06-08 15:54:01 +02:00
Jan Tattermusch
3375e251f9 optimize writing non-ascii strings 2020-06-08 15:38:36 +02:00
Jan Tattermusch
3dad187707 add benchmark for writing of NonAsciiStrings 2020-06-08 12:25:19 +02:00
Jan Tattermusch
8a2d5884bf address review comments 2020-06-08 11:19:57 +02:00
Jan Tattermusch
daada70233
Merge pull request #7596 from jtattermusch/safe_span_accessors
annotate ByteString.Span and ByteString.Memory as SecuritySafeCritical
2020-06-08 07:56:50 +02:00
Anton Kast
4d6712e739
Enable experimental presence detection in JS. (#7592)
Co-authored-by: David L. Jones <dlj@google.com>
2020-06-05 16:39:02 -07:00
Thomas Van Lenten
c6c8bab9e2 Move runtime import writing into a helper.
File and ImportWriter duplicated the logic, so move it to a helper (on
ImportWriter), and share the impl instead of duplicating it since it
includes some conditional logic around Framework based import support.
2020-06-05 16:23:30 -04:00
Thomas Van Lenten
57be643a36 Now that the paths are the same, use one ivar to track the values.
This changes when we moved the WKTs to the root of the runtime package.
2020-06-05 16:23:30 -04:00
Jan Tattermusch
a296413b5a optimize WriteFloat 2020-06-05 14:41:07 +02:00
Jan Tattermusch
886c263a3c initial version of write benchmarks 2020-06-05 14:41:07 +02:00
Jan Tattermusch
a6d1ed1712 annotate ByteString.Span and ByteString.Memory as SecuritySafeCritical 2020-06-03 17:09:03 +02:00
Jan Tattermusch
b2c94974b2 remove a TODO 2020-06-03 17:05:21 +02:00
Jan Tattermusch
56372898cf test writing with different blocksizes 2020-06-03 16:58:02 +02:00
Jan Tattermusch
f9f92a6dd2 increase test coverage 2020-06-03 16:26:05 +02:00
Jan Tattermusch
94e64f2c0b a bit more cleanup 2020-06-03 16:12:16 +02:00
Jan Tattermusch
ba61d76e52 simplify serialization to single span 2020-06-03 15:54:29 +02:00
Jan Tattermusch
b3cdba1cfd increase test coverage 2020-06-03 15:50:07 +02:00
Jan Tattermusch
7bfaaba534 cleanup coded output stream 2020-06-03 15:48:34 +02:00
Jan Tattermusch
9039103637 message extensions + refactor 2020-06-03 15:32:20 +02:00
Jan Tattermusch
8dbf707aa0 add more tests 2020-06-03 14:47:55 +02:00
Jan Tattermusch
1e1d455423 add WriteFloat TODO 2020-06-03 14:46:27 +02:00
Jan Tattermusch
2bce090f32 add more tests 2020-06-03 14:36:39 +02:00
Jan Tattermusch
ecbb29d354 add WriteContext.Flush() method 2020-06-03 14:22:40 +02:00
Jan Tattermusch
3cdc107bda fix bug in RefreshBuffer 2020-06-03 14:11:44 +02:00
Joshua Haberman
5f5efe50c5
Added changelog entries for all changes already merged from google3. (#7585) 2020-06-03 00:12:51 -07:00
Jan Tattermusch
efbadb6c73
Merge pull request #7412 from JamesNK/jamesnk/repeated-fixed-parsing
Improve performance of parsing repeated fixed sized types
2020-06-03 08:55:04 +02:00
Joshua Haberman
31ebe2ac71
Merge pull request #7590 from haberman/merge-release-branch
Merge release branch
2020-06-02 15:12:47 -07:00
Thiago C. D'Ávila
28cc693f3d
Initial module docstring for python _pb2 (#7528)
Generated Python modules now have a module-level docstring.
2020-06-02 14:45:30 -07:00
Thomas Van Lenten
b9cf3866c5 Tweak return types for GetSupportedFeatures to unit64_t. 2020-06-02 17:11:50 -04:00
Joshua Haberman
b971243fe0 Merge branch '3.12.x' into merge-release-branch 2020-06-02 13:24:30 -07:00
James Newton-King
921bdaaa61
Improve repeated fixed parsing performance 2020-06-03 07:06:27 +12:00
Jan Tattermusch
90d4969bd1 LegacyGeneratedCodeTest now passing 2020-06-02 19:58:04 +02:00
Jan Tattermusch
361c933a58 annotate ByteString.Span and ByteString.Memory as SecuritySafeCritical 2020-06-02 19:58:04 +02:00
Jan Tattermusch
9070389516 regenerate code 2020-06-02 19:58:04 +02:00
Jan Tattermusch
2b9a73e948 fix codegen 2020-06-02 19:58:04 +02:00