libgit2 for Gitaly fails to build on older OSs like CentOS 6, CentOS7, and Debian 8
As seen from https://dev.gitlab.org/gitlab/omnibus-gitlab/-/pipelines/163805
The following shell command exited with status 2:
$ CFLAGS=-I/opt/gitlab/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector CPPFLAGS=-I/opt/gitlab/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector CXXFLAGS=-I/opt/gitlab/embedded/include -O2 -D_FORTIFY_SOURCE=2 -fstack-protector LDFLAGS=-Wl,-rpath,/opt/gitlab/embedded/lib -L/opt/gitlab/embedded/lib LD_RUN_PATH=/opt/gitlab/embedded/lib OMNIBUS_INSTALL_DIR=/opt/gitlab PATH=/opt/gitlab/bin:/opt/gitlab/embedded/bin:/builds/gitlab/omnibus-gitlab/gems/ruby/2.6.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PKG_CONFIG_PATH=/opt/gitlab/embedded/lib/pkgconfig make install PREFIX=/opt/gitlab/embedded
Output:
git clone --depth 1 --branch v1.0.1 --quiet https://gitlab.com/libgit2/libgit2 /var/cache/omnibus/src/gitaly/_build/src/libgit2
-- The C compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Configuring incomplete, errors occurred!
See also "/var/cache/omnibus/src/gitaly/_build/src/libgit2/build/CMakeFiles/CMakeOutput.log".
Makefile:384: recipe for target '/var/cache/omnibus/src/gitaly/_build/libgit2/lib/libgit2.a' failed
Error:
Note: switching to '0ced29612dacb67eefe0c562a5c1d3aab21cce96'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
CMake Error at CMakeLists.txt:15 (CMAKE_MINIMUM_REQUIRED):
CMake 3.5.1 or higher is required. You are running version 3.0.2
Possibly caused by gitaly!2413 (merged). https://github.com/libgit2/libgit2/blob/v1.0.1/CMakeLists.txt#L15 mandates a minimum version for CMake
Edited by Balasankar 'Balu' C