Skip to content

Commit 87aa9ad

Browse files
committed
Merge branch 'master' into 3.15.x
2 parents 878be35 + 97cb3a8 commit 87aa9ad

File tree

248 files changed

+5350
-4956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+5350
-4956
lines changed

.github/mergeable.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ mergeable:
1111
regex: 'release notes: yes'
1212
message: 'Please include release notes: yes'
1313
- must_include:
14-
regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel|cmake|protoc)'
15-
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.'
14+
regex: '^(autotools|bazel|c#|c\+\+|cleanup|cmake|conformance tests|integration|go|java|javascript|objective-c|php|protoc|python|ruby|kotlin)'
15+
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.'
1616
- must_include:
1717
regex: 'release notes: no'
1818
message: 'Please include release notes: no'

.github/workflows/codespell.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
with:
1414
check_filenames: true
1515
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
16-
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"
16+
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"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ src/**/*.trs
8383

8484
# JavaBuild output.
8585
java/core/target
86+
java/lite/target
8687
java/util/target
8788
javanano/target
8889
java/.idea

BUILD

+9-35
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,6 @@ exports_files(["LICENSE"])
1414
# build configuration
1515
################################################################################
1616

17-
# TODO(yannic): Remove in 3.14.0.
18-
string_flag(
19-
name = "incompatible_use_com_google_googletest",
20-
build_setting_default = "true",
21-
values = ["true", "false"]
22-
)
23-
24-
config_setting(
25-
name = "use_com_google_googletest",
26-
flag_values = {
27-
"//:incompatible_use_com_google_googletest": "true"
28-
},
29-
)
30-
31-
GTEST = select({
32-
"//:use_com_google_googletest": [
33-
"@com_google_googletest//:gtest",
34-
],
35-
"//conditions:default": [
36-
"//external:gtest",
37-
],
38-
})
39-
40-
GTEST_MAIN = select({
41-
"//:use_com_google_googletest": [
42-
"@com_google_googletest//:gtest_main",
43-
],
44-
"//conditions:default": [
45-
"//external:gtest_main",
46-
],
47-
})
48-
4917
################################################################################
5018
# ZLIB configuration
5119
################################################################################
@@ -571,6 +539,7 @@ COMMON_TEST_SRCS = [
571539

572540
cc_binary(
573541
name = "test_plugin",
542+
testonly = True,
574543
srcs = [
575544
# AUTOGEN(test_plugin_srcs)
576545
"src/google/protobuf/compiler/mock_code_generator.cc",
@@ -580,7 +549,8 @@ cc_binary(
580549
deps = [
581550
":protobuf",
582551
":protoc_lib",
583-
] + GTEST,
552+
"@com_google_googletest//:gtest",
553+
],
584554
)
585555

586556
cc_test(
@@ -592,7 +562,9 @@ cc_test(
592562
],
593563
deps = [
594564
":protobuf_lite",
595-
] + GTEST_MAIN,
565+
"@com_google_googletest//:gtest",
566+
"@com_google_googletest//:gtest_main",
567+
],
596568
)
597569

598570
cc_test(
@@ -695,7 +667,9 @@ cc_test(
695667
":cc_test_protos",
696668
":protobuf",
697669
":protoc_lib",
698-
] + PROTOBUF_DEPS + GTEST_MAIN,
670+
"@com_google_googletest//:gtest",
671+
"@com_google_googletest//:gtest_main",
672+
] + PROTOBUF_DEPS,
699673
)
700674

701675
################################################################################

CHANGES.txt

