Skip to content

Commit

Permalink
all: Bump protobuf to 3.0.2, to fix protoc in CI
Browse files Browse the repository at this point in the history
protoc no longer builds in 3.0.0 because auto-download of the gmock zip
now fails. 3.0.2 has a fix to autogen:
protocolbuffers/protobuf@bba446b

All that was strictly necessary was to update .travis.yml and
buildscripts/, but it helps our sanity to keep the rest of the protobuf
versions in sync. Lite is left on its existing version, because it did
not see a bump of neither the java library nor the protoc plugin.
  • Loading branch information
ejona86 committed Sep 29, 2016
1 parent 3481283 commit b1d72e5
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ language: java
env:
global:
- GRADLE_OPTS=-Xmx512m
- PROTOBUF_VERSION=3.0.0
- PROTOBUF_VERSION=3.0.2
- LDFLAGS=-L/tmp/protobuf/lib
- CXXFLAGS=-I/tmp/protobuf/include
- LD_LIBRARY_PATH=/tmp/protobuf/lib
Expand Down
12 changes: 6 additions & 6 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ This section is only necessary if you are making changes to the code
generation. Most users only need to use `skipCodegen=true` as discussed above.

### Build Protobuf
The codegen plugin is C++ code and requires protobuf 3.0.0.
The codegen plugin is C++ code and requires protobuf 3.0.0 or later.

