[Ruby] add aarch64 linux build (#33079)

This adds pre-built library for aarch64 linux, will help improve the
install speed and avoid building environment issues at customer side.

@apolcyn @jtattermusch Can you help build and push the new rake compiler
image?
Will update the tag and hash after the image is available

Manually tested locally:
```
uname -a
Linux u20 5.15.49-linuxkit #1 SMP PREEMPT Tue Sep 13 07:51:32 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
```
```
time gem install /work/ruby/grpc/pkg/grpc-1.56.0.dev-aarch64-linux.gem
Successfully installed grpc-1.56.0.dev-aarch64-linux
Parsing documentation for grpc-1.56.0.dev-aarch64-linux
Installing ri documentation for grpc-1.56.0.dev-aarch64-linux
Done installing documentation for grpc after 0 seconds
1 gem installed

real	0m22.794s
user	0m17.268s
sys	0m5.156s
```
```
ruby greeter_server.rb &
[1] 319
ruby greeter_client.rb
"Greeting: Hello world"
```

Fixes:
https://github.com/grpc/grpc/issues/31855
https://github.com/grpc/grpc/issues/29489
pull/33546/head
alto-ruby 1 year ago committed by GitHub
parent 6076825390
commit 059144abd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      Rakefile
  2. 1
      third_party/rake-compiler-dock/rake_aarch64-linux.current_version
  3. 15
      third_party/rake-compiler-dock/rake_aarch64-linux/Dockerfile
  4. 1
      tools/run_tests/artifacts/artifact_targets.py

@ -29,7 +29,7 @@ Rake::ExtensionTask.new('grpc_c', spec) do |ext|
ext.cross_compile = true
ext.cross_platform = [
'x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt',
'x86_64-linux', 'x86-linux',
'x86_64-linux', 'x86-linux', 'aarch64-linux',
'x86_64-darwin', 'arm64-darwin',
'universal-darwin'
]
@ -158,7 +158,7 @@ task 'gem:native', [:plat] do |t, args|
prepare_ccache_cmd += "source tools/internal_ci/helper_scripts/prepare_ccache_symlinks_rc "
supported_windows_platforms = ['x86-mingw32', 'x64-mingw32', 'x64-mingw-ucrt']
supported_unix_platforms = ['x86_64-linux', 'x86-linux', 'x86_64-darwin', 'arm64-darwin']
supported_unix_platforms = ['x86_64-linux', 'x86-linux', 'aarch64-linux', 'x86_64-darwin', 'arm64-darwin']
supported_platforms = supported_windows_platforms + supported_unix_platforms
if selected_plat.empty?

@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/rake_aarch64-linux:fa2ee912553de5564f1255b780fd369698b3e06d@sha256:61a46ab67972990aea77024817d29ca6fa43d2639fe4aaef9c30e031f84519a9

@ -0,0 +1,15 @@
FROM ghcr.io/rake-compiler/rake-compiler-dock-image:1.3.0-mri-aarch64-linux
#=================
# Install ccache
# Install ccache from source since ccache 3.x packaged with most linux distributions
# does not support Redis backend for caching.
RUN curl -sSL -o ccache.tar.gz https://github.com/ccache/ccache/releases/download/v4.5.1/ccache-4.5.1.tar.gz \
&& tar -zxf ccache.tar.gz \
&& cd ccache-4.5.1 \
&& mkdir build && cd build \
&& cmake -DCMAKE_BUILD_TYPE=Release -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. \
&& make -j4 && make install \
&& cd ../.. \
&& rm -rf ccache-4.5.1 ccache.tar.gz

@ -471,6 +471,7 @@ def targets():
RubyArtifact("linux", "x64-mingw-ucrt", presubmit=True),
RubyArtifact("linux", "x86_64-linux", presubmit=True),
RubyArtifact("linux", "x86-linux", presubmit=True),
RubyArtifact('linux', 'aarch64-linux', presubmit=True),
RubyArtifact("linux", "x86_64-darwin", presubmit=True),
RubyArtifact("linux", "arm64-darwin", presubmit=True),
PHPArtifact("linux", "x64", presubmit=True),

Loading…
Cancel
Save