+42
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
2+
3+
C++
4+
* The ::pb namespace is no longer exposed due to conflicts.
5+
* Allow MessageDifferencer::TreatAsSet() (and friends) to override previous
6+
calls instead of crashing.
7+
* Reduce the size of generated proto headers for protos with `string` or
8+
`bytes` fields.
9+
* Move arena() operation on uncommon path to out-of-line routine
10+
* For iterator-pair function parameter types, take both iterators by value.
11+
* Code-space savings and perhaps some modest performance improvements in
12+
RepeatedPtrField.
13+
* Eliminate nullptr check from every tag parse.
14+
* Remove unused _$name$_cached_byte_size_ fields.
15+
* Serialize extension ranges together when not broken by a proto field in the
16+
middle.
17+
* Do out-of-line allocation and deallocation of string object in ArenaString.
18+
* Streamline ParseContext::ParseMessage<T> to avoid code bloat and improve
19+
performance.
20+
* New member functions RepeatedField::Assign, RepeatedPtrField::{Add, Assign}.
21+
* Fix undefined behavior warning due to innocuous uninitialization of value
22+
on an error path.
23+
* Avoid expensive inlined code space for encoding message length for messages
24+
>= 128 bytes and instead do a procedure call to a shared out-of-line routine.
25+
* util::DefaultFieldComparator will be final in a future version of protobuf.
26+
Subclasses should inherit from SimpleFieldComparator instead.
27+
28+
Java:
29+
* Detect invalid overflow of byteLimit and return InvalidProtocolBufferException as documented.
30+
* Exceptions thrown while reading from an InputStream in parseFrom are now
31+
included as causes.
32+
* Support potentially more efficient proto parsing from RopeByteStrings.
33+
* Clarify runtime of ByteString.Output.toStringBuffer().
34+
35+
Python
36+
* Fixed a bug in text format where a trailing colon was printed for repeated field.
37+
* When TextFormat encounters a duplicate message map key, replace the current
38+
one instead of merging.
39+
40+
JavaScript
41+
* Make Any.pack() chainable.
42+
143
2021-04-02 version 3.15.7 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
244

345
C++

Makefile.am

-1
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ java_EXTRA_DIST=
529529
java/core/src/test/proto/com/google/protobuf/test_check_utf8.proto \
530530
java/core/src/test/proto/com/google/protobuf/test_check_utf8_size.proto \
531531
java/core/src/test/proto/com/google/protobuf/test_custom_options.proto \
532-
java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \
533532
java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \
534533
java/lite.md \
535534
java/lite/BUILD \

WORKSPACE

+9-12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ http_archive(
1717
],
1818
)
1919

20+
http_archive(
21+
name = "com_github_google_benchmark",
22+
sha256 = "2a778d821997df7d8646c9c59b8edb9a573a6e04c534c01892a40aa524a7b68c",
23+
strip_prefix = "benchmark-bf585a2789e30585b4e3ce6baf11ef2750b54677",
24+
urls = [
25+
"https://github.com/google/benchmark/archive/bf585a2789e30585b4e3ce6baf11ef2750b54677.zip",
26+
],
27+
)
28+
2029
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2130
load("//:protobuf_deps.bzl", "protobuf_deps")
2231

@@ -29,18 +38,6 @@ bind(
2938
actual = "//util/python:python_headers",
3039
)
3140

