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

Merge branch 'jliu/add-git-build-opts-to-gitaly' into 'master'

parents 42bb8539 d1e4d3eb
No related branches found
No related tags found
2 merge requests!153heptapod#1722: making 17.3 the new stable,!151Merge upstream Omnibus GitLab into Omnibus Heptapod
......@@ -57,6 +57,10 @@
# Similar is the case for SLES OSs also.
git_cflags += ' -std=gnu99' if OhaiHelper.get_centos_version.to_i == 7 || OhaiHelper.os_platform == 'sles'
# NOTE: the Git software definition is in the process of being deprecated in favour of bundling
# Git with Gitaly. Any changes to the following build options must be replicated to the Gitaly
# software definition at config/software/gitaly.rb in the env hash. See
# https://gitlab.com/gitlab-org/gitaly/-/issues/6195 for more information.
build_options = [
"# Added by Omnibus git software definition git.rb",
"GIT_APPEND_BUILD_OPTIONS += CURLDIR=#{install_dir}/embedded",
......
......@@ -31,6 +31,13 @@
dependency 'libicu'
dependency 'omnibus-gitlab-gems'
# Dependencies for building Git as part of Gitaly
dependency 'zlib'
dependency 'openssl' unless Build::Check.use_system_ssl?
dependency 'curl'
dependency 'pcre2'
dependency 'libiconv'
# Technically, gitaly depends on git also. But because of how omnibus arranges
# components to be built, this causes git to be built early in the process. But
# in our case, git is built from gitaly source code. This results in git
......@@ -47,7 +54,26 @@
build do
env = with_standard_compiler_flags(with_embedded_path)
git_cflags = '-fno-omit-frame-pointer'
# CentOS 7 uses gcc v4.8.5, which uses C90 (`-std=gnu90`) by default.
# C11 is a newer standard than C90, and gcc v5.1.0 switched the default
# from `std=gnu90` to `std=gnu11`.
# Git v2.35 added a balloon test that will fail the build if
# C99 is not supported. On other platforms, C11 may be required
# (https://gitlab.com/gitlab-org/gitlab-git/-/commit/7bc341e21b5).
# Similar is the case for SLES OSs also.
git_cflags += ' -std=gnu99' if OhaiHelper.get_centos_version.to_i == 7 || OhaiHelper.os_platform == 'sles'
env['CURLDIR'] = "#{install_dir}/embedded"
env['ICONVDIR'] = "#{install_dir}/embedded"
env['ZLIB_PATH'] = "#{install_dir}/embedded"
env['NEEDS_LIBICONV'] = 'YesPlease'
env['NO_R_TO_GCC_LINKER'] = 'YesPlease'
env['INSTALL_SYMLINKS'] = 'YesPlease'
env['CFLAGS'] = "\"#{git_cflags}\""
if Build::Check.use_system_ssl?
env['CMAKE_FLAGS'] = OpenSSLHelper.cmake_flags
env['PKG_CONFIG_PATH'] = OpenSSLHelper.pkg_config_dirs
env['FIPS_MODE'] = '1'
......@@ -50,7 +76,9 @@
if Build::Check.use_system_ssl?
env['CMAKE_FLAGS'] = OpenSSLHelper.cmake_flags
env['PKG_CONFIG_PATH'] = OpenSSLHelper.pkg_config_dirs
env['FIPS_MODE'] = '1'
else
env['OPENSSLDIR'] = "#{install_dir}/embedded"
end
make "install PREFIX=#{install_dir}/embedded", env: env
......
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