Skip to content

Commit

Permalink
[Ruby] add aarch64 linux build (grpc#33079)
Browse files Browse the repository at this point in the history
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:
grpc#31855
grpc#29489
  • Loading branch information
alto-ruby authored Jun 25, 2023
1 parent 6076825 commit 059144a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
Expand Down Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/rake_aarch64-linux:fa2ee912553de5564f1255b780fd369698b3e06d@sha256:61a46ab67972990aea77024817d29ca6fa43d2639fe4aaef9c30e031f84519a9
15 changes: 15 additions & 0 deletions third_party/rake-compiler-dock/rake_aarch64-linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions tools/run_tests/artifacts/artifact_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 059144a

Please sign in to comment.