Skip to content

Commit 657c929

Browse files
committed
Merge remote-tracking branch 'origin/master' into mcs-interop-tests
# Conflicts: # interop-testing/src/main/java/io/grpc/testing/integration/TestServiceImpl.java
2 parents 12f35cf + 1e85674 commit 657c929

376 files changed

Lines changed: 16532 additions & 2685 deletions

File tree

Some content is hidden

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

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
2+
3+
common:skip_android --deleted_packages=android,binder

.gemini/config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
have_fun: false
2+
memory_config:
3+
disabled: false
4+
code_review:
5+
disable: false
6+
comment_severity_threshold: MEDIUM
7+
max_review_comments: -1
8+
pull_request_opened:
9+
help: false
10+
summary: false
11+
code_review: false
12+
include_drafts: false
13+
ignore_patterns: []

.github/workflows/testing.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,12 @@ jobs:
8080
strategy:
8181
matrix:
8282
bzlmod: [true, false]
83+
bazel_version: [8.7.0, 9.1.0]
84+
exclude:
85+
- bazel_version: 9.1.0
86+
bzlmod: false
8387
env:
84-
USE_BAZEL_VERSION: 7.7.1
88+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
8589

8690
steps:
8791
- uses: actions/checkout@v4
@@ -100,11 +104,11 @@ jobs:
100104
key: ${{ runner.os }}-bazel-${{ env.USE_BAZEL_VERSION }}-${{ hashFiles('WORKSPACE', 'repositories.bzl') }}
101105

102106
- name: Run bazel build
103-
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
107+
run: bazelisk build //... --config=skip_android --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }}
104108

105109
- name: Run bazel test
106-
run: bazelisk test //... --enable_bzlmod=${{ matrix.bzlmod }}
110+
run: bazelisk test //... --config=skip_android --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }}
107111

108112
- name: Run example bazel build
109-
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }}
113+
run: bazelisk build //... --enable_bzlmod=${{ matrix.bzlmod }} --enable_workspace=${{ !matrix.bzlmod }}
110114
working-directory: ./examples

COMPILING.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,26 @@ $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses
150150

