diff --git a/config/software/gitlab-rails.rb b/config/software/gitlab-rails.rb index 133c42bcc39b4ea6b037b7bf073add8c5567320c_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1yYWlscy5yYg==..14266f937d96ba93b81767fa3a117ff439af9fe4_Y29uZmlnL3NvZnR3YXJlL2dpdGxhYi1yYWlscy5yYg== 100644 --- a/config/software/gitlab-rails.rb +++ b/config/software/gitlab-rails.rb @@ -87,6 +87,18 @@ env['PKG_CONFIG_PATH'] = OpenSSLHelper.pkg_config_dirs end + gem_source_compile_os = %w[ + el-8-aarch64 + amazon-2-aarch64 + debian-buster-aarch64 + raspbian-buster-aarch64 + ] + + # Currently rake-compiler-dock uses a Ubuntu 20.04 image to create the + # native gem for the aarch64-linux platform. As a result, anything + # using a glibc older than v2.29 will not work. We need to compile + # gems for these platforms. + bundle 'config force_ruby_platform true', env: env if gem_source_compile_os.include?(OhaiHelper.platform_dir) bundle 'config build.gpgme --use-system-libraries', env: env bundle "config build.nokogiri --use-system-libraries --with-xml2-include=#{install_dir}/embedded/include/libxml2 --with-xslt-include=#{install_dir}/embedded/include/libxslt", env: env bundle 'config build.grpc --with-ldflags="-latomic"', env: env if OhaiHelper.os_platform == 'raspbian' @@ -107,10 +119,12 @@ block 'reinstall google-protobuf gem' do require 'fileutils' - current_gem = shellout!("#{embedded_bin('bundle')} show | grep google-protobuf", env: env).stdout - protobuf_version = current_gem[/google-protobuf \((.*)\)/, 1] - shellout!("#{embedded_bin('gem')} uninstall --force google-protobuf", env: env) - shellout!("#{embedded_bin('gem')} install google-protobuf --version #{protobuf_version} --platform=ruby", env: env) + unless gem_source_compile_os.include?(OhaiHelper.platform_dir) + current_gem = shellout!("#{embedded_bin('bundle')} show | grep google-protobuf", env: env).stdout + protobuf_version = current_gem[/google-protobuf \((.*)\)/, 1] + shellout!("#{embedded_bin('gem')} uninstall --force google-protobuf", env: env) + shellout!("#{embedded_bin('gem')} install google-protobuf --version #{protobuf_version} --platform=ruby", env: env) + end # Delete unused shared objects included in grpc gem grpc_path = shellout!("#{embedded_bin('bundle')} show grpc", env: env).stdout.strip