diff --git a/config/software/grafana.rb b/config/software/grafana.rb index 8e9f64e82454060cbbe3f9e41242956a944794bb..e53a15346d966761a5fdbabc02459558dae0db60 100644 --- a/config/software/grafana.rb +++ b/config/software/grafana.rb @@ -15,6 +15,7 @@ # require "#{Omnibus::Config.project_root}/lib/gitlab/version" +require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb" name 'grafana' version = Gitlab::Version.new('grafana', '7.5.5') @@ -26,7 +27,7 @@ license_file 'NOTICE.md' skip_transitive_dependency_licensing true -arch, sha = if ohai['platform'] == 'raspbian' && /armv/.match?(ohai['kernel']['machine']) +arch, sha = if OhaiHelper.raspberry_pi? %w[armv7 13a5fde5651d75b8ec560b52b6c7eccfda997015077f2a9ff3bbdb2709938def] elsif /aarch64/.match?(ohai['kernel']['machine']) %w[arm64 cd65cd84c38c7a43afeb0b1895e97a7b4f3203340be2da070a6dee75ead3fdfe] diff --git a/config/software/libffi.rb b/config/software/libffi.rb index 5c3dd0e27d567df3940751015a785bd493fdd8bd..f718e51fbb3853569709f45a43096ee36ace034c 100644 --- a/config/software/libffi.rb +++ b/config/software/libffi.rb @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb" name 'libffi' @@ -46,6 +47,7 @@ build do if version == '3.2.1' patch source: 'libffi-3.2.1-disable-multi-os-directory.patch', plevel: 1, env: env configure_command << '--disable-multi-os-directory' + configure_command << "--build=#{OhaiHelper.gcc_target}" if OhaiHelper.raspberry_pi? end end diff --git a/config/software/libgcrypt.rb b/config/software/libgcrypt.rb index e4ffc9bc3d36d794bdc3727474be8dfaf7cc0b08..f7306c40e8367da07bdafe63d7e01c2128660418 100644 --- a/config/software/libgcrypt.rb +++ b/config/software/libgcrypt.rb @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb" name 'libgcrypt' default_version '1.9.3' @@ -31,8 +32,9 @@ relative_path "libgcrypt-#{version}" build do env = with_standard_compiler_flags(with_embedded_path) - command './configure ' \ - "--prefix=#{install_dir}/embedded --disable-doc", env: env + configure_options = ["--prefix=#{install_dir}/embedded", "--disable-doc"] + configure_options += %w(host build).map { |w| "--#{w}=#{OhaiHelper.gcc_target}" } if OhaiHelper.raspberry_pi? + configure(*configure_options, env: env) make "-j #{workers}", env: env make 'install', env: env diff --git a/config/software/openssl.rb b/config/software/openssl.rb index 26f67a01b09958530006b079fdfd835695b66f31..2b8f03de917b742cbcb27be68b29f7a0e9983773 100644 --- a/config/software/openssl.rb +++ b/config/software/openssl.rb @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +require "#{Omnibus::Config.project_root}/lib/gitlab/ohai_helper.rb" name 'openssl' @@ -84,6 +85,8 @@ build do # With gcc > 4.3 on s390x there is an error building # with inline asm enabled './Configure linux64-s390x -DOPENSSL_NO_INLINE_ASM' + elsif OhaiHelper.raspberry_pi? + './Configure linux-generic32' else './config' end diff --git a/config/software/ruby.rb b/config/software/ruby.rb index 5f60bee8544fcfc20383db427ea9e09797f6dda1..678d27a5d4ba6dee4b61fcfd0cd257823f1aaefa 100644 --- a/config/software/ruby.rb +++ b/config/software/ruby.rb @@ -202,6 +202,7 @@ build do elsif windows? configure_command << ' debugflags=-g' else + configure_command << %w(host target build).map { |w| "--#{w}=#{OhaiHelper.gcc_target}" } if OhaiHelper.raspberry_pi? configure_command << "--with-opt-dir=#{install_dir}/embedded" end diff --git a/gitlab-ci-config/dev-gitlab-org.yml b/gitlab-ci-config/dev-gitlab-org.yml index bc132ff636ccb44490db8eb5c9cb1d5ad50ef3f7..4d71534294c1ad513e6c599cf180c6981e0c35bb 100644 --- a/gitlab-ci-config/dev-gitlab-org.yml +++ b/gitlab-ci-config/dev-gitlab-org.yml @@ -368,7 +368,7 @@ variables: NO_SOURCEMAPS: "true" tags: - - docker-rpi-builder + - docker-arm-builder <<: *dev-ce-branch-only-except-nightly artifacts: *package-artifacts retry: 1 @@ -410,7 +410,7 @@ variables: NO_SOURCEMAPS: "true" tags: - - docker-rpi-builder + - docker-arm-builder <<: *dev-ce-tag-only ### This stage is used for uploading packages diff --git a/lib/gitlab/ohai_helper.rb b/lib/gitlab/ohai_helper.rb index 422f775b8cba0a542378893cc7743769aca84ef2..e6ed11a91d6838bd145253618d222cfc77623b80 100644 --- a/lib/gitlab/ohai_helper.rb +++ b/lib/gitlab/ohai_helper.rb @@ -128,7 +128,7 @@ class OhaiHelper def ohai @ohai ||= Ohai::System.new.tap do |oh| - oh.all_plugins(['platform']) + oh.all_plugins(['platform', 'languages']) end.data end @@ -159,5 +159,13 @@ class OhaiHelper # Any Arm (32-bit or 64-bit) (armhf? || arm64?) end + + def raspberry_pi? + os_platform == 'raspbian' + end + + def gcc_target + ohai['languages']['c']['gcc']['target'] + end end end