151151
# Add 'export ANDROID_HOME=$HOME/Android/Sdk' to your .bashrc or equivalent
152152
```
153+
154+
Building with Bazel
155+
===================
156+
157+
grpc-java can also be built using [Bazel](https://bazel.build/). We support
158+
the two most recent major versions of Bazel.
159+
[Install bazelisk](https://github.com/bazelbuild/bazelisk#installation)
160+
to ensure you're always building using the latest supported version, then try:
161+
162+
```
163+
$ bazelisk build //...
164+
```
165+
166+
Some parts of grpc-java depend on Android. Bazel can build these parts too but,
167+
for size, licensing and maintenance reasons, it requires a locally installed
168+
Android SDK. If you don't have the SDK and/or don't care about Android, use the
169+
`skip_android` configuration to skip building the Android parts:
170+
171+
```sh
172+
$ bazelisk build //... --config=skip_android
173+
```
174+
175+
You cannot run the tests from Bazel at this time.

MODULE.bazel

Lines changed: 60 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,72 @@
11
module(
22
name = "grpc-java",
3-
version = "1.79.0-SNAPSHOT", # CURRENT_GRPC_VERSION
4-
compatibility_level = 0,
3+
version = "1.82.0-SNAPSHOT", # CURRENT_GRPC_VERSION
54
repo_name = "io_grpc_grpc_java",
65
)
76

87
# GRPC_DEPS_START
98
IO_GRPC_GRPC_JAVA_ARTIFACTS = [
109
"com.google.android:annotations:4.1.1.4",
11-
"com.google.api.grpc:proto-google-common-protos:2.63.2",
12-
"com.google.auth:google-auth-library-credentials:1.41.0",
13-
"com.google.auth:google-auth-library-oauth2-http:1.41.0",
10+
"com.google.api.grpc:proto-google-common-protos:2.64.1",
11+
"com.google.auth:google-auth-library-credentials:1.42.1",
12+
"com.google.auth:google-auth-library-oauth2-http:1.42.1",
1413
"com.google.auto.value:auto-value-annotations:1.11.0",
1514
"com.google.auto.value:auto-value:1.11.0",
1615
"com.google.code.findbugs:jsr305:3.0.2",
17-
"com.google.code.gson:gson:2.12.1",
18-
"com.google.errorprone:error_prone_annotations:2.45.0",
16+
"com.google.code.gson:gson:2.13.2",
17+
"com.google.errorprone:error_prone_annotations:2.48.0",
1918
"com.google.guava:failureaccess:1.0.1",
2019
"com.google.guava:guava:33.5.0-android",
2120
"com.google.re2j:re2j:1.8",
2221
"com.google.s2a.proto.v2:s2a-proto:0.1.3",
2322
"com.google.truth:truth:1.4.5",
23+
"dev.cel:runtime:0.12.0",
24+
"dev.cel:protobuf:0.12.0",
25+
"dev.cel:common:0.12.0",
2426
"com.squareup.okhttp:okhttp:2.7.5",
2527
"com.squareup.okio:okio:2.10.0", # 3.0+ needs swapping to -jvm; need work to avoid flag-day
26-
"io.netty:netty-buffer:4.1.130.Final",
27-
"io.netty:netty-codec-http2:4.1.130.Final",
28-
"io.netty:netty-codec-http:4.1.130.Final",
29-
"io.netty:netty-codec-socks:4.1.130.Final",
30-
"io.netty:netty-codec:4.1.130.Final",
31-
"io.netty:netty-common:4.1.130.Final",
32-
"io.netty:netty-handler-proxy:4.1.130.Final",
33-
"io.netty:netty-handler:4.1.130.Final",
34-
"io.netty:netty-resolver:4.1.130.Final",
35-
"io.netty:netty-tcnative-boringssl-static:2.0.74.Final",
36-
"io.netty:netty-tcnative-classes:2.0.74.Final",
37-
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.130.Final",
38-
"io.netty:netty-transport-native-unix-common:4.1.130.Final",
39-
"io.netty:netty-transport:4.1.130.Final",
28+
"io.netty:netty-buffer:4.1.133.Final",
29+
"io.netty:netty-codec-http2:4.1.133.Final",
30+
"io.netty:netty-codec-http:4.1.133.Final",
31+
"io.netty:netty-codec-socks:4.1.133.Final",
32+
"io.netty:netty-codec:4.1.133.Final",
33+
"io.netty:netty-common:4.1.133.Final",
34+
"io.netty:netty-handler-proxy:4.1.133.Final",
35+
"io.netty:netty-handler:4.1.133.Final",
36+
"io.netty:netty-resolver:4.1.133.Final",
37+
"io.netty:netty-tcnative-boringssl-static:2.0.75.Final",
38+
"io.netty:netty-tcnative-classes:2.0.75.Final",
39+
"io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.133.Final",
40+
"io.netty:netty-transport-native-unix-common:4.1.133.Final",
41+
"io.netty:netty-transport:4.1.133.Final",
4042
"io.opencensus:opencensus-api:0.31.0",
4143
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
4244
"io.perfmark:perfmark-api:0.27.0",
4345
"junit:junit:4.13.2",
46+
"org.mockito:mockito-core:4.4.0",
4447
"org.checkerframework:checker-qual:3.49.5",
45-
"org.codehaus.mojo:animal-sniffer-annotations:1.26",
48+
"org.codehaus.mojo:animal-sniffer-annotations:1.27",
4649
]
4750
# GRPC_DEPS_END
4851

52+
bazel_dep(name = "abseil-cpp", version = "20250512.1")
4953
bazel_dep(name = "bazel_jar_jar", version = "0.1.11.bcr.1")
5054
bazel_dep(name = "bazel_skylib", version = "1.7.1")
51-
bazel_dep(name = "googleapis", version = "0.0.0-20240326-1c8d509c5", repo_name = "com_google_googleapis")
55+
bazel_dep(name = "googleapis", version = "0.0.0-20260514-1dbb1a14", repo_name = "com_google_googleapis")
5256
bazel_dep(name = "grpc-proto", version = "0.0.0-20240627-ec30f58.bcr.1", repo_name = "io_grpc_grpc_proto")
53-
bazel_dep(name = "protobuf", version = "33.1", repo_name = "com_google_protobuf")
57+
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")
58+
bazel_dep(name = "rules_android", version = "0.7.2")
5459
bazel_dep(name = "rules_cc", version = "0.0.9")
5560
bazel_dep(name = "rules_java", version = "9.1.0")
5661
bazel_dep(name = "rules_jvm_external", version = "6.0")
5762

63+
android_sdk_repository_extension = use_extension(
64+
"@rules_android//rules/android_sdk_repository:rule.bzl",
65+
"android_sdk_repository_extension",
66+
)
67+
use_repo(android_sdk_repository_extension, "androidsdk")
68+
register_toolchains("@androidsdk//:sdk-toolchain", "@androidsdk//:all")
69+
5870
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
5971
maven.install(
6072
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
@@ -65,6 +77,30 @@ maven.install(
6577
)
6678
use_repo(maven, "maven")
6779

80+
# Define a separate, dev-only extension import for Android deps.
81+
# This prevents downstream non-Android users from having to resolve
82+
# Google Maven (which is required for androidx.*) or rules_android transitively.
83+
grpc_android_maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True)
84+
grpc_android_maven.install(
85+
name = "grpc_android_maven",
86+
artifacts = [
87+
"androidx.annotation:annotation:1.6.0",
88+
"androidx.annotation:annotation-jvm:1.6.0",
89+
"androidx.core:core:1.13.1",
90+
"androidx.lifecycle:lifecycle-common:2.6.2",
91+
],
92+
repositories = [
93+
"https://repo.maven.apache.org/maven2/",
94+
"https://maven.google.com",
95+
],
96+
strict_visibility = True,
97+
# For Bazel 8+ compatibility.
98+
use_starlark_android_rules = True,
99+
# Set this explicitly since the default guess is incorrect under Bzlmod.
100+
aar_import_bzl_label = "@rules_android//rules:rules.bzl",
101+
)
102+
use_repo(grpc_android_maven, "grpc_android_maven")
103+
68104
maven.override(
69105
coordinates = "com.google.protobuf:protobuf-java",
70106
target = "@com_google_protobuf//:protobuf_java",

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ gRPC-Java - An RPC library and framework
2020
Supported Platforms
2121
-------------------
2222

23-
gRPC-Java supports Java 8 and later. Android minSdkVersion 21 (Lollipop) and
23+
gRPC-Java supports Java 8 and later. Android minSdkVersion 23 (Marshmallow) and
2424
later are supported with [Java 8 language desugaring][android-java-8].
2525

2626
TLS usage on Android typically requires Play Services Dynamic Security Provider.
@@ -44,8 +44,8 @@ For a guided tour, take a look at the [quick start
4444
guide](https://grpc.io/docs/languages/java/quickstart) or the more explanatory [gRPC
4545
basics](https://grpc.io/docs/languages/java/basics).
4646

47-
The [examples](https://github.com/grpc/grpc-java/tree/v1.78.0/examples) and the
48-
[Android example](https://github.com/grpc/grpc-java/tree/v1.78.0/examples/android)
47+
The [examples](https://github.com/grpc/grpc-java/tree/v1.81.0/examples) and the
48+
[Android example](https://github.com/grpc/grpc-java/tree/v1.81.0/examples/android)
4949
are standalone projects that showcase the usage of gRPC.
5050

5151
Download
@@ -56,42 +56,42 @@ Download [the JARs][]. Or for Maven with non-Android, add to your `pom.xml`:
5656
<dependency>
5757
<groupId>io.grpc</groupId>
5858
<artifactId>grpc-netty-shaded</artifactId>
59-
<version>1.78.0</version>
59+
<version>1.81.0</version>
6060
<scope>runtime</scope>
6161
</dependency>
6262
<dependency>
6363
<groupId>io.grpc</groupId>
6464
<artifactId>grpc-protobuf</artifactId>
65-
<version>1.78.0</version>
65+
<version>1.81.0</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>io.grpc</groupId>
6969
<artifactId>grpc-stub</artifactId>
70-
<version>1.78.0</version>
70+
<version>1.81.0</version>
7171
</dependency>
7272
```
7373

