Skip to content

Commit

Permalink
Merge branch '21.x' into fix-21x-ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
haberman committed Dec 19, 2023
2 parents c5a30e7 + 418dcd6 commit ec0e404
Show file tree
Hide file tree
Showing 69 changed files with 296 additions and 166 deletions.
31 changes: 22 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,17 @@ cc_library(

# DEPRECATED: Prefer :well_known_type_protos for the Well-Known Types
# (https://developers.google.com/protocol-buffers/docs/reference/google.protobuf)
# or :descriptor_proto(_srcs) for descriptor.proto (source), or
# :compiler_plugin_proto for compiler/plugin.proto.
# or :descriptor_proto_srcs for descriptor.proto, or :compiler_plugin_proto_srcs
# for compiler/plugin.proto.
filegroup(
name = "well_known_protos",
srcs = [
"src/google/protobuf/compiler/plugin.proto",
"src/google/protobuf/descriptor.proto",
":compiler_plugin_proto_srcs",
":descriptor_proto_srcs",
":well_known_type_protos",
],
deprecation = "Prefer :well_known_type_protos instead.",
deprecation = "Prefer :well_known_type_protos, :compiler_plugin_proto, " +
"and :descriptor_proto instead.",
visibility = ["//visibility:public"],
)

Expand All @@ -191,12 +192,24 @@ filegroup(
filegroup(
name = "built_in_runtime_protos",
srcs = [
"src/google/protobuf/compiler/plugin.proto",
"src/google/protobuf/descriptor.proto",
":descriptor_proto_srcs",
":compiler_plugin_proto_srcs",
],
visibility = ["//:__subpackages__"],
)

filegroup(
name = "descriptor_proto_srcs",
srcs = ["src/google/protobuf/descriptor.proto"],
visibility = ["//visibility:public"],
)

filegroup(
name = "compiler_plugin_proto_srcs",
srcs = ["src/google/protobuf/compiler/plugin.proto"],
visibility = ["//visibility:public"],
)

exports_files(
srcs = [
"src/google/protobuf/any.proto",
Expand Down Expand Up @@ -342,15 +355,15 @@ proto_library(

proto_library(
name = "compiler_plugin_proto",
srcs = ["src/google/protobuf/compiler/plugin.proto"],
srcs = [":compiler_plugin_proto_srcs"],
strip_import_prefix = "src",
visibility = ["//visibility:public"],
deps = ["//:descriptor_proto"],
)

proto_library(
name = "descriptor_proto",
srcs = ["src/google/protobuf/descriptor.proto"],
srcs = [":descriptor_proto_srcs"],
strip_import_prefix = "src",
visibility = ["//visibility:public"],
)
Expand Down
8 changes: 8 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2022-12-13 version 21.12 (C++/Java/Python/PHP/Objective-C/C#/Ruby)

Python
* Fix broken enum ranges (#11171)
* Stop requiring extension fields to have a sythetic oneof (#11091)

Check failure on line 5 in CHANGES.txt

View workflow job for this annotation

GitHub Actions / Check for spelling errors

sythetic ==> synthetic
* Python runtime 4.21.10 not works generated code can not load valid proto.
(#11171)

2022-12-07 version 21.11 (C++/Java/Python/PHP/Objective-C/C#/Ruby)
Python
* Add license file to pypi wheels (#10936)
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ java_EXTRA_DIST=
java/core/src/main/java/com/google/protobuf/Internal.java \
java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java \
java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java \
java/core/src/main/java/com/google/protobuf/Java8Compatibility.java \
java/core/src/main/java/com/google/protobuf/JavaType.java \
java/core/src/main/java/com/google/protobuf/LazyField.java \
java/core/src/main/java/com/google/protobuf/LazyFieldLite.java \
Expand Down
2 changes: 1 addition & 1 deletion Protobuf-C++.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Protobuf-C++'
s.version = '3.21.11'
s.version = '3.21.12'
s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf'
s.license = 'BSD-3-Clause'
Expand Down
2 changes: 1 addition & 1 deletion Protobuf.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.21.11'
s.version = '3.21.12'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = 'BSD-3-Clause'
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.)
AC_INIT([Protocol Buffers],[3.21.11],[protobuf@googlegroups.com],[protobuf])
AC_INIT([Protocol Buffers],[3.21.12],[protobuf@googlegroups.com],[protobuf])

AM_MAINTAINER_MODE([enable])

Expand Down
2 changes: 1 addition & 1 deletion csharp/Google.Protobuf.Tools.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description>
<version>3.21.11</version>
<version>3.21.12</version>
<authors>Google Inc.</authors>
<owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/main/LICENSE</licenseUrl>
Expand Down
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/Google.Protobuf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>C# runtime library for Protocol Buffers - Google's data interchange format.</Description>
<Copyright>Copyright 2015, Google Inc.</Copyright>
<AssemblyTitle>Google Protocol Buffers</AssemblyTitle>
<VersionPrefix>3.21.11</VersionPrefix>
<VersionPrefix>3.21.12</VersionPrefix>
<!-- C# 7.2 is required for Span/BufferWriter/ReadOnlySequence -->
<LangVersion>7.2</LangVersion>
<Authors>Google Inc.</Authors>
Expand Down
6 changes: 3 additions & 3 deletions java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ If you are using Maven, use the following:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>3.21.11</version>
<version>3.21.12</version>
</dependency>
```

Expand All @@ -37,15 +37,15 @@ protobuf-java-util package:
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
<version>3.21.11</version>
<version>3.21.12</version>
</dependency>
```

### Gradle

If you are using Gradle, add the following to your `build.gradle` file's dependencies:
```
implementation 'com.google.protobuf:protobuf-java:3.21.11'
implementation 'com.google.protobuf:protobuf-java:3.21.12'
```
Again, be sure to check that the version number matches (or is newer than) the version number of protoc that you are using.

Expand Down
2 changes: 1 addition & 1 deletion java/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>3.21.11</version>
<version>3.21.12</version>
<packaging>pom</packaging>

<name>Protocol Buffers [BOM]</name>
Expand Down
1 change: 1 addition & 0 deletions java/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ LITE_SRCS = [
"src/main/java/com/google/protobuf/Internal.java",
"src/main/java/com/google/protobuf/InvalidProtocolBufferException.java",
"src/main/java/com/google/protobuf/IterableByteBufferInputStream.java",
"src/main/java/com/google/protobuf/Java8Compatibility.java",
"src/main/java/com/google/protobuf/JavaType.java",
"src/main/java/com/google/protobuf/LazyField.java",
"src/main/java/com/google/protobuf/LazyFieldLite.java",
Expand Down
2 changes: 1 addition & 1 deletion java/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-parent</artifactId>
<version>3.21.11</version>
<version>3.21.12</version>
</parent>

<artifactId>protobuf-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public int position() {

@Override
public AllocatedBuffer position(int position) {
buffer.position(position);
Java8Compatibility.position(buffer, position);
return this;
}

Expand Down
28 changes: 14 additions & 14 deletions java/core/src/main/java/com/google/protobuf/BinaryWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2019,8 +2019,8 @@ private void nextBuffer(AllocatedBuffer allocatedBuffer) {
buffers.addFirst(allocatedBuffer);

buffer = nioBuffer;
buffer.limit(buffer.capacity());
buffer.position(0);
Java8Compatibility.limit(buffer, buffer.capacity());
Java8Compatibility.position(buffer, 0);
// Set byte order to little endian for fast writing of fixed 32/64.
buffer.order(ByteOrder.LITTLE_ENDIAN);

Expand All @@ -2046,7 +2046,7 @@ void finishCurrentBuffer() {
if (buffer != null) {
totalDoneBytes += bytesWrittenToCurrentBuffer();
// Update the indices on the netty buffer.
buffer.position(pos + 1);
Java8Compatibility.position(buffer, pos + 1);
buffer = null;
pos = 0;
limitMinusOne = 0;
Expand Down Expand Up @@ -2475,7 +2475,7 @@ public void write(byte[] value, int offset, int length) {
}

pos -= length;
buffer.position(pos + 1);
Java8Compatibility.position(buffer, pos + 1);
buffer.put(value, offset, length);
}

Expand All @@ -2494,7 +2494,7 @@ public void writeLazy(byte[] value, int offset, int length) {
}

pos -= length;
buffer.position(pos + 1);
Java8Compatibility.position(buffer, pos + 1);
buffer.put(value, offset, length);
}

Expand All @@ -2506,7 +2506,7 @@ public void write(ByteBuffer value) {
}

pos -= length;
buffer.position(pos + 1);
Java8Compatibility.position(buffer, pos + 1);
buffer.put(value);
}

Expand All @@ -2526,7 +2526,7 @@ public void writeLazy(ByteBuffer value) {
}

pos -= length;
buffer.position(pos + 1);
Java8Compatibility.position(buffer, pos + 1);
buffer.put(value);
}

Expand Down Expand Up @@ -2576,8 +2576,8 @@ private void nextBuffer(AllocatedBuffer allocatedBuffer) {
buffers.addFirst(allocatedBuffer);

buffer = nioBuffer;
buffer.limit(buffer.capacity());
buffer.position(0);
Java8Compatibility.limit(buffer, buffer.capacity());
Java8Compatibility.position(buffer, 0);

bufferOffset = UnsafeUtil.addressOffset(buffer);
limitMinusOne = bufferOffset + (buffer.limit() - 1);
Expand All @@ -2602,7 +2602,7 @@ void finishCurrentBuffer() {
if (buffer != null) {
totalDoneBytes += bytesWrittenToCurrentBuffer();
// Update the indices on the netty buffer.
buffer.position(bufferPos() + 1);
Java8Compatibility.position(buffer, bufferPos() + 1);
buffer = null;
pos = 0;
limitMinusOne = 0;
Expand Down Expand Up @@ -3016,7 +3016,7 @@ public void write(byte[] value, int offset, int length) {
}

pos -= length;
buffer.position(bufferPos() + 1);
Java8Compatibility.position(buffer, bufferPos() + 1);
buffer.put(value, offset, length);
}

Expand All @@ -3035,7 +3035,7 @@ public void writeLazy(byte[] value, int offset, int length) {
}

pos -= length;
buffer.position(bufferPos() + 1);
Java8Compatibility.position(buffer, bufferPos() + 1);
buffer.put(value, offset, length);
}

Expand All @@ -3047,7 +3047,7 @@ public void write(ByteBuffer value) {
}

pos -= length;
buffer.position(bufferPos() + 1);
Java8Compatibility.position(buffer, bufferPos() + 1);
buffer.put(value);
}

Expand All @@ -3067,7 +3067,7 @@ public void writeLazy(ByteBuffer value) {
}

pos -= length;
buffer.position(bufferPos() + 1);
Java8Compatibility.position(buffer, bufferPos() + 1);
buffer.put(value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void write(ByteBuffer buffer, OutputStream output) throws IOException {
}
} finally {
// Restore the initial position.
buffer.position(initialPos);
Java8Compatibility.position(buffer, initialPos);
}
}

Expand Down

0 comments on commit ec0e404

Please sign in to comment.