This series contains auxiliary activities required for this issue[1]. The second and main patch updates Tarantool build infrastructure to use CMake 3.1 or newer. Since this CMake release[2] the vital for LuaJIT testing environment feature is introduced: one can use generator expressions[3] in target DEPENDS section. This CMake feature is used to pass either Tarantool binary or LuaJIT binary to the newly implemented testing machinery with no changes in it. Unfortunately, not all distributions provides CMake 3.1 or newer from their repositories. Here is the actual list of default packages providing CMake for the distributions that support Tarantool: | Distro | CMake version | Repo | |--------------------+---------------+---------------------| | CentOS 6 | 2.8.12 | base | | CentOS 7 | 2.8.12 | base | | CentOS 8 | 3.11.4 | appstream | | Debian Jessie | 3.0.2 | jessie/main | | Debian Stretch | 3.7.2 | stretch/main | | Debian Buster | 3.13.4 | buster/main | | Fedora 28 | 3.14.4 | updates | | Fedora 29 | 3.14.5 | updates | | Fedora 30 | 3.17.2 | updates | | Fedora 31 | 3.17.4 | updates | | Fedora 32 | 3.17.4 | updates | | FreeBSD 12 | 3.15.5 | default | | OSX 14 | 3.19.3 | brew | | OSX 15 | 3.19.3 | brew | | Ubuntu 14.04 | 2.8.12 | trusty/main | | Ubuntu 16.04 | 3.5.1 | xenial-updates/main | | Ubuntu 18.04 | 3.10.2 | bionic-updates/main | | Ubuntu 20.04 | 3.16.3 | focal/main | | openSUSE Leap 15.1 | 3.10.2 | Main | | openSUSE Leap 15.2 | 3.17.0 | Main | As one can see, there are no required packages provided by default for the following old distributions: CentOS 6, CentOS 7, Debian Jessie and Ubuntu 14.04. There are alternative packages (i.e. cmake3) providing a newer CMake than the default one for the old packages: | Distro | CMake3 version | Repo | |--------------------+-----------------+-------------------------| | CentOS 6 | 3.6.1 | epel* | | CentOS 7 | 3.17.5 | epel* | | Ubuntu 14.04 | 3.5.1 | trusty-updates/universe | (*) Unfortunately, I failed to find the way to make rpmbuild install and enable EPEL repository prior to the build step. However, cmake3 requirement obligues user to enable EPEL by himself, otherwise this dependency is left unmet. If there are any issues with building an RPM on CentOS 7 please proceed to the docs: https://www.tarantool.io/en/doc/latest/dev_guide/building_from_source/ So the last problem is Debian Jessie: the required CMake toolchain is provided neither via the default repository nor via the auxiliary one (e.g. updates like it's done for Ubuntu 14.04). Anyway, Debian Jessie long term support has reached its EOL[4], so we can freely drop this distribution from our regular building testing. This is done in the first patch of this series. NB: Be careful with updating CMake to 3.1 in CMakeLists. The following patch breaks Tarantool build. | diff --git a/CMakeLists.txt b/CMakeLists.txt | index 4fbd19558..6dc78fa88 100644 | --- a/CMakeLists.txt | +++ b/CMakeLists.txt | @@ -1,4 +1,4 @@ | -cmake_minimum_required(VERSION 2.8) | +cmake_minimum_required(VERSION 3.1) | | project(tarantool C CXX) | Surprisingly, as a result of this change -Wno-gnu-alignof-expression flag is removed from CFLAGS and the build fails on OSX with the following error[5]: | /tarantool/src/box/field_map.c:69:36: error: '_Alignof' applied to an expression is a GNU extension [-Werror,-Wgnu-alignof-expression] | region_aligned_alloc(region, sz, alignof(*extent)); | ^ | /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdalign.h:15:17: note: expanded from macro 'alignof' | #define alignof _Alignof | ^ | 1 error generated. Anyway, I believe this is out of the scope of this series, so I just leave this for the further CMake upgrade endeavors. [1]: https://github.com/tarantool/tarantool/issues/4862 [2]: https://cmake.org/cmake/help/latest/release/3.1.html#commands [3]: https://cmake.org/cmake/help/v3.1/manual/cmake-generator-expressions.7.html [4]: https://www.debian.org/News/2020/20200709 [5]: https://gitlab.com/tarantool/tarantool/-/pipelines/243423841 Branch: https://github.com/tarantool/tarantool/tree/imun/cmake3-toolchain Issue: https://github.com/tarantool/tarantool/issues/4862 CI is green: https://gitlab.com/tarantool/tarantool/-/pipelines/244503943 Igor Munkin (2): gitlab-ci: purge Debian Jessie from CI build: update minimal CMake version to 3.1 .gitlab-ci.yml | 12 ------------ debian/control | 9 ++++++++- rpm/tarantool.spec | 33 ++++++++++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 16 deletions(-) -- 2.25.0
Long term support for Debian Jessie has reached its EOL[1] and there are no packages providing CMake 3.1 or newer for this distribution. These packages are essential for implementing LuaJIT self-sufficient testing environment. See more info in the next patch. [1]: https://www.debian.org/News/2020/20200709 Relates to #4862 Signed-off-by: Igor Munkin <imun@tarantool.org> --- .gitlab-ci.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 03e16fc1c..1bd16e097 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -501,12 +501,6 @@ ubuntu_20_04: OS: 'ubuntu' DIST: 'focal' -debian_8: - <<: *pack_definition - variables: - OS: 'debian' - DIST: 'jessie' - debian_9: <<: *pack_definition variables: @@ -610,12 +604,6 @@ ubuntu_20_04_deploy: OS: 'ubuntu' DIST: 'focal' -debian_8_deploy: - <<: *deploy_definition - variables: - OS: 'debian' - DIST: 'jessie' - debian_9_deploy: <<: *deploy_definition variables: -- 2.25.0
In scope of implementing self-sufficient testing environment LuaJIT build system is partially ported to CMake. While integrating the new build system with Tarantool it was found (on practice of course) that using generator expressions[1] in target DEPENDS section is introduced only in CMake 3.1[2]. This CMake feature is used to pass so called "LuaJIT binary" to be used in LuaJIT tests, so one can run the same testing machinery with both Tarantool and LuaJIT with no changes in it. [1]: https://cmake.org/cmake/help/v3.1/manual/cmake-generator-expressions.7.html [2]: https://cmake.org/cmake/help/latest/release/3.1.html#commands Relates to #4862 Signed-off-by: Igor Munkin <imun@tarantool.org> @TarantoolBot document Title: Update CMake minimal required version in build documentation This commit updates the CMake minimal required version to be used in Tarantool build infrastructure. However, one can build Tarantool from sources and the required toolchain list should be updated. CMake minimal required version is 3.1 since this commit. See the commit message for more info. --- debian/control | 9 ++++++++- rpm/tarantool.spec | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index 38d0ba731..0741e91f8 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,14 @@ Uploaders: Dmitry E. Oboukhov <unera@debian.org> Build-Depends: cdbs (>= 0.4.100), debhelper (>= 9), dpkg-dev (>= 1.16.1~), # Enable systemd for Debian Jessie+ and Ubuntu Wily+ debhelper (>= 9.20160709) | dh-systemd (>= 1.22) | sysvinit (<< 2.88dsf-59) | upstart (<< 1.13), - cmake, +# XXX: This is a tiny hack to support Tarantool build on the old +# distributions (e.g. Ubuntu Trusty Tahr) providing CMake 3+ via +# cmake3 package that conflicts and replaces cmake package (that +# provides CMake 2.18). Alternatives resolution order allows to +# make package manager seek for cmake3 package at first and use it +# if it found or fallback to cmake package (that provides CMake 3+ +# for modern distributions) otherwise. + cmake3 (>= 3.1) | cmake (>= 3.1), libreadline-dev, libncurses5-dev, libssl-dev, diff --git a/rpm/tarantool.spec b/rpm/tarantool.spec index aae60f8dc..4167ca480 100644 --- a/rpm/tarantool.spec +++ b/rpm/tarantool.spec @@ -5,7 +5,28 @@ %bcond_with systemd %endif -BuildRequires: cmake >= 2.8 +# XXX: There is an old CMake (2.8.12) provided by cmake package in +# main CentOS repositories for distributions older than CentOS 7 +# (inclusively). At the same time, there is a newer package cmake3 +# providing CMake 3+ from EPEL repository. Ergo, one need to use +# cmake3 package to build Tarantool on old systems. +# FIXME: Make the condition simpler after CentOS 6 is purged from +# Tarantool infrastructure. +%define use_cmake3 %{?rhel:%{rhel}}%{!?rhel:9999} <= 7 + +%if %use_cmake3 +# XXX: Unfortunately there is no way to make rpmbuild install and +# enable EPEL repository prior to the build step. However, the +# requirement below obligues user to enable EPEL by himself, +# otherwise this dependency is left unmet. If there are any issues +# with building an RPM package on RHEL/CentOS 6 and RHEL/CentOS 7 +# proceed to the docs: +# https://www.tarantool.io/en/doc/latest/dev_guide/building_from_source/ +BuildRequires: cmake3 >= 3.1 +%else +BuildRequires: cmake >= 3.1 +%endif + BuildRequires: make %if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500) # RHEL 6 requires devtoolset @@ -115,7 +135,7 @@ Requires: openssl # RHEL <= 7 doesn't support Recommends: Recommends: tarantool-devel Recommends: git-core -Recommends: cmake >= 2.8 +Recommends: cmake >= 3.1 Recommends: make Recommends: gcc >= 4.5 Recommends: gcc-c++ >= 4.5 @@ -147,7 +167,14 @@ C and Lua/C modules. %build # RHBZ #1301720: SYSCONFDIR an LOCALSTATEDIR must be specified explicitly -%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \ +# XXX: KISS, please. I can play with RPM macros to redefine %cmake +# macro for cmake3 usage, but it totally doesn't worth it. +%if %use_cmake3 +%cmake3 \ +%else +%cmake \ +%endif + . -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \ -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \ %if %{with backtrace} -- 2.25.0
Here is the forgotten ChangeLog entry. I don't know whether we have already started the new approach proposed here[1], so I just leave the entry below. @ChangeLog: * Updated CMake minimal required version in Tarantool build infrastructure to 3.1. -- Best regards, IM
I faced another strangle behaviour in rpmbuild. I rebased my WIP branch with the new LuaJIT testing machinery on this series and the build failed[1]. After the fix below both CI are fine: this series[2] and LuaJIT testing machinery WIP branch[3] (except the known problem with ASAN job). On 20.01.21, Igor Munkin wrote: <snipped> > diff --git a/rpm/tarantool.spec b/rpm/tarantool.spec > index aae60f8dc..4167ca480 100644 > --- a/rpm/tarantool.spec > +++ b/rpm/tarantool.spec <snipped> > @@ -115,7 +135,7 @@ Requires: openssl > # RHEL <= 7 doesn't support Recommends: > Recommends: tarantool-devel > Recommends: git-core > -Recommends: cmake >= 2.8 > +Recommends: cmake >= 3.1 > Recommends: make > Recommends: gcc >= 4.5 > Recommends: gcc-c++ >= 4.5 > @@ -147,7 +167,14 @@ C and Lua/C modules. > > %build > # RHBZ #1301720: SYSCONFDIR an LOCALSTATEDIR must be specified explicitly > -%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \ > +# XXX: KISS, please. I can play with RPM macros to redefine %cmake > +# macro for cmake3 usage, but it totally doesn't worth it. If there is %cmake in *comment* then the branching below is ignored (I guess) and the build is broken since the old CMake is used. Well, I can state nothing with certainty, but if I remove % sign everything works. This is ridiculous. Here is the iterative fix: ================================================================================ diff --git a/rpm/tarantool.spec b/rpm/tarantool.spec index 9774dca..f1ad949 100644 --- a/rpm/tarantool.spec +++ b/rpm/tarantool.spec @@ -168,7 +168,7 @@ C and Lua/C modules. %build # RHBZ #1301720: SYSCONFDIR an LOCALSTATEDIR must be specified explicitly -# XXX: KISS, please. I can play with RPM macros to redefine %cmake +# XXX: KISS, please. I can play with RPM macros to redefine cmake # macro for cmake3 usage, but it totally doesn't worth it. %if %use_cmake3 %cmake3 \ ================================================================================ Fixed, squashed, force pushed to the remote branches. > +%if %use_cmake3 > +%cmake3 \ > +%else > +%cmake \ > +%endif > + . -DCMAKE_BUILD_TYPE=RelWithDebInfo \ > -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \ > -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \ > %if %{with backtrace} > -- > 2.25.0 > [1]: https://gitlab.com/tarantool/tarantool/-/pipelines/244558416 [2]: https://gitlab.com/tarantool/tarantool/-/pipelines/244656467 [3]: https://gitlab.com/tarantool/tarantool/-/pipelines/244657524 -- Best regards, IM
Please, disregard this series in favor of v2[1]. [1]: https://lists.tarantool.org/tarantool-patches/cover.1611598362.git.imun@tarantool.org/T/#u -- Best regards, IM