7474
Or for Gradle with non-Android, add to your dependencies:
7575
```gradle
76-
runtimeOnly 'io.grpc:grpc-netty-shaded:1.78.0'
77-
implementation 'io.grpc:grpc-protobuf:1.78.0'
78-
implementation 'io.grpc:grpc-stub:1.78.0'
76+
runtimeOnly 'io.grpc:grpc-netty-shaded:1.81.0'
77+
implementation 'io.grpc:grpc-protobuf:1.81.0'
78+
implementation 'io.grpc:grpc-stub:1.81.0'
7979
```
8080

8181
For Android client, use `grpc-okhttp` instead of `grpc-netty-shaded` and
8282
`grpc-protobuf-lite` instead of `grpc-protobuf`:
8383
```gradle
84-
implementation 'io.grpc:grpc-okhttp:1.78.0'
85-
implementation 'io.grpc:grpc-protobuf-lite:1.78.0'
86-
implementation 'io.grpc:grpc-stub:1.78.0'
84+
implementation 'io.grpc:grpc-okhttp:1.81.0'
85+
implementation 'io.grpc:grpc-protobuf-lite:1.81.0'
86+
implementation 'io.grpc:grpc-stub:1.81.0'
8787
```
8888

8989
For [Bazel](https://bazel.build), you can either
9090
[use Maven](https://github.com/bazelbuild/rules_jvm_external)
9191
(with the GAVs from above), or use `@io_grpc_grpc_java//api` et al (see below).
9292

9393
[the JARs]:
94-
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.78.0
94+
https://search.maven.org/search?q=g:io.grpc%20AND%20v:1.81.0
9595

9696
Development snapshots are available in [Sonatypes's snapshot
9797
repository](https://central.sonatype.com/repository/maven-snapshots/).
@@ -123,7 +123,7 @@ For protobuf-based codegen integrated with the Maven build system, you can use
123123
<configuration>
124124
<protocArtifact>com.google.protobuf:protoc:3.25.8:exe:${os.detected.classifier}</protocArtifact>
125125
<pluginId>grpc-java</pluginId>
126-
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.78.0:exe:${os.detected.classifier}</pluginArtifact>
126+
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.81.0:exe:${os.detected.classifier}</pluginArtifact>
127127
</configuration>
128128
<executions>
129129
<execution>
@@ -153,7 +153,7 @@ protobuf {
153153
}
154154
plugins {
155155
grpc {
156-
artifact = 'io.grpc:protoc-gen-grpc-java:1.78.0'
156+
artifact = 'io.grpc:protoc-gen-grpc-java:1.81.0'
157157
}
158158
}
159159
generateProtoTasks {
@@ -186,7 +186,7 @@ protobuf {
186186
}
187187
plugins {
188188
grpc {
189-
artifact = 'io.grpc:protoc-gen-grpc-java:1.78.0'
189+
artifact = 'io.grpc:protoc-gen-grpc-java:1.81.0'
190190
}
191191
}
192192
generateProtoTasks {

SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,8 @@ grpc-netty version | netty-handler version | netty-tcnative-boringssl-static ver
399399
1.71.x-1.74.x | 4.1.110.Final | 2.0.70.Final
400400
1.75.x-1.76.x | 4.1.124.Final | 2.0.72.Final
401401
1.77.x-1.78.x | 4.1.127.Final | 2.0.74.Final
402-
1.79.x- | 4.1.130.Final | 2.0.74.Final
402+
1.79.x-1.80.x | 4.1.130.Final | 2.0.74.Final
403+
1.81.x- | 4.1.132.Final | 2.0.75.Final
403404

404405
_(grpc-netty-shaded avoids issues with keeping these versions in sync.)_
405406

alts/src/test/java/io/grpc/alts/internal/AltsProtocolNegotiatorTest.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,11 @@ public void operationComplete(ChannelFuture future) throws Exception {
202202
channel.flush();
203203

204204
// Capture the protected data written to the wire.
205-
assertEquals(1, channel.outboundMessages().size());
206-
ByteBuf protectedData = channel.readOutbound();
205+
assertThat(channel.outboundMessages()).isNotEmpty();
206+
ByteBuf protectedData = channel.alloc().buffer();
207+
while (!channel.outboundMessages().isEmpty()) {
208+
protectedData.writeBytes((ByteBuf) channel.readOutbound());
209+
}
207210
assertEquals(message.length(), writeCount.get());
208211

209212
// Read the protected message at the server and verify it matches the original message.
@@ -327,16 +330,18 @@ public void doNotFlushEmptyBuffer() throws Exception {
327330
String message = "hello";
328331
ByteBuf in = Unpooled.copiedBuffer(message, UTF_8);
329332

330-
assertEquals(0, protector.flushes.get());
333+
int flushes = protector.flushes.get();
331334
Future<?> done = channel.write(in);
332335
channel.flush();
336+
flushes++;
333337
done.get(5, TimeUnit.SECONDS);
334-
assertEquals(1, protector.flushes.get());
338+
assertEquals(flushes, protector.flushes.get());
335339

340+
// Flush does not propagate
336341
done = channel.write(Unpooled.EMPTY_BUFFER);
337342
channel.flush();
338343
done.get(5, TimeUnit.SECONDS);
339-
assertEquals(1, protector.flushes.get());
344+
assertEquals(flushes, protector.flushes.get());
340345
}
341346

342347
@Test

0 commit comments

Comments
 (0)