Skip to content

Commit

Permalink
Merge branch 'master' into 3.15.x
Browse files Browse the repository at this point in the history
  • Loading branch information
acozzette committed Apr 2, 2021
2 parents 878be35 + 97cb3a8 commit 87aa9ad
Show file tree
Hide file tree
Showing 248 changed files with 5,350 additions and 4,956 deletions.
4 changes: 2 additions & 2 deletions .github/mergeable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ mergeable:
regex: 'release notes: yes'
message: 'Please include release notes: yes'
- must_include:
regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel|cmake|protoc)'
message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: bazel, cmake, cleanup, conformance tests, integration, protoc.'
regex: '^(autotools|bazel|c#|c\+\+|cleanup|cmake|conformance tests|integration|go|java|javascript|objective-c|php|protoc|python|ruby|kotlin)'
message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: autotools, bazel, cmake, cleanup, conformance tests, integration, protoc.'
- must_include:
regex: 'release notes: no'
message: 'Please include release notes: no'
2 changes: 1 addition & 1 deletion .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
with:
check_filenames: true
skip: ./.git,./conformance/third_party,*.snk,*.pb,*.pb.cc,*.pb.h,./src/google/protobuf/testdata,./objectivec/Tests,./python/compatibility_tests/v2.5.0/tests/google/protobuf/internal
ignore_words_list: "alow,alse,ba,cleare,copyable,cloneable,dedup,dur,errorprone,files',fo,fundementals,hel,importd,inout,leapyear,nd,nin,ois,ons,parseable,process',te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od"
ignore_words_list: "alow,alse,ba,cleare,copyable,cloneable,dedup,dur,errorprone,files',fo,fundementals,hel,importd,inout,leapyear,nd,nin,ois,ons,parseable,process',te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od,OptIn"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ src/**/*.trs

# JavaBuild output.
java/core/target
java/lite/target
java/util/target
javanano/target
java/.idea
Expand Down
44 changes: 9 additions & 35 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,6 @@ exports_files(["LICENSE"])
# build configuration
################################################################################

# TODO(yannic): Remove in 3.14.0.
string_flag(
name = "incompatible_use_com_google_googletest",
build_setting_default = "true",
values = ["true", "false"]
)

config_setting(
name = "use_com_google_googletest",
flag_values = {
"//:incompatible_use_com_google_googletest": "true"
},
)

GTEST = select({
"//:use_com_google_googletest": [
"@com_google_googletest//:gtest",
],
"//conditions:default": [
"//external:gtest",
],
})

GTEST_MAIN = select({
"//:use_com_google_googletest": [
"@com_google_googletest//:gtest_main",
],
"//conditions:default": [
"//external:gtest_main",
],
})

################################################################################
# ZLIB configuration
################################################################################
Expand Down Expand Up @@ -571,6 +539,7 @@ COMMON_TEST_SRCS = [

cc_binary(
name = "test_plugin",
testonly = True,
srcs = [
# AUTOGEN(test_plugin_srcs)
"src/google/protobuf/compiler/mock_code_generator.cc",
Expand All @@ -580,7 +549,8 @@ cc_binary(
deps = [
":protobuf",
":protoc_lib",
] + GTEST,
"@com_google_googletest//:gtest",
],
)

cc_test(
Expand All @@ -592,7 +562,9 @@ cc_test(
],
deps = [
":protobuf_lite",
] + GTEST_MAIN,
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
Expand Down Expand Up @@ -695,7 +667,9 @@ cc_test(
":cc_test_protos",
":protobuf",
":protoc_lib",
] + PROTOBUF_DEPS + GTEST_MAIN,
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
] + PROTOBUF_DEPS,
)

################################################################################
Expand Down
42 changes: 42 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

C++
* The ::pb namespace is no longer exposed due to conflicts.
* Allow MessageDifferencer::TreatAsSet() (and friends) to override previous
calls instead of crashing.
* Reduce the size of generated proto headers for protos with `string` or
`bytes` fields.
* Move arena() operation on uncommon path to out-of-line routine
* For iterator-pair function parameter types, take both iterators by value.
* Code-space savings and perhaps some modest performance improvements in
RepeatedPtrField.
* Eliminate nullptr check from every tag parse.
* Remove unused _$name$_cached_byte_size_ fields.
* Serialize extension ranges together when not broken by a proto field in the
middle.
* Do out-of-line allocation and deallocation of string object in ArenaString.
* Streamline ParseContext::ParseMessage<T> to avoid code bloat and improve
performance.
* New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}.
* Fix undefined behavior warning due to innocuous uninitialization of value
on an error path.
* Avoid expensive inlined code space for encoding message length for messages
>= 128 bytes and instead do a procedure call to a shared out-of-line routine.
* util::DefaultFieldComparator will be final in a future version of protobuf.
Subclasses should inherit from SimpleFieldComparator instead.

Java:
* Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented.
* Exceptions thrown while reading from an InputStream in parseFrom are now
included as causes.
* Support potentially more efficient proto parsing from RopeByteStrings.
* Clarify runtime of ByteString.Output.toStringBuffer().

Python
* Fixed a bug in text format where a trailing colon was printed for repeated field.
* When TextFormat encounters a duplicate message map key, replace the current
one instead of merging.

JavaScript
* Make Any.pack() chainable.

