Skip to content

Instantly share code, notes, and snippets.

@liusheng
Last active November 20, 2019 07:55
Show Gist options
  • Save liusheng/2ce92f2541c8dee630d320ad67d4131d to your computer and use it in GitHub Desktop.
Save liusheng/2ce92f2541c8dee630d320ad67d4131d to your computer and use it in GitHub Desktop.
cross build protobuf
#!/bin/bash
set -eu -o pipefail
apt-get update
apt-get install -y wget autoconf automake libtool g++-aarch64-linux-gnu g++ make
apt-get install software-properties-common -y
add-apt-repository ppa:openjdk-r/ppa -y
apt-get update
apt install openjdk-8-jdk -y
export JAVA_HOME=`dirname $(dirname $(update-alternatives --list javac |grep java-8))`
echo $JAVA_HOME
rm /etc/ssl/certs/java/cacerts
update-ca-certificates -f
SKIP_TESTS=true ARCH=aarch_64 ./buildscripts/kokoro/unix.sh
#!/bin/bash
set -eu -o pipefail
sudo apt-get update -y
sudo apt-get install -y wget autoconf automake libtool g++-aarch64-linux-gnu g++ make
readonly proto_dir="$(mktemp -d --tmpdir protobuf.XXXXXX)"
wget -O - https://github.com/google/protobuf/archive/v3.10.0.tar.gz | tar xz -C "$proto_dir"
pushd "$proto_dir"/protobuf-3.10.0/
./autogen.sh
./protoc-artifacts/build-protoc.sh linux aarch_64 protoc
popd
@liusheng
Copy link
Author

@liusheng
Copy link
Author

> Task :grpc-compiler:generateTestProto FAILED
Caching disabled for task ':grpc-compiler:generateTestProto' because:
  Build cache is disabled
Task ':grpc-compiler:generateTestProto' is not up-to-date because:
  Task has failed previously.
[/root/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protoc/3.10.0/e7ba2967f692c3bd2bd417f6a305bcb6a8c6a357/protoc-3.10.0-linux-x86_64.exe, -I/grpc-java/compiler/src/test/proto, -I/grpc-java/compiler/build/extracted-protos/test, -I/grpc-java/compiler/build/extracted-include-protos/test, --java_out=/grpc-java/compiler/build/generated/source/proto/test/java, --plugin=protoc-gen-grpc=/grpc-java/compiler/build/exe/java_plugin/protoc-gen-grpc-java, --grpc_out=/grpc-java/compiler/build/generated/source/proto/test/grpc, /grpc-java/compiler/src/test/proto/grpc/testing/compiler/test.proto]
:grpc-compiler:generateTestProto (Thread[Execution worker for ':' Thread 5,5,main]) completed. Took 0.012 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grpc-compiler:generateTestProto'.
> protoc: stdout: . stderr: /grpc-java/compiler/build/exe/java_plugin/protoc-gen-grpc-java: program not found or is not executable
  Please specify a program using absolute path or make sure the program is available in your PATH system variable
root@72d0162ce6ca:/grpc-java# file /grpc-java/compiler/build/exe/java_plugin/protoc-gen-grpc-java
/grpc-java/compiler/build/exe/java_plugin/protoc-gen-grpc-java: ELF 64-bit LSB  executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 3.7.0, BuildID[sha1]=ec592fb114f07eff18bf705e0d7bbcd4d042636b, stripped

@liusheng
Copy link
Author

centos 6.9:

wget -O- http://releases.linaro.org/components/toolchain/binaries/4.9-2017.01/aarch64-linux-gnu/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz | tar -xJf - -C /tmp/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment