Skip to content
Snippets Groups Projects
Commit 4910461d authored by Balasankar C's avatar Balasankar C
Browse files

Merge branch 'sh-glibc-fix-rake' into 'master'

Force older x86 platforms to recompile native gems

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/8087



Merged-by: default avatarBalasankar 'Balu' C <balasankar@gitlab.com>
Approved-by: default avatarAndrew Patterson <apatterson@gitlab.com>
Approved-by: default avatarBalasankar 'Balu' C <balasankar@gitlab.com>
Co-authored-by: default avatarStan Hu <stanhu@gmail.com>
parents 0fdee301 5b8bc4e0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -90,6 +90,26 @@ env['CFLAGS'] << ' -O3 -g -pipe'
# Workaround for https://bugs.ruby-lang.org/issues/19161
env['CFLAGS'] << ' -std=gnu99' if OhaiHelper.os_platform == 'sles'
 
# We need to recompile native gems on SLES 12 and CentOS 7 because
# precompiled gems such as nokogiri now require glibc >= 2.29,
# and these operating systems use older versions.
#
# By default, Ruby C extensions use `RbConfig::MAKEFILE_CONFIG["CC"]`,
# which is the C compiler used to build Ruby. Some C extensions can use
# alternative compilers by defining the CC/CXX environment
# variables. However, google-protobuf does not yet support this, but
# https://github.com/protocolbuffers/protobuf/pull/19863 adds upstream
# support. For now, compiling the Ruby interpreter with GCC 8 works and
# avoids the need to specify the compiler for every extension that needs
# it.
if OhaiHelper.centos7?
env['CC'] = "/opt/rh/devtoolset-8/root/usr/bin/gcc"
env['CXX'] = "/opt/rh/devtoolset-8/root/usr/bin/g++"
elsif OhaiHelper.sles12?
env['CC'] = "/usr/bin/gcc-8"
env['CXX'] = "/usr/bin/g++-8"
end
build do
env['CFLAGS'] << ' -fno-omit-frame-pointer'
# Fix for https://bugs.ruby-lang.org/issues/18409. This can be removed with Ruby 3.0+.
Loading
Loading
Loading
Loading
@@ -8,7 +8,7 @@ variables:
# To be used for images that exist only on dev.gitlab.org
DEV_BUILDER_IMAGE_REGISTRY: 'dev.gitlab.org:5005/cookbooks/gitlab-omnibus-builder'
PUBLIC_BUILDER_IMAGE_REGISTRY: "registry.gitlab.com/gitlab-org/gitlab-omnibus-builder"
BUILDER_IMAGE_REVISION: "5.22.0"
BUILDER_IMAGE_REVISION: "5.23.0"
# The registry to pull the assets image from
ASSET_REGISTRY: "${CI_REGISTRY}"
ASSET_SYNC_EXISTING_REMOTE_FILES: "keep"
Loading
Loading
Loading
Loading
@@ -194,16 +194,20 @@ class OhaiHelper
os_platform == 'sles' && get_suse_version.to_i == 12
end
 
# 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.
# rake-compiler-dock v1.7.0 uses an Ubuntu 20.04 image to create
# precompiled native gems. As a result, precompiled gems will
# require glibc v2.29 or higher. On older platforms, we need to
# recompile these gems for them to work.
def ruby_native_gems_unsupported?
%w[
el-8_aarch64
amazon-2
amazon-2_aarch64
debian-buster_aarch64
el-7
el-8
el-8_aarch64
raspbian-buster_aarch64
sles-12.5
].include?(platform_dir)
end
end
Loading
Loading
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