2021-04-02 version 3.15.7 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)

C++
Expand Down
1 change: 0 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ java_EXTRA_DIST=
java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \
java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \
java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \
java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \
java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \
java/lite.md \
java/lite/BUILD \
Expand Down
21 changes: 9 additions & 12 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ http_archive(
],
)

http_archive(
name = "com_github_google_benchmark",
sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c",
strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677",
urls = [
"https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip",
],
)

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//:protobuf_deps.bzl", "protobuf_deps")

Expand All @@ -29,18 +38,6 @@ bind(
actual = "//util/python:python_headers",
)

# TODO(yannic): Remove in 3.14.0.
bind(
name = "gtest",
actual = "@com_google_googletest//:gtest",
)

# TODO(yannic): Remove in 3.14.0.
bind(
name = "gtest_main",
actual = "@com_google_googletest//:gtest_main",
)

jvm_maven_import_external(
name = "guava_maven",
artifact = "com.google.guava:guava:18.0",
Expand Down
65 changes: 65 additions & 0 deletions benchmarks/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_java//java:defs.bzl", "java_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

proto_library(
name = "benchmarks_proto",
srcs = [
"benchmarks.proto",
],
strip_import_prefix = "/benchmarks",
visibility = [
"//benchmarks:__subpackages__",
],
)

cc_proto_library(
name = "benchmarks_cc_proto",
visibility = [
"//benchmarks:__subpackages__",
],
deps = [
"benchmarks_proto",
],
)

java_proto_library(
name = "benchmarks_java_proto",
visibility = [
"//benchmarks:__subpackages__",
],
deps = [
"benchmarks_proto",
],
)

proto_library(
name = "google_size_proto",
srcs = [
"google_size.proto",
],
strip_import_prefix = "/benchmarks",
visibility = [
"//benchmarks:__subpackages__",
],
)

cc_proto_library(
name = "google_size_cc_proto",
visibility = [
"//benchmarks:__subpackages__",
],
deps = [
"google_size_proto",
],
)

java_proto_library(
name = "google_size_java_proto",
visibility = [
"//benchmarks:__subpackages__",
],
deps = [
"google_size_proto",
],
)
15 changes: 15 additions & 0 deletions benchmarks/cpp/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
name = "cpp",
srcs = [
"cpp_benchmark.cc",
],
tags = ["benchmark"],
deps = [
"//:protobuf",
"//benchmarks:benchmarks_cc_proto",
"//benchmarks/datasets:cc_protos",
"@com_github_google_benchmark//:benchmark_main",
],
)
59 changes: 59 additions & 0 deletions benchmarks/datasets/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_java//java:defs.bzl", "java_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

filegroup(
name = "datasets",
srcs = [
"//benchmarks/datasets/google_message1/proto2:datasets",
"//benchmarks/datasets/google_message1/proto3:datasets",
"//benchmarks/datasets/google_message2:datasets",
"//benchmarks/datasets/google_message3:datasets",
"//benchmarks/datasets/google_message4:datasets",
],
visibility = [
"//benchmarks:__subpackages__",
],
)

proto_library(
name = "protos",
visibility = [
"//benchmarks:__subpackages__",
],
deps = [
"//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_proto",
"//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_proto",
"//benchmarks/datasets/google_message2:benchmark_message2_proto",
"//benchmarks/datasets/google_message3:benchmark_message3_proto",
"//benchmarks/datasets/google_message4:benchmark_message4_proto",
],
)

cc_library(
name = "cc_protos",
visibility = [
"//benchmarks:__subpackages__",
],
deps = [
"//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_cc_proto",
"//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_cc_proto",
"//benchmarks/datasets/google_message2:benchmark_message2_cc_proto",
"//benchmarks/datasets/google_message3:benchmark_message3_cc_proto",
"//benchmarks/datasets/google_message4:benchmark_message4_cc_proto",
],
)

java_library(
name = "java_protos",
visibility = [
"//benchmarks:__subpackages__",
],
exports = [
"//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_java_proto",
"//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_java_proto",
"//benchmarks/datasets/google_message2:benchmark_message2_java_proto",
"//benchmarks/datasets/google_message3:benchmark_message3_java_proto",
"//benchmarks/datasets/google_message4:benchmark_message4_java_proto",
],
)
44 changes: 44 additions & 0 deletions benchmarks/datasets/google_message1/proto2/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_java//java:defs.bzl", "java_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")

filegroup(
name = "datasets",
srcs = [
"dataset.google_message1_proto2.pb",
],
visibility = [
"//benchmarks/datasets:__pkg__",
],
)

proto_library(
name = "benchmark_message1_proto2_proto",
srcs = [
"benchmark_message1_proto2.proto",
],
strip_import_prefix = "/benchmarks",
visibility = [
"//benchmarks/datasets:__pkg__",
],
)

cc_proto_library(
name = "benchmark_message1_proto2_cc_proto",
visibility = [
"//benchmarks/datasets:__pkg__",
],
deps = [
"benchmark_message1_proto2_proto",
],
)

java_proto_library(
name = "benchmark_message1_proto2_java_proto",
visibility = [
"//benchmarks/datasets:__pkg__",
],
deps = [
"benchmark_message1_proto2_proto",
],
)
Loading

0 comments on commit 87aa9ad

Please sign in to comment.