For Linux, Mac and MinGW:
```
$ git clone https://github.com/google/protobuf.git
$ cd protobuf
$ git checkout v3.0.0
$ git checkout v3.0.2
$ ./autogen.sh
$ ./configure
$ make
Expand Down Expand Up @@ -72,16 +72,16 @@ When building on Windows and VC++, you need to specify project properties for
Gradle to find protobuf:
```
.\gradlew install ^
-PvcProtobufInclude=C:\path\to\protobuf-3.0.0\src ^
-PvcProtobufLibs=C:\path\to\protobuf-3.0.0\vsprojects\Release ^
-PvcProtobufInclude=C:\path\to\protobuf-3.0.2\src ^
-PvcProtobufLibs=C:\path\to\protobuf-3.0.2\vsprojects\Release ^
-PtargetArch=x86_32
```

Since specifying those properties every build is bothersome, you can instead
create ``<project-root>\gradle.properties`` with contents like:
```
vcProtobufInclude=C:\\path\\to\\protobuf-3.0.0\\src
vcProtobufLibs=C:\\path\\to\\protobuf-3.0.0\\vsprojects\\Release
vcProtobufInclude=C:\\path\\to\\protobuf-3.0.2\\src
vcProtobufLibs=C:\\path\\to\\protobuf-3.0.2\\vsprojects\\Release
targetArch=x86_32
```

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ For protobuf-based codegen integrated with the Maven build system, you can use
protobuf-java directly, you will be transitively depending on the
protobuf-java version that grpc depends on.
-->
<protocArtifact>com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}</protocArtifact>
<protocArtifact>com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.0.0:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
Expand Down Expand Up @@ -128,7 +128,7 @@ protobuf {
// The version of protoc must match protobuf-java. If you don't depend on
// protobuf-java directly, you will be transitively depending on the
// protobuf-java version that grpc depends on.
artifact = "com.google.protobuf:protoc:3.0.0"
artifact = "com.google.protobuf:protoc:3.0.2"
}
plugins {
grpc {
Expand Down
2 changes: 1 addition & 1 deletion android-interop-testing/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ android {

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
artifact = 'com.google.protobuf:protoc:3.0.2'
}
plugins {
grpc {
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ subprojects {
javaPluginPath = "$rootDir/compiler/build/exe/java_plugin/$protocPluginBaseName$exeSuffix"

guavaVersion = '19.0'
protobufVersion = '3.0.0'
protobufVersion = '3.0.2'
protobufNanoVersion = '3.0.0-alpha-5'

configureProtoCompilation = {
Expand Down Expand Up @@ -154,6 +154,8 @@ subprojects {
protobuf: "com.google.protobuf:protobuf-java:${protobufVersion}",
// swap to ${protobufVersion} after versions align again
protobuf_lite: "com.google.protobuf:protobuf-lite:3.0.1",
// swap to ${protobufVersion} after versions align again
protoc_lite: "com.google.protobuf:protoc-gen-javalite:3.0.0",
protobuf_nano: "com.google.protobuf.nano:protobuf-javanano:${protobufNanoVersion}",
protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.0',
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",
Expand Down
4 changes: 2 additions & 2 deletions buildscripts/jenkins-pre.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ set ESCWORKSPACE=%WORKSPACE:\=\\%

echo targetArch=x86_32> gradle.properties
echo failOnWarnings=true>> gradle.properties
echo vcProtobufLibs=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-3.0.0\\cmake\\build\\Release>> gradle.properties
echo vcProtobufInclude=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-3.0.0\\cmake\\build\\include>> gradle.properties
echo vcProtobufLibs=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-%PROTOBUF_VER%\\cmake\\build\\Release>> gradle.properties
echo vcProtobufInclude=%ESCWORKSPACE%\\grpc-java-helper\\protobuf-%PROTOBUF_VER%\\cmake\\build\\include>> gradle.properties
4 changes: 2 additions & 2 deletions buildscripts/make_dependencies.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ REM 7za is in http://www.7-zip.org/a/7z1507-extra.7z
REM Prerequisite:
REM 7za.exe in current directory or PATH

set PROTOBUF_VER=3.0.0
set PROTOBUF_VER=3.0.2
set CMAKE_NAME=cmake-3.3.2-win32-x86

if not exist "protobuf-%PROTOBUF_VER%\cmake\build\Release\" (
Expand All @@ -25,7 +25,7 @@ set PATH=%PATH%;%cd%\%CMAKE_NAME%\bin
powershell -command "& { iwr https://github.com/google/protobuf/archive/v%PROTOBUF_VER%.zip -OutFile protobuf.zip }"
7za X protobuf.zip
del protobuf.zip
pushd protobuf-3.0.0\cmake
pushd protobuf-%PROTOBUF_VER%\cmake
mkdir build
cd build
cmake -Dprotobuf_BUILD_TESTS=OFF -G "Visual Studio %VisualStudioVersion:~0,2%" ..
Expand Down
2 changes: 1 addition & 1 deletion compiler/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM protoc-artifacts:latest

RUN scl enable devtoolset-1.1 'bash -c "cd /protobuf && \
git fetch && \
git checkout v3.0.0 && \
git checkout v3.0.2 && \
./autogen.sh && \
CXXFLAGS=-m32 ./configure --disable-shared --prefix=/protobuf-32 && \
make clean && make -j$(nproc) && make -j$(nproc) install"'
Expand Down
2 changes: 1 addition & 1 deletion compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protobuf {
if (project.hasProperty('protoc-gen-javalite')) {
path = project['protoc-gen-javalite']
} else {
artifact = "com.google.protobuf:protoc-gen-javalite:${protobufVersion}"
artifact = libraries.protoc_lite
}
}
grpc {
Expand Down
2 changes: 1 addition & 1 deletion examples/android/helloworld/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ android {

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
artifact = 'com.google.protobuf:protoc:3.0.2'
}
plugins {
javalite {
Expand Down
2 changes: 1 addition & 1 deletion examples/android/routeguide/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ android {

protobuf {
protoc {
artifact = 'com.google.protobuf:protoc:3.0.0'
artifact = 'com.google.protobuf:protoc:3.0.2'
}
plugins {
javalite {
Expand Down
2 changes: 1 addition & 1 deletion examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protobuf {
// The version of protoc must match protobuf-java. If you don't depend on
// protobuf-java directly, you will be transitively depending on the
// protobuf-java version that grpc depends on.
artifact = 'com.google.protobuf:protoc:3.0.0'
artifact = 'com.google.protobuf:protoc:3.0.2'
}
plugins {
grpc {
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
protobuf-java directly, you will be transitively depending on the
protobuf-java version that grpc depends on.
-->
<protocArtifact>com.google.protobuf:protoc:3.0.0:exe:${os.detected.classifier}</protocArtifact>
<protocArtifact>com.google.protobuf:protoc:3.0.2:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
Expand Down
2 changes: 1 addition & 1 deletion protobuf-lite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protobuf {
if (project.hasProperty('protoc-gen-javalite')) {
path = project['protoc-gen-javalite']
} else {
artifact = "com.google.protobuf:protoc-gen-javalite:${protobufVersion}"
artifact = libraries.protoc_lite
}
}
}
Expand Down

0 comments on commit b1d72e5

Please sign in to comment.