From 22cd00eb71c4e08ac18a3bd3b0ba29852d8f7fd7 Mon Sep 17 00:00:00 2001 From: "Alexander V. Tikhonov" Date: Mon, 14 Oct 2019 14:57:23 +0300 Subject: [PATCH] build: implement SuSE build with testing Added makefile to build the SuSE based packages. Implemented build with testing for opensuse images: SuSE 15.0, 15.1, 15.2 Tarantool spec file changed with: Added checks of %{sle_version} according to https://en.opensuse.org/openSUSE:Packaging_for_Leap#RPM_Distro_Version_Macros Found that opensuse adding linker flag like '--no-undefined' which produces the fails on building test modules at app-tap/app/box-tap suites and tests in luajit repository. Decided to block this flag. Running tests by make test, because opensuse uses out-of-source build by default. Set complete testing except replication suite. Test box-tap/cfg fails and temporary blocked according to the issue created for it #4594. Added opensuse-leap of 15.1 and 15.2 versions to Gitlab-CI packages building/deploing jobs with testings. Close #4562 --- .gitlab-ci.yml | 24 ++++++++++++++++++++++++ rpm/tarantool.spec | 23 ++++++++++++++++------- test/app-tap/CMakeLists.txt | 1 + test/app/CMakeLists.txt | 1 + test/box-tap/cfg.skipcond | 6 ++++++ test/box/CMakeLists.txt | 1 + third_party/luajit | 2 +- 7 files changed, 50 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 65b2fb1261ff..f0b9f3812f36 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -398,6 +398,18 @@ debian_10: OS: 'debian' DIST: 'buster' +opensuse_15_1: + <<: *pack_definition + variables: + OS: 'opensuse-leap' + DIST: '15.1' + +opensuse_15_2: + <<: *pack_definition + variables: + OS: 'opensuse-leap' + DIST: '15.2' + # Deploy sources_deploy: @@ -495,6 +507,18 @@ debian_10_deploy: OS: 'debian' DIST: 'buster' +opensuse_15_1_deploy: + <<: *deploy_definition + variables: + OS: 'opensuse-leap' + DIST: '15.1' + +opensuse_15_2_deploy: + <<: *deploy_definition + variables: + OS: 'opensuse-leap' + DIST: '15.2' + # Static builds static_build: diff --git a/rpm/tarantool.spec b/rpm/tarantool.spec index 88b1d6b5ce01..0fad89310569 100644 --- a/rpm/tarantool.spec +++ b/rpm/tarantool.spec @@ -1,5 +1,5 @@ # Enable systemd for on RHEL >= 7 and Fedora >= 15 -%if (0%{?fedora} >= 15 || 0%{?rhel} >= 7) +%if (0%{?fedora} >= 15 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500) %bcond_without systemd %else %bcond_with systemd @@ -7,7 +7,7 @@ BuildRequires: cmake >= 2.8 BuildRequires: make -%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7) +%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500) # RHEL 6 requires devtoolset BuildRequires: gcc >= 4.5 BuildRequires: gcc-c++ >= 4.5 @@ -72,7 +72,7 @@ BuildRequires: libunwind-devel # Set dependences for tests. # Do not install unused Python 3 packages which # is default since Fedora 31 and CentOS 8. -%if (0%{?fedora} >= 31 || 0%{?rhel} >= 8) +%if (0%{?fedora} >= 31 || 0%{?rhel} >= 8 || 0%{?sle_version} >= 1500) BuildRequires: python2 >= 2.7 BuildRequires: python2-six >= 1.9.0 BuildRequires: python2-gevent >= 1.0 @@ -105,7 +105,7 @@ Requires: /etc/services # Deps for built-in package manager # https://github.com/tarantool/tarantool/issues/2612 Requires: openssl -%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8) +%if (0%{?fedora} >= 22 || 0%{?rhel} >= 8 || 0%{?sle_version} >= 1500) # RHEL <= 7 doesn't support Recommends: Recommends: tarantool-devel Recommends: git-core @@ -141,10 +141,17 @@ C and Lua/C modules. %build # RHBZ #1301720: SYSCONFDIR an LOCALSTATEDIR must be specified explicitly -%cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \ +%if (0%{?sle_version} >= 1500) +# SuSE uses only out-of-source builds in its macros +%cmake .. \ + -DCMAKE_INSTALL_PREFIX:PATH=/usr \ +%else +%cmake . \ +%endif + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=%{_localstatedir} \ -DCMAKE_INSTALL_SYSCONFDIR:PATH=%{_sysconfdir} \ -%if %{with backtrace} +%if (%{with backtrace} || 0%{?sle_version} >= 1500) -DENABLE_BACKTRACE:BOOL=ON \ %else -DENABLE_BACKTRACE:BOOL=OFF \ @@ -157,14 +164,16 @@ C and Lua/C modules. -DENABLE_DIST:BOOL=ON make %{?_smp_mflags} +%if (0%{?sle_version} == 0) %install +%endif %make_install # %%doc and %%license macroses are used instead rm -rf %{buildroot}%{_datarootdir}/doc/tarantool/ %check %if "%{_ci}" == "travis" -%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7) +%if (0%{?fedora} >= 22 || 0%{?rhel} >= 7 || 0%{?sle_version} >= 1500) cd test && ./test-run.py --force -j 1 unit/ app/ app-tap/ box/ box-tap/ engine/ vinyl/ %endif %else diff --git a/test/app-tap/CMakeLists.txt b/test/app-tap/CMakeLists.txt index ee67cf533af5..68aa3690b051 100644 --- a/test/app-tap/CMakeLists.txt +++ b/test/app-tap/CMakeLists.txt @@ -1 +1,2 @@ +SET(CMAKE_SHARED_LINKER_FLAGS "") build_module(module_api module_api.c) diff --git a/test/app/CMakeLists.txt b/test/app/CMakeLists.txt index 059ee8f3d63b..8bafa6516d3c 100644 --- a/test/app/CMakeLists.txt +++ b/test/app/CMakeLists.txt @@ -1 +1,2 @@ +SET(CMAKE_SHARED_LINKER_FLAGS "") build_module(loaderslib loaderslib.c) diff --git a/test/box-tap/cfg.skipcond b/test/box-tap/cfg.skipcond index 33cafc12bc06..9f07f0549bb3 100644 --- a/test/box-tap/cfg.skipcond +++ b/test/box-tap/cfg.skipcond @@ -1,9 +1,15 @@ +import os import platform # Disabled on FreeBSD due to fail #4271: # Data segment size exceeds process limit if platform.system() == 'FreeBSD': self.skip = 1 +try: + if os.popen('lsb_release -i').read().split(':')[1].strip() == 'openSUSE': + self.skip = 1 +except IndexError: + pass # Disabled on OpenBSD due to fail #XXXX: if platform.system() == 'OpenBSD': diff --git a/test/box/CMakeLists.txt b/test/box/CMakeLists.txt index 06bfbbe9d00f..e65559e812c0 100644 --- a/test/box/CMakeLists.txt +++ b/test/box/CMakeLists.txt @@ -1,3 +1,4 @@ +SET(CMAKE_SHARED_LINKER_FLAGS "") include_directories(${MSGPUCK_INCLUDE_DIRS}) build_module(function1 function1.c) build_module(reload1 reload1.c) diff --git a/third_party/luajit b/third_party/luajit index 377198b88382..ccb9e59c8932 160000 --- a/third_party/luajit +++ b/third_party/luajit @@ -1 +1 @@ -Subproject commit 377198b88382960a2f0af9c09014284e34630513 +Subproject commit ccb9e59c89327e3844d5ba928840427c0075c870