32-
# TODO(yannic): Remove in 3.14.0.
33-
bind(
34-
name = "gtest",
35-
actual = "@com_google_googletest//:gtest",
36-
)
37-
38-
# TODO(yannic): Remove in 3.14.0.
39-
bind(
40-
name = "gtest_main",
41-
actual = "@com_google_googletest//:gtest_main",
42-
)
43-
4441
jvm_maven_import_external(
4542
name = "guava_maven",
4643
artifact = "com.google.guava:guava:18.0",

benchmarks/BUILD

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
2+
load("@rules_java//java:defs.bzl", "java_proto_library")
3+
load("@rules_proto//proto:defs.bzl", "proto_library")
4+
5+
proto_library(
6+
name = "benchmarks_proto",
7+
srcs = [
8+
"benchmarks.proto",
9+
],
10+
strip_import_prefix = "/benchmarks",
11+
visibility = [
12+
"//benchmarks:__subpackages__",
13+
],
14+
)
15+
16+
cc_proto_library(
17+
name = "benchmarks_cc_proto",
18+
visibility = [
19+
"//benchmarks:__subpackages__",
20+
],
21+
deps = [
22+
"benchmarks_proto",
23+
],
24+
)
25+
26+
java_proto_library(
27+
name = "benchmarks_java_proto",
28+
visibility = [
29+
"//benchmarks:__subpackages__",
30+
],
31+
deps = [
32+
"benchmarks_proto",
33+
],
34+
)
35+
36+
proto_library(
37+
name = "google_size_proto",
38+
srcs = [
39+
"google_size.proto",
40+
],
41+
strip_import_prefix = "/benchmarks",
42+
visibility = [
43+
"//benchmarks:__subpackages__",
44+
],
45+
)
46+
47+
cc_proto_library(
48+
name = "google_size_cc_proto",
49+
visibility = [
50+
"//benchmarks:__subpackages__",
51+
],
52+
deps = [
53+
"google_size_proto",
54+
],
55+
)
56+
57+
java_proto_library(
58+
name = "google_size_java_proto",
59+
visibility = [
60+
"//benchmarks:__subpackages__",
61+
],
62+
deps = [
63+
"google_size_proto",
64+
],
65+
)

benchmarks/cpp/BUILD

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_binary")
2+
3+
cc_binary(
4+
name = "cpp",
5+
srcs = [
6+
"cpp_benchmark.cc",
7+
],
8+
tags = ["benchmark"],
9+
deps = [
10+
"//:protobuf",
11+
"//benchmarks:benchmarks_cc_proto",
12+
"//benchmarks/datasets:cc_protos",
13+
"@com_github_google_benchmark//:benchmark_main",
14+
],
15+
)

benchmarks/datasets/BUILD

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_library")
2+
load("@rules_java//java:defs.bzl", "java_library")
3+
load("@rules_proto//proto:defs.bzl", "proto_library")
4+
5+
filegroup(
6+
name = "datasets",
7+
srcs = [
8+
"//benchmarks/datasets/google_message1/proto2:datasets",
9+
"//benchmarks/datasets/google_message1/proto3:datasets",
10+
"//benchmarks/datasets/google_message2:datasets",
11+
"//benchmarks/datasets/google_message3:datasets",
12+
"//benchmarks/datasets/google_message4:datasets",
13+
],
14+
visibility = [
15+
"//benchmarks:__subpackages__",
16+
],
17+
)
18+
19+
proto_library(
20+
name = "protos",
21+
visibility = [
22+
"//benchmarks:__subpackages__",
23+
],
24+
deps = [
25+
"//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_proto",
26+
"//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_proto",
27+
"//benchmarks/datasets/google_message2:benchmark_message2_proto",
28+
"//benchmarks/datasets/google_message3:benchmark_message3_proto",
29+
"//benchmarks/datasets/google_message4:benchmark_message4_proto",
30+
],
31+
)
32+
33+
cc_library(
34+
name = "cc_protos",
35+
visibility = [
36+
"//benchmarks:__subpackages__",
37+
],
38+
deps = [
39+
"//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_cc_proto",
40+
"//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_cc_proto",
41+
"//benchmarks/datasets/google_message2:benchmark_message2_cc_proto",
42+
"//benchmarks/datasets/google_message3:benchmark_message3_cc_proto",
43+
"//benchmarks/datasets/google_message4:benchmark_message4_cc_proto",
44+
],
45+
)
46+
47+
java_library(
48+
name = "java_protos",
49+
visibility = [
50+
"//benchmarks:__subpackages__",
51+
],
52+
exports = [
53+
"//benchmarks/datasets/google_message1/proto2:benchmark_message1_proto2_java_proto",
54+
"//benchmarks/datasets/google_message1/proto3:benchmark_message1_proto3_java_proto",
55+
"//benchmarks/datasets/google_message2:benchmark_message2_java_proto",
56+
"//benchmarks/datasets/google_message3:benchmark_message3_java_proto",
57+
"//benchmarks/datasets/google_message4:benchmark_message4_java_proto",
58+
],
59+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
2+
load("@rules_java//java:defs.bzl", "java_proto_library")
3+
load("@rules_proto//proto:defs.bzl", "proto_library")
4+
5+
filegroup(
6+
name = "datasets",
7+
srcs = [
8+
"dataset.google_message1_proto2.pb",
9+
],
10+
visibility = [
11+
"//benchmarks/datasets:__pkg__",
12+
],
13+
)
14+
15+
proto_library(
16+
name = "benchmark_message1_proto2_proto",
17+
srcs = [
18+
"benchmark_message1_proto2.proto",
19+
],
20+
strip_import_prefix = "/benchmarks",
21+
visibility = [
22+
"//benchmarks/datasets:__pkg__",
23+
],
24+
)
25+
26+
cc_proto_library(
27+
name = "benchmark_message1_proto2_cc_proto",
28+
visibility = [
29+
"//benchmarks/datasets:__pkg__",
30+
],
31+
deps = [
32+
"benchmark_message1_proto2_proto",
33+
],
34+
)
35+
36+
java_proto_library(
37+
name = "benchmark_message1_proto2_java_proto",
38+
visibility = [
39+
"//benchmarks/datasets:__pkg__",
40+
],
41+
deps = [
42+
"benchmark_message1_proto2_proto",
43+
],
44+
)

0 commit comments

Comments
 (0)