-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add riscv64 support #12318
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
base: master
Are you sure you want to change the base?
Add riscv64 support #12318
Conversation
@@ -40,6 +40,9 @@ LOCAL_OTHER_ARTIFACTS="$KOKORO_GFILE_DIR"/github/grpc-java/artifacts/ | |||
# for linux s390x platform | |||
[[ "$(find "$LOCAL_MVN_ARTIFACTS" -type f -iname 'protoc-gen-grpc-java-*-linux-s390_64.exe' | wc -l)" != '0' ]] | |||
|
|||
# for linux riscv64 platform | |||
[[ "$(find "$LOCAL_MVN_ARTIFACTS" -type f -iname 'protoc-gen-grpc-java-*-linux-riscv64.exe' | wc -l)" != '0' ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AgraVator, FYI, the important part about the output file name is it matches what will be generated by os-maven-plugin, in particular "riscv64" here. It does match, so this looks good.
The CI is failing:
|
It looks like some dependency packages were missing during the build, so I’ve added them in As for the failed workflow, I can't reproduction it locally, that job in my repo has passed: links Let me try to force push again to restart the workflow. |
Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
As described in our CONTRIBUTING.md, please address issues with additional commits. The force-pushes require us to re-review the full PR instead of just looking at the changes. (Nothing to be done at this point right now, but for the future.) |
buildscripts/make_dependencies.sh
Outdated
@@ -55,6 +55,8 @@ else | |||
GCC_ARCH=s390x-linux-gnu | |||
elif [[ "$ARCH" == loongarch_64 ]]; then | |||
GCC_ARCH=loongarch64-unknown-linux-gnu | |||
elif [[ "$ARCH" == riscv* ]]; then | |||
GCC_ARCH=riscv64-unknown-linux-gnu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be riscv64-linux-gnu
for the multiarch container. Running a Ubuntu 18.04 container on my machine shows that riscv64-linux-gnu-gcc exists. I think that will fix the CI failure.
Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
Alright, I’ve double-checked: my repo’s CI passes all tests now, but the pr’s CI is failing... :( |
The only CI that should fail by this change is "Linux artifacts", which you can't run on our own. It is currently failing, but for a very different reason (PROGRESS!! ??):
Looks like it is a protobuf or absl bug, but caused by riscv being a snowflake? protocolbuffers/protobuf#14549 and abseil/abseil-cpp#1561 The "fix" looks like a workaround. Unfortunately, that means just upgrading a component isn't likely to fix this. |
There is a possibility this is caused by a particular version of GCC or the like. If you don't see this on your machine, then maybe Ubuntu 18.04 (multiarch image) has the trouble but Ubuntu 20.04 or 22.04 won't? |
Both Ubuntu 18.04 and 20.04 are out of their regular support window. I'll need to cross-check with the glibc version on Debian, but I might just upgrade those images and see if this problem fixes itself. |
Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
Interesting.... It passed and what I do was just back to the HEAD^ |
The Linux Artifacts CI hadn't run yet. I have to start it for you. I've started it. |
… a bug Co-authored-by: gong-flying <gongxiaofei24@iscas.ac.cn>
So sorry about that, I found a bug in my code. diff --git a/compiler/check-artifact.sh b/compiler/check-artifact.sh
index a2632be81..4b78beeb5 100755
--- a/compiler/check-artifact.sh
+++ b/compiler/check-artifact.sh
@@ -61,10 +61,10 @@ checkArch ()
assertEq "$format" "elf64-x86-64" $LINENO
elif [[ "$ARCH" == aarch_64 ]]; then
assertEq "$format" "elf64-little" $LINENO
- elif [[ "$ARCH" == loongarch_64 ]]; then
- echo $format
elif [[ "$ARCH" == riscv64 ]]; then
assertEq "$format" "elf64-littleriscv" $LINENO
+ elif [[ "$ARCH" == loongarch_64 ]]; then
+ echo $format
assertEq "$format" "elf64-loongarch" $LINENO
elif [[ "$ARCH" == ppcle_64 ]]; then
format="$(powerpc64le-linux-gnu-objdump -f "$1" | grep -o "file format .*$" | grep -o "[^ ]*$")" The reason was that I used a patch-file to load my changes, but my changes are based on 1.5x.x. When I patched it in 1.7x.x, it went wrong because line-number location. So sorry about that. |
Why
Feat: #12316
Others
Specially, in 1.55.x, maybe we should patch
buildscripts/kokoro/linux_artifacts.sh
in another way, but I don't know whether I need to make another PR to support that.If you have any issues with this library in conjunction with "protoc-jar" under RISC-V64, you can refer to the blog:
links
or repo to get that resource:
links