From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 8C5D7469719 for ; Thu, 8 Oct 2020 11:09:56 +0300 (MSK) From: "Alexander V. Tikhonov" Date: Thu, 8 Oct 2020 11:09:54 +0300 Message-Id: <4996f2a73e39fe0bfd70febc07d36b9b11b9ea31.1602143974.git.avtikhon@tarantool.org> In-Reply-To: <4fc536691abbbbb9f3439bb60bef7a551663a5b5.1602143974.git.avtikhon@tarantool.org> References: <4fc536691abbbbb9f3439bb60bef7a551663a5b5.1602143974.git.avtikhon@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v1] gitlab-ci: add out-of-source build List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Munkin , Kirill Yukhin Cc: tarantool-patches@dev.tarantool.org, Alexander Turenko Implemented out-of-source build at cmake files. Added out of source build make targets and added test job to gitlab-ci. Closes #4874 --- Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4874-out-of-source-build-full-ci Issue: https://github.com/tarantool/tarantool/issues/4874 .gitlab-ci.yml | 7 +++++++ .travis.mk | 26 +++++++++++++++++++++++++- cmake/utils.cmake | 4 ++-- src/box/CMakeLists.txt | 1 + 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d40dc74e3..d5dc52f82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -174,6 +174,13 @@ luacheck: # Tests +out_of_source: + stage: test + tags: + - deploy_test + script: + - ${GITLAB_MAKE} test_oos_build + release: <<: *docker_test_definition script: diff --git a/.travis.mk b/.travis.mk index d797472e2..5730e1097 100644 --- a/.travis.mk +++ b/.travis.mk @@ -7,7 +7,9 @@ DOCKER_IMAGE_TARANTOOL="registry.gitlab.com/tarantool/tarantool/testing/debian-s TEST_RUN_EXTRA_PARAMS?= MAX_FILES?=65534 MAX_PROC?=2500 -OOS_SRC_PATH="/source" +OOS_SRC_PATH?="/source" +OOS_BUILD_PATH?="/rw_bins" +OOS_BUILD_RULE?=test_oos_no_deps BIN_DIR=/usr/local/bin OSX_VARDIR?=/tmp/tnt @@ -207,6 +209,28 @@ test_debian_install_luacheck: test_debian_luacheck: test_debian_install_luacheck configure_debian make luacheck +# Out-Of-Source build + +build_oos: + mkdir ${OOS_BUILD_PATH} 2>/dev/null || : ; \ + cd ${OOS_BUILD_PATH} && \ + cmake ${OOS_SRC_PATH} ${CMAKE_EXTRA_PARAMS} && \ + make -j + +test_oos_no_deps: build_oos + cd ${OOS_BUILD_PATH}/test && \ + ${OOS_SRC_PATH}/test/test-run.py \ + --builddir ${OOS_BUILD_PATH} \ + --vardir ${OOS_BUILD_PATH}/test/var --force + +test_oos: deps_debian test_oos_no_deps + +test_oos_build: + docker run --network=host -w ${OOS_SRC_PATH} \ + --mount type=bind,source="${PWD}",target=${OOS_SRC_PATH},readonly,bind-propagation=rslave \ + -i ${DOCKER_IMAGE_TARANTOOL} \ + make -f .travis.mk ${OOS_BUILD_RULE} + ####### # OSX # ####### diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 3ab2d3ff2..eaec821b3 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -70,9 +70,9 @@ endfunction() function(bin_source varname srcfile dstfile) set(var ${${varname}}) - set(${varname} ${var} ${dstfile} PARENT_SCOPE) set (srcfile "${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}") - set (dstfile "${CMAKE_CURRENT_SOURCE_DIR}/${dstfile}") + set (dstfile "${CMAKE_CURRENT_BINARY_DIR}/${dstfile}") + set(${varname} ${var} "${dstfile}" PARENT_SCOPE) set (tmpfile "${dstfile}.tmp") get_filename_component(module ${dstfile} NAME_WE) diff --git a/src/box/CMakeLists.txt b/src/box/CMakeLists.txt index 8b2e704cf..6e25401a1 100644 --- a/src/box/CMakeLists.txt +++ b/src/box/CMakeLists.txt @@ -77,6 +77,7 @@ set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${lua_sources}) include_directories(${ZSTD_INCLUDE_DIRS}) include_directories(${CMAKE_BINARY_DIR}/src/box/sql) +include_directories(${CMAKE_BINARY_DIR}/src/box) add_library(vclock STATIC vclock.c) target_link_libraries(vclock core bit) -- 2.25.1