Skip to content
Snippets Groups Projects
Commit 14266f937d96 authored by Balasankar 'Balu' C's avatar Balasankar 'Balu' C
Browse files

Recompile nokogiri from source in specific arm platforms

On arm-based platforms where glibc version is less than what is required
for nokogiri, delete the native extension and recompile it from source.

Closes https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/6773



Changelog: fixed

Signed-off-by: default avatarBalasankar "Balu" C <balasankar@gitlab.com>
parent 133c42bcc39b
No related branches found
No related tags found
2 merge requests!71heptapod#685: making 0.32 the new stable,!69GitLab 14.10 / Heptapod 0.32
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment