Skip to content

Commit 90db93b

Browse files
committed
Pin versions on unstable packages: grpc-core internal and netty
The internal package is very unstable, so any users of it are not compatible with alternative versions of grpc-core. The same is true for HTTP/2 support in Netty. This primarily helps Maven users; Gradle appears to ignore the distinction between '$version' and '[$version]' and does not trigger a build failure. Projects like grpc-stub don't depend on internal, so they aren't using the version pinning. The whitelist is a bit prone to go out-of-date, but introducing grpc-api would be the long-term solution. Fixes #1459
1 parent 0ed059a commit 90db93b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

build.gradle

+9-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ subprojects {
137137
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.7.4',
138138
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
139139

140-
netty: 'io.netty:netty-codec-http2:4.1.0.CR6',
140+
netty: 'io.netty:netty-codec-http2:[4.1.0.CR6]',
141141
netty_epoll: 'io.netty:netty-transport-native-epoll:4.1.0.CR6' + epoll_suffix,
142142
netty_tcnative: 'io.netty:netty-tcnative-boringssl-static:1.1.33.Fork15:' + osdetector.classifier,
143143

@@ -272,6 +272,14 @@ subprojects {
272272
}
273273
}
274274
}
275+
if (!(project.name in
276+
["grpc-stub", "grpc-protobuf", "grpc-protobuf-lite", "grpc-protobuf-nano"])) {
277+
def core = pom.dependencies.find {dep -> dep.artifactId == 'grpc-core'}
278+
if (core != null) {
279+
// Depend on specific version of grpc-core because internal package is unstable
280+
core.version = "[" + core.version + "]"
281+
}
282+
}
275283
}
276284
// At a test failure, log the stack trace to the console so that we don't
277285
// have to open the HTML in a browser.

0 commit comments

Comments
 (0)