Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update protoc-gen-grpc-java dependency to > v1.26.0 to be able to build in ARM64 #4248

Closed
yagop opened this issue Jan 20, 2022 · 17 comments
Closed

Comments

@yagop
Copy link

yagop commented Jan 20, 2022

1. What did you do?

Trying to build java-tron

2. What did you expect to see?

A java-tron builded

3. What did you see instead?

 > Could not find protoc-gen-grpc-java-linux-aarch_64.exe (io.grpc:protoc-gen-grpc-java:1.9.0).13 actionable tasks: 13 executed
#8 164.9      Searched in the following locations:
#8 164.9          https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-java/1.9.0/protoc-gen-grpc-java-1.9.0-linux-aarch_64.exe

Problem

You are using old version of protoc-gen-grpc-java which lacks arm64 binaries. See protoc-gen-grpc-java-1.9.0-linux-aarch_64.exe is missing from https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-java/1.9.0/ .

Asking

Update protoc-gen-grpc-java to >= v1.26.0 in order to be able to build java-tron in arm64.

@vivian1912
Copy link
Contributor

Hi, please provide detailed information, thanks. which operation system and device do you compile the java-tron project, and do you use any IDE or compile tool to compile the project?

@yagop
Copy link
Author

yagop commented Jan 27, 2022

which operation system and device do you compile the java-tron project

I'm using Ubuntu 18.04.6 Docker for ARM64

do you use any IDE or compile tool to compile the project

I'm not using any IDE. Just ./gradlew build -x test

@vivian1912
Copy link
Contributor

Currently ARM64 architecture is not supported by java-tron, but it is under planning,so now I will suggest to build and run fulllnode under intel or AMD architecture, and for ARM64 support, please pay attention to the announcement or release of java-tron. Thanks.

@yagop
Copy link
Author

yagop commented Jan 29, 2022

To support ARM64 you need to upgrade protoc-gen-grpc-java which uses a very old version with CVE, see https://mvnrepository.com/artifact/io.grpc/protoc-gen-grpc-java/1.9.0

I need to run java-tron in my machine which is an ARM64. I would be happy to test for you if you do the changes.

@vivian1912
Copy link
Contributor

Thanks for your information. but for supporting ARM64 architecture, It maybe not just a dependent library needs to be upgraded, but JDK or DB and so on. and it is under planning. So now it is recommended to build on an alternative machine which based on intel/AMD. Or if you're interested on this, you can try to modify the code to meet the requirement. Thanks.

@yagop
Copy link
Author

yagop commented Jan 29, 2022

That library is a block, there might be others, you can try to build to arm64 with this Dockerfile:

# centos7 is ready for arm64
FROM centos:centos7 

ENV TMP_DIR="/tron-build"
# Use arm64-vfp-hflt
ENV JDK_TAR="jdk-8u202-linux-arm64-vfp-hflt.tar.gz"
ENV JDK_DIR="jdk1.8.0_202"
ENV BASE_DIR="/java-tron"


RUN set -o errexit -o nounset \
    && yum -y install git wget \
    && wget -P /usr/local https://github.com/frekele/oracle-java/releases/download/8u202-b08/$JDK_TAR \
    && tar -zxf /usr/local/$JDK_TAR -C /usr/local \
    && rm /usr/local/$JDK_TAR

RUN export JAVA_HOME=/usr/local/$JDK_DIR \
    && export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar \
    && export PATH=$PATH:$JAVA_HOME/bin \
    && echo "git clone" \
    && mkdir -p $TMP_DIR \
    && cd $TMP_DIR \
    && git clone https://github.com/tronprotocol/java-tron.git \
    && cd java-tron \
    && git checkout "GreatVoyage-v4.4.3" \
    && ./gradlew build -x test \
    && cd build/distributions \
    && unzip -o java-tron-1.0.0.zip \
    && mv java-tron-1.0.0 $BASE_DIR \
    && rm -rf $TMP_DIR \
    && rm -rf ~/.gradle \
    && mv $JAVA_HOME/jre /usr/local \
    && rm -rf $JAVA_HOME \
    && yum clean all

ENV JAVA_HOME="/usr/local/jre"
ENV PATH=$PATH:$JAVA_HOME/bin

COPY docker-entrypoint.sh $BASE_DIR/bin

WORKDIR $BASE_DIR

ENTRYPOINT ["./bin/docker-entrypoint.sh"]
docker buildx build --platform linux/arm64 -t java-tron .

@vivian1912
Copy link
Contributor

Thanks for your information. Because it has already under planning, so we will keep you informed if there's any progress

@yagop
Copy link
Author

yagop commented Mar 1, 2022

Any updates on this?

@forfreeday
Copy link
Contributor

@yagop
A docker mirror supporting the ARM architecture is already in development

@yagop
Copy link
Author

yagop commented May 24, 2022

Any update on this?

@forfreeday
Copy link
Contributor

The arm approach to docker images is not supported at this time

@yagop
Copy link
Author

yagop commented Jun 16, 2022

Update protoc-gen-grpc-java please

@tronprotocol tronprotocol deleted a comment from 11111961abc Jun 20, 2022
@andelf
Copy link
Contributor

andelf commented Jun 23, 2022

For compatibility with the mainnet, java-tron can only be run on x86-64 platforms(and jdk8). It requires 8087 float instructions.

@yagop
Copy link
Author

yagop commented Jun 29, 2022

It requires 8087 float instructions.

What instructions? AFIK Tron is written in pure Java so should be able to compile for the ARM JVM.

@andelf
Copy link
Contributor

andelf commented Jun 30, 2022

@yagop That's the hidden part of JVM.

In theory
If > 1/3 of the bp nodes use a non-java8 or non-x86 machine, with a carefully constructed transaction, the whole consensus might stop.

@yagop
Copy link
Author

yagop commented Jul 2, 2022

Please stop saying not verified unrelated justifications.

I’m only asking you guys to update protoc-gen-grpc-java which is using old version which is vulnerable.

@vivian-kang and @forfreeday stated this was underplaying half a year ago but no progress was made

@ethan1844
Copy link
Contributor

Thanks for your contribution to java-tron, this issue will be closed as no update for a long time.

Please feel free to re-open it if you still see the issue, thanks.

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

No branches or pull requests

11 participants
@andelf @zhaohong @yagop @forfreeday @vivian1912 @ethan1844 and others