Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2 0/7] Implement OOS build
@ 2020-05-26 14:42 Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources Alexander V. Tikhonov
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Implemented cmake for curl build and setup OOS build with it.
Described in short the patches as it were committed.

7.  gitlab-ci: add out-of-source build
    
    Implemented out-of-source build at cmake files.
    Added out of source build make targets and added
    test job to gitlab-ci.
    
    Closes #4874

6.  Skip failing test from out-of-source build
    
    Skipped failing test app-tap/http_client.test.lua
    from out-of-source build. Left #4258 issue opened
    till it will be fixed.
    
    Part of #4874

5.  build: change autoconf to cmake in curl build
    
    Completely changed autoconf to cmake in curl build. After curl
    sources were changed to be able to be build since 2.8 version
    the old OS like CentOS 6/7 and Ubuntu 14.04 became available
    for curl build using cmake.
    
    Autoconf part completely removed and code cleaned up for cmake.
    
    1. Fixed issue with building on CentOS 6:

       It was fixed with added "-lrt" flag to CMAKE_C_FLAGS and
       CMAKE_CXX_FLAGS build flags, when cmake version is lower
       than 3.0 and RT library had needed function.
    
    2. Fixed issue with building FreeBSD 12: app/socket test failed.

       It was fixed with added "-DLDFLAGS=" flag to cmake call.
    
    3. Fixed issue with static build using CentOS 7, where SSL cmake rule
       failed.
    
       It was fixed in issue #5019.
    
    Closes #4968
    Closes #5020

4.  Fix curl repository for out-of-source build
    
    Temporary added branch in curl repository
    with fix for out-of-source build.
    
    Part of #4874

3.  build: enable cmake in curl build
    
    Changed autoconf tools in Curl build to cmake use for builds where
    cmake major starts from 3.

    Part of #4968

2.  build: fix static build w/ dockerfile with cmake
    
    Fixed cmake OS build file:
    
      /usr/share/cmake/Modules/FindOpenSSL.cmake
    
    it had:
           REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
    
    changed to:
           REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")
    
    Closes #5019

1.  build: static build needs more cleanup in sources
    
    Added cleanup for test/small test/luajit-tap directories.
    
    Closes #5025

---

Alexander V. Tikhonov (7):
  build: static build needs more cleanup in sources
  build: fix static build w/ dockerfile with cmake
  build: enable cmake in curl build
  Fix curl repository for out-of-source build
  build: change autoconf to cmake in curl build
  Skip failing test from out-of-source build
  gitlab-ci: add out-of-source build

 .gitlab-ci.yml                    |   7 ++
 .travis.mk                        |  26 ++++
 Dockerfile.staticbuild            |   5 +-
 cmake/BuildLibCURL.cmake          | 201 +++++++++++-------------------
 cmake/utils.cmake                 |   4 +-
 src/box/CMakeLists.txt            |   1 +
 test/app-tap/http_client.skipcond |   5 +
 third_party/curl                  |   2 +-
 8 files changed, 119 insertions(+), 132 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  2020-06-26 13:51   ` Alexander Turenko
  2020-07-03 11:13   ` Kirill Yukhin
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 2/7] build: fix static build w/ dockerfile with cmake Alexander V. Tikhonov
                   ` (5 subsequent siblings)
  6 siblings, 2 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Building Tarantool sources on make command run may fail with:

  [ 10%] make[2]: *** [test/small] Error 1
  [ 10%] make[1]: *** [test/CMakeFiles/symlink_small_tests.dir/all] Error 2
  make[1]: *** Waiting for unfinished jobs....

The root cause of the issue that Dockerfile.staticbuild
uses local copy of sources:

  COPY . /tarantool

Which may have broken links in tests, like:

  $ ls -al test
  ...
  luajit-tap -> /<wrong path>/third_party/luajit/test
  small -> /<wrong path>/src/lib/small/test/
  ...

To fix the issue this links should be removed from
the docker local copy of sources before build, like:

  rm -rf test/small test/luajit-tap

Closes #5025
---
 Dockerfile.staticbuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile.staticbuild b/Dockerfile.staticbuild
index 253f2d5e9..f67f46f5e 100644
--- a/Dockerfile.staticbuild
+++ b/Dockerfile.staticbuild
@@ -75,7 +75,7 @@ RUN set -x && \
 RUN set -x && \
     find . -name 'CMakeFiles' -type d -exec rm -rf {} + && \
     find . -name 'CMakeCache.txt' -type f -delete && \
-    rm -rf build
+    rm -rf build test/small test/luajit-tap
 
 RUN pip install -r /tarantool/test-run/requirements.txt
 
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 2/7] build: fix static build w/ dockerfile with cmake
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 3/7] build: enable cmake in curl build Alexander V. Tikhonov
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Building the image got the issue:

  [  1%] Performing configure step for 'bundled-libcurl-project'
  CMake Warning at CMakeLists.txt:50 (message):
    the curl cmake build system is poorly maintained.  Be aware

  -- curl version=[7.66.0-DEV]
  -- Found c-ares: /tarantool/build/ares/dest/lib/libcares.a
  Found *nroff option: -- -man
  CMake Error at /usr/share/cmake/Modules/FindOpenSSL.cmake:278 (list):
    list GET given empty list
  Call Stack (most recent call first):
    CMakeLists.txt:347 (find_package)

Root cause of the issue that Dockerfile uses globaly
installed openSSL with:

  cmake ... -DOPENSSL_ROOT_DIR=/usr/local ...

Its cmake build file:

  /usr/share/cmake/Modules/FindOpenSSL.cmake

fails on parsing the SSL version:

it has:
       REGEX "^#define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")

but it should to use:
       REGEX "^#[\t ]*define[\t ]+OPENSSL_VERSION_NUMBER[\t ]+0x([0-9a-fA-F])+.*")

Closes #5019
---
 Dockerfile.staticbuild | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Dockerfile.staticbuild b/Dockerfile.staticbuild
index f67f46f5e..01419dcc5 100644
--- a/Dockerfile.staticbuild
+++ b/Dockerfile.staticbuild
@@ -79,6 +79,7 @@ RUN set -x && \
 
 RUN pip install -r /tarantool/test-run/requirements.txt
 
+# cp FindOpenSSL.cmake /usr/share/cmake/Modules/FindOpenSSL.cmake && \
 RUN set -x && \
     cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo \
          -DENABLE_DIST:BOOL=ON \
@@ -86,6 +87,8 @@ RUN set -x && \
          -DOPENSSL_USE_STATIC_LIBS=ON \
          -DOPENSSL_ROOT_DIR=/usr/local \
          . && \
+    sed 's%#define%#[\\t ]*define%g' -i \
+        /usr/share/cmake/Modules/FindOpenSSL.cmake && \
     make -j && make install
 
 ARG RUN_TESTS
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 3/7] build: enable cmake in curl build
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 2/7] build: fix static build w/ dockerfile with cmake Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 4/7] Fix curl repository for out-of-source build Alexander V. Tikhonov
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Changed autoconf tools in Curl build to cmake use for builds where
cmake major starts from 3. It was made so because cmake in curl
build works only with 3.0 version and above, the following issue
found on:
  CentOS 6,7
  Ubuntu 14.04

Issue with curl cmake based build with cmake before 3.0 version:
  CMake Error at CMakeLists.txt:41 (cmake_minimum_required):
    CMake 3.0 or higher is required.  You are running version 2.8.12.2

For curl cmake buld all autoconf options were ported to cmake
configuration call.

Also found that CURL cmake configuration file:
  third_party/curl/lib/CMakeLists.txt

has installation part for built libcurl.a library:
  install(TARGETS ${LIB_NAME}
    EXPORT ${TARGETS_EXPORT_NAME}
    ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

where it changes CMAKE_INSTALL_LIBDIR to appropriate name with
suffix of the architecture, like:
  lib
  lib64
  x86_64

Found that find_library routine from the file:
  cmake/FindLibCURL.cmake

returns only 'lib' value and it breaks the building of the depends
binaries. To avoid of it the CMAKE_INSTALL_LIBDIR option was set to
cmake call:
  -DCMAKE_INSTALL_LIBDIR=lib

Part of #4968
---
 cmake/BuildLibCURL.cmake | 240 ++++++++++++++++++++++-----------------
 1 file changed, 138 insertions(+), 102 deletions(-)

diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake
index 5f8b15a63..39566145e 100644
--- a/cmake/BuildLibCURL.cmake
+++ b/cmake/BuildLibCURL.cmake
@@ -25,10 +25,14 @@ macro(curl_build)
         set(ASYN_DNS_USED "ares")
         set(ASYN_DNS_UNUSED "threaded-resolver")
         set(ASYN_DNS_PATH "=${ARES_INSTALL_DIR}")
+        set(ENABLE_ARES "ON")
+        set(CMAKE_FIND_ROOT_PATH "${ARES_INSTALL_DIR}")
     else()
         set(ASYN_DNS_USED "threaded-resolver")
         set(ASYN_DNS_UNUSED "ares")
         set(ASYN_DNS_PATH "")
+        set(ENABLE_ARES "OFF")
+        set(CMAKE_FIND_ROOT_PATH "")
     endif()
 
     set(ENABLED_DNS_OPT "--enable-${ASYN_DNS_USED}${ASYN_DNS_PATH}")
@@ -49,108 +53,140 @@ macro(curl_build)
     endif()
 
     include(ExternalProject)
-    ExternalProject_Add(
-        bundled-libcurl-project
-        SOURCE_DIR ${LIBCURL_SOURCE_DIR}
-        PREFIX ${LIBCURL_INSTALL_DIR}
-        DOWNLOAD_DIR ${LIBCURL_BINARY_DIR}
-        TMP_DIR ${LIBCURL_BINARY_DIR}/tmp
-        STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp
-        BINARY_DIR ${LIBCURL_BINARY_DIR}
-        CONFIGURE_COMMAND
-            cd <SOURCE_DIR> && ./buildconf &&
-            cd <BINARY_DIR> && <SOURCE_DIR>/configure
-                # Pass the same toolchain as is used to build
-                # tarantool itself, because they can be
-                # incompatible.
-                CC=${CMAKE_C_COMPILER}
-                LD=${CMAKE_LINKER}
-                AR=${CMAKE_AR}
-                RANLIB=${CMAKE_RANLIB}
-                NM=${CMAKE_NM}
-                STRIP=${CMAKE_STRIP}
-
-                # Pass -isysroot=<SDK_PATH> option on Mac OS, see
-                # above.
-                # Note: Passing of CPPFLAGS / CFLAGS explicitly
-                # discards using of corresponsing environment
-                # variables.
-                CPPFLAGS=${LIBCURL_CPPFLAGS}
-                CFLAGS=${LIBCURL_CFLAGS}
-
-                # Pass empty LDFLAGS to discard using of
-                # corresponding environment variable.
-                # It is possible that a linker flag assumes that
-                # some compilation flag is set. We don't pass
-                # CFLAGS from environment, so we should not do it
-                # for LDFLAGS too.
-                LDFLAGS=
-
-                --prefix <INSTALL_DIR>
-                --enable-static
-                --enable-shared
-
-                --with-zlib
-                ${LIBCURL_OPENSSL_OPT}
-                --with-ca-fallback
-
-                --without-brotli
-                --without-gnutls
-                --without-mbedtls
-                --without-cyassl
-                --without-wolfssl
-                --without-mesalink
-                --without-nss
-                --without-ca-bundle
-                --without-ca-path
-                --without-libpsl
-                --without-libmetalink
-                --without-librtmp
-                --without-winidn
-                --without-libidn2
-                --without-nghttp2
-                --without-ngtcp2
-                --without-nghttp3
-                --without-quiche
-                --without-zsh-functions-dir
-                --without-fish-functions-dir
-
-                ${ENABLED_DNS_OPT}
-                --enable-http
-                --enable-proxy
-                --enable-ipv6
-                --enable-unix-sockets
-                --enable-cookies
-                --enable-http-auth
-                --enable-mime
-                --enable-dateparse
-
-                ${DISABLED_DNS_OPT}
-                --disable-ftp
-                --disable-file
-                --disable-ldap
-                --disable-ldaps
-                --disable-rtsp
-                --disable-dict
-                --disable-telnet
-                --disable-tftp
-                --disable-pop3
-                --disable-imap
-                --disable-smb
-                --disable-smtp
-                --disable-gopher
-                --disable-manual
-                --disable-sspi
-                --disable-crypto-auth
-                --disable-ntlm-wb
-                --disable-tls-srp
-                --disable-doh
-                --disable-netrc
-                --disable-progress-meter
-                --disable-dnsshuffle
-                --disable-alt-svc
-        BUILD_COMMAND cd <BINARY_DIR> && $(MAKE)
-        INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install)
+    if(${CMAKE_MAJOR_VERSION} VERSION_LESS "3")
+        ExternalProject_Add(
+            bundled-libcurl-project
+            SOURCE_DIR ${LIBCURL_SOURCE_DIR}
+            PREFIX ${LIBCURL_INSTALL_DIR}
+            DOWNLOAD_DIR ${LIBCURL_BINARY_DIR}
+            TMP_DIR ${LIBCURL_BINARY_DIR}/tmp
+            STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp
+            BINARY_DIR ${LIBCURL_BINARY_DIR}
+            CONFIGURE_COMMAND
+                cd <SOURCE_DIR> && ./buildconf &&
+                cd <BINARY_DIR> && <SOURCE_DIR>/configure
+                    # Pass the same toolchain as is used to build
+                    # tarantool itself, because they can be
+                    # incompatible.
+                    CC=${CMAKE_C_COMPILER}
+                    LD=${CMAKE_LINKER}
+                    AR=${CMAKE_AR}
+                    RANLIB=${CMAKE_RANLIB}
+                    NM=${CMAKE_NM}
+                    STRIP=${CMAKE_STRIP}
+
+                    # Pass -isysroot=<SDK_PATH> option on Mac OS, see
+                    # above.
+                    # Note: Passing of CPPFLAGS / CFLAGS explicitly
+                    # discards using of corresponsing environment
+                    # variables.
+                    CPPFLAGS=${LIBCURL_CPPFLAGS}
+                    CFLAGS=${LIBCURL_CFLAGS}
+
+                    # Pass empty LDFLAGS to discard using of
+                    # corresponding environment variable.
+                    # It is possible that a linker flag assumes that
+                    # some compilation flag is set. We don't pass
+                    # CFLAGS from environment, so we should not do it
+                    # for LDFLAGS too.
+                    LDFLAGS=
+
+                    --prefix <INSTALL_DIR>
+                    --enable-static
+                    --enable-shared
+
+                    --with-zlib
+                    ${LIBCURL_OPENSSL_OPT}
+                    --with-ca-fallback
+
+                    --without-brotli
+                    --without-gnutls
+                    --without-mbedtls
+                    --without-cyassl
+                    --without-wolfssl
+                    --without-mesalink
+                    --without-nss
+                    --without-ca-bundle
+                    --without-ca-path
+                    --without-libpsl
+                    --without-libmetalink
+                    --without-librtmp
+                    --without-winidn
+                    --without-libidn2
+                    --without-nghttp2
+                    --without-ngtcp2
+                    --without-nghttp3
+                    --without-quiche
+                    --without-zsh-functions-dir
+                    --without-fish-functions-dir
+
+                    ${ENABLED_DNS_OPT}
+                    --enable-http
+                    --enable-proxy
+                    --enable-ipv6
+                    --enable-unix-sockets
+                    --enable-cookies
+                    --enable-http-auth
+                    --enable-mime
+                    --enable-dateparse
+
+                    ${DISABLED_DNS_OPT}
+                    --disable-ftp
+                    --disable-file
+                    --disable-ldap
+                    --disable-ldaps
+                    --disable-rtsp
+                    --disable-dict
+                    --disable-telnet
+                    --disable-tftp
+                    --disable-pop3
+                    --disable-imap
+                    --disable-smb
+                    --disable-smtp
+                    --disable-gopher
+                    --disable-manual
+                    --disable-sspi
+                    --disable-crypto-auth
+                    --disable-ntlm-wb
+                    --disable-tls-srp
+                    --disable-doh
+                    --disable-netrc
+                    --disable-progress-meter
+                    --disable-dnsshuffle
+                    --disable-alt-svc
+            BUILD_COMMAND cd <BINARY_DIR> && $(MAKE)
+            INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install)
+    else()
+        ExternalProject_Add(
+            bundled-libcurl-project
+            SOURCE_DIR ${LIBCURL_SOURCE_DIR}
+            PREFIX ${LIBCURL_INSTALL_DIR}
+            DOWNLOAD_DIR ${LIBCURL_BINARY_DIR}
+            TMP_DIR ${LIBCURL_BINARY_DIR}/tmp
+            STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp
+            BINARY_DIR ${LIBCURL_BINARY_DIR}/curl
+            CONFIGURE_COMMAND
+	        cd <BINARY_DIR> && cmake <SOURCE_DIR>
+                    -DCPPFLAGS=${LIBCURL_CPPFLAGS}
+                    -DCFLAGS=${LIBCURL_CFLAGS}
+                    -DLDFLAGS=
+                    -DCMAKE_INSTALL_LIBDIR=lib
+                    -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+                    -DBUILD_TESTING=OFF
+                    -DCURL_STATICLIB=ON
+                    -DBUILD_SHARED_LIBS=OFF
+                    -DCMAKE_USE_OPENSSL=ON
+                    -DOPENSSL_ROOT_DIR=${FOUND_OPENSSL_ROOT_DIR}
+                    -DCURL_CA_FALLBACK=ON
+                    -DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}
+                    -DENABLE_ARES=${ENABLE_ARES}
+                    -DHTTP_ONLY=ON
+                    -DCURL_DISABLE_SMB=ON
+                    -DCURL_DISABLE_GOPHER=ON
+                    -DCURL_DISABLE_CRYPTO_AUTH=ON
+            BUILD_COMMAND cd <BINARY_DIR> && $(MAKE) -j
+            INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install)
+    endif()
 
     add_library(bundled-libcurl STATIC IMPORTED GLOBAL)
     set_target_properties(bundled-libcurl PROPERTIES IMPORTED_LOCATION
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 4/7] Fix curl repository for out-of-source build
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
                   ` (2 preceding siblings ...)
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 3/7] build: enable cmake in curl build Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 5/7] build: change autoconf to cmake in curl build Alexander V. Tikhonov
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Temporary added branch in curl repository
with fix for out-of-source build.

Part of #4874
---
 third_party/curl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/third_party/curl b/third_party/curl
index 9cd755e1d..c4c5dda47 160000
--- a/third_party/curl
+++ b/third_party/curl
@@ -1 +1 @@
-Subproject commit 9cd755e1d768bbf228e7c9faf223b7459f7e0105
+Subproject commit c4c5dda4774a51670d6ea9857750c74816a14759
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 5/7] build: change autoconf to cmake in curl build
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
                   ` (3 preceding siblings ...)
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 4/7] Fix curl repository for out-of-source build Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 6/7] Skip failing test from out-of-source build Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 7/7] gitlab-ci: add " Alexander V. Tikhonov
  6 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Completely changed autoconf to cmake in curl build. After curl
sources were changed to be able to be build since 2.8 version
the old OS like CentOS 6/7 and Ubuntu 14.04 became available
for curl build using cmake.

Autoconf part completely removed and code cleaned up for cmake.

1. Found issue with building on CentOS 6:

     Linking C executable curl
     build/ares/dest/lib/libcares.a(ares__timeval.c.o): In function `ares__tvnow':
     ares__timeval.c:(.text+0x15): undefined reference to `clock_gettime'
     collect2: error: ld returned 1 exit status

   It was fixed with added "-lrt" flag to CMAKE_C_FLAGS and
   CMAKE_CXX_FLAGS build flags, when cmake version is lower
   than 3.0 and RT library had needed function.

2. Found issue with building FreeBSD 12: app/socket test failed.

     [035] --- app/socket.result	Tue May 26 03:06:32 2020
     [035] +++ app/socket.reject	Fri May  8 08:26:16 2020
     [035] @@ -836,7 +836,7 @@
     [035]  ...
     [035]  s:recv()
     [035]  ---
     [035] -- Hello, world
     [035] +-
     [035]  ...
     [035]  sc:sendto('127.0.0.1', s:name().port, 'Hello, world, 2')
     [035]  ---

   It was fixed with added "-DLDFLAGS=" flag to cmake call.

3. Found issue with static build using CentOS 7, where SSL cmake rule
   failed.

   It was fixed in issue #5019.

Closes #4968
Closes #5020
---
 cmake/BuildLibCURL.cmake | 251 +++++++++++++--------------------------
 1 file changed, 80 insertions(+), 171 deletions(-)

diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake
index 39566145e..b60e16ca2 100644
--- a/cmake/BuildLibCURL.cmake
+++ b/cmake/BuildLibCURL.cmake
@@ -3,6 +3,7 @@ macro(curl_build)
     set(LIBCURL_SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/curl)
     set(LIBCURL_BINARY_DIR ${PROJECT_BINARY_DIR}/build/curl/work)
     set(LIBCURL_INSTALL_DIR ${PROJECT_BINARY_DIR}/build/curl/dest)
+    set(LIBCURL_CMAKE_FLAGS "")
 
     if (BUILD_STATIC)
         set(LIBZ_LIB_NAME libz.a)
@@ -14,179 +15,94 @@ macro(curl_build)
         message(FATAL_ERROR "Unable to find zlib")
     endif()
 
-    # Use the same OpenSSL library for libcurl as is used for
-    # tarantool itself.
+    # add librt for clock_gettime function definition
+    if(${CMAKE_MAJOR_VERSION} VERSION_LESS "3")
+        CHECK_LIBRARY_EXISTS (rt clock_gettime "" HAVE_LIBRT)
+        if (HAVE_LIBRT)
+            list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_CXX_FLAGS=-lrt")
+            list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_C_FLAGS=-lrt")
+        endif()
+    endif()
+
+    # switch on the static build
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_STATICLIB=ON")
+
+    # switch off the shared build
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DBUILD_SHARED_LIBS=OFF")
+
+    # let's disable testing for curl to save build time
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DBUILD_TESTING=OFF")
+
+    # Setup use of openssl, use the same OpenSSL library
+    # for libcurl as is used for tarantool itself.
     get_filename_component(FOUND_OPENSSL_ROOT_DIR ${OPENSSL_INCLUDE_DIR} DIRECTORY)
-    set(LIBCURL_OPENSSL_OPT "--with-ssl=${FOUND_OPENSSL_ROOT_DIR}")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_USE_OPENSSL=ON")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DOPENSSL_ROOT_DIR=${FOUND_OPENSSL_ROOT_DIR}")
 
-    # Use either c-ares bundled with tarantool or
-    # libcurl-default threaded resolver.
+    # Setup ARES and its library path, use either c-ares bundled
+    # with tarantool or libcurl-default threaded resolver.
     if(BUNDLED_LIBCURL_USE_ARES)
-        set(ASYN_DNS_USED "ares")
-        set(ASYN_DNS_UNUSED "threaded-resolver")
-        set(ASYN_DNS_PATH "=${ARES_INSTALL_DIR}")
         set(ENABLE_ARES "ON")
-        set(CMAKE_FIND_ROOT_PATH "${ARES_INSTALL_DIR}")
+        list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_FIND_ROOT_PATH=${ARES_INSTALL_DIR}")
     else()
-        set(ASYN_DNS_USED "threaded-resolver")
-        set(ASYN_DNS_UNUSED "ares")
-        set(ASYN_DNS_PATH "")
         set(ENABLE_ARES "OFF")
-        set(CMAKE_FIND_ROOT_PATH "")
-    endif()
-
-    set(ENABLED_DNS_OPT "--enable-${ASYN_DNS_USED}${ASYN_DNS_PATH}")
-    set(DISABLED_DNS_OPT "--disable-${ASYN_DSN_UNUSED}")
-
-    # Pass -isysroot=<SDK_PATH> option on Mac OS to a preprocessor
-    # and a C compiler to find header files installed with an SDK.
-    #
-    # The idea here is to don't pass all compiler/linker options
-    # that is set for tarantool, but only a subset that is
-    # necessary for choosen toolchain, and let curl's configure
-    # script set options that are appropriate for libcurl.
-    set(LIBCURL_CPPFLAGS "")
-    set(LIBCURL_CFLAGS "")
-    if (TARGET_OS_DARWIN AND NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
-        set(LIBCURL_CPPFLAGS "${LIBCURL_CPPFLAGS} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}")
-        set(LIBCURL_CFLAGS "${LIBCURL_CFLAGS} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}")
     endif()
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DENABLE_ARES=${ENABLE_ARES}")
+
+    # switch off the group of protocols with special flag HTTP_ONLY:
+    #   ftp, file, ldap, ldaps, rtsp, dict, telnet, tftp, pop3, imap, smtp
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DHTTP_ONLY=ON")
+
+    # additionaly disable some more protocols
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_SMB=ON")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_GOPHER=ON")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_DISABLE_CRYPTO_AUTH=ON")
+
+    # switch on ca-fallback feature
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCURL_CA_FALLBACK=ON")
+
+    # Even though we set the external project's install dir
+    # below, we still need to pass the corresponding install
+    # prefix via cmake arguments.
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_INSTALL_PREFIX=${LIBCURL_INSTALL_DIR}")
+
+    # The default values for the options below are not always
+    # "./lib", "./bin"  and "./include", while curl expects them
+    # to be.
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_INSTALL_LIBDIR=lib")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_INSTALL_INCLUDEDIR=include")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_INSTALL_BINDIR=bin")
+
+    # Pass the same toolchain as is used to build tarantool itself,
+    # because they can be incompatible.
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_LINKER=${CMAKE_LINKER}")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_AR=${CMAKE_AR}")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_RANLIB=${CMAKE_RANLIB}")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_NM=${CMAKE_NM}")
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_STRIP=${CMAKE_STRIP}")
+
+    # found that on FreeBSD 12 this setup is needed for app/socket.test.lua
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DLDFLAGS=")
+
+    # In hardened mode, which enables -fPIE by default,
+    # the cmake checks don't work without -fPIC.
+    list(APPEND LIBCURL_CMAKE_FLAGS "-DCMAKE_REQUIRED_FLAGS=-fPIC")
 
     include(ExternalProject)
-    if(${CMAKE_MAJOR_VERSION} VERSION_LESS "3")
-        ExternalProject_Add(
-            bundled-libcurl-project
-            SOURCE_DIR ${LIBCURL_SOURCE_DIR}
-            PREFIX ${LIBCURL_INSTALL_DIR}
-            DOWNLOAD_DIR ${LIBCURL_BINARY_DIR}
-            TMP_DIR ${LIBCURL_BINARY_DIR}/tmp
-            STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp
-            BINARY_DIR ${LIBCURL_BINARY_DIR}
-            CONFIGURE_COMMAND
-                cd <SOURCE_DIR> && ./buildconf &&
-                cd <BINARY_DIR> && <SOURCE_DIR>/configure
-                    # Pass the same toolchain as is used to build
-                    # tarantool itself, because they can be
-                    # incompatible.
-                    CC=${CMAKE_C_COMPILER}
-                    LD=${CMAKE_LINKER}
-                    AR=${CMAKE_AR}
-                    RANLIB=${CMAKE_RANLIB}
-                    NM=${CMAKE_NM}
-                    STRIP=${CMAKE_STRIP}
-
-                    # Pass -isysroot=<SDK_PATH> option on Mac OS, see
-                    # above.
-                    # Note: Passing of CPPFLAGS / CFLAGS explicitly
-                    # discards using of corresponsing environment
-                    # variables.
-                    CPPFLAGS=${LIBCURL_CPPFLAGS}
-                    CFLAGS=${LIBCURL_CFLAGS}
-
-                    # Pass empty LDFLAGS to discard using of
-                    # corresponding environment variable.
-                    # It is possible that a linker flag assumes that
-                    # some compilation flag is set. We don't pass
-                    # CFLAGS from environment, so we should not do it
-                    # for LDFLAGS too.
-                    LDFLAGS=
-
-                    --prefix <INSTALL_DIR>
-                    --enable-static
-                    --enable-shared
-
-                    --with-zlib
-                    ${LIBCURL_OPENSSL_OPT}
-                    --with-ca-fallback
-
-                    --without-brotli
-                    --without-gnutls
-                    --without-mbedtls
-                    --without-cyassl
-                    --without-wolfssl
-                    --without-mesalink
-                    --without-nss
-                    --without-ca-bundle
-                    --without-ca-path
-                    --without-libpsl
-                    --without-libmetalink
-                    --without-librtmp
-                    --without-winidn
-                    --without-libidn2
-                    --without-nghttp2
-                    --without-ngtcp2
-                    --without-nghttp3
-                    --without-quiche
-                    --without-zsh-functions-dir
-                    --without-fish-functions-dir
-
-                    ${ENABLED_DNS_OPT}
-                    --enable-http
-                    --enable-proxy
-                    --enable-ipv6
-                    --enable-unix-sockets
-                    --enable-cookies
-                    --enable-http-auth
-                    --enable-mime
-                    --enable-dateparse
-
-                    ${DISABLED_DNS_OPT}
-                    --disable-ftp
-                    --disable-file
-                    --disable-ldap
-                    --disable-ldaps
-                    --disable-rtsp
-                    --disable-dict
-                    --disable-telnet
-                    --disable-tftp
-                    --disable-pop3
-                    --disable-imap
-                    --disable-smb
-                    --disable-smtp
-                    --disable-gopher
-                    --disable-manual
-                    --disable-sspi
-                    --disable-crypto-auth
-                    --disable-ntlm-wb
-                    --disable-tls-srp
-                    --disable-doh
-                    --disable-netrc
-                    --disable-progress-meter
-                    --disable-dnsshuffle
-                    --disable-alt-svc
-            BUILD_COMMAND cd <BINARY_DIR> && $(MAKE)
-            INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install)
-    else()
-        ExternalProject_Add(
-            bundled-libcurl-project
-            SOURCE_DIR ${LIBCURL_SOURCE_DIR}
-            PREFIX ${LIBCURL_INSTALL_DIR}
-            DOWNLOAD_DIR ${LIBCURL_BINARY_DIR}
-            TMP_DIR ${LIBCURL_BINARY_DIR}/tmp
-            STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp
-            BINARY_DIR ${LIBCURL_BINARY_DIR}/curl
-            CONFIGURE_COMMAND
-	        cd <BINARY_DIR> && cmake <SOURCE_DIR>
-                    -DCPPFLAGS=${LIBCURL_CPPFLAGS}
-                    -DCFLAGS=${LIBCURL_CFLAGS}
-                    -DLDFLAGS=
-                    -DCMAKE_INSTALL_LIBDIR=lib
-                    -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-                    -DBUILD_TESTING=OFF
-                    -DCURL_STATICLIB=ON
-                    -DBUILD_SHARED_LIBS=OFF
-                    -DCMAKE_USE_OPENSSL=ON
-                    -DOPENSSL_ROOT_DIR=${FOUND_OPENSSL_ROOT_DIR}
-                    -DCURL_CA_FALLBACK=ON
-                    -DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH}
-                    -DENABLE_ARES=${ENABLE_ARES}
-                    -DHTTP_ONLY=ON
-                    -DCURL_DISABLE_SMB=ON
-                    -DCURL_DISABLE_GOPHER=ON
-                    -DCURL_DISABLE_CRYPTO_AUTH=ON
-            BUILD_COMMAND cd <BINARY_DIR> && $(MAKE) -j
-            INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install)
-    endif()
+    ExternalProject_Add(
+        bundled-libcurl-project
+        SOURCE_DIR ${LIBCURL_SOURCE_DIR}
+        PREFIX ${LIBCURL_INSTALL_DIR}
+        DOWNLOAD_DIR ${LIBCURL_BINARY_DIR}
+        TMP_DIR ${LIBCURL_BINARY_DIR}/tmp
+        STAMP_DIR ${LIBCURL_BINARY_DIR}/stamp
+        BINARY_DIR ${LIBCURL_BINARY_DIR}/curl
+        CONFIGURE_COMMAND
+            cd <BINARY_DIR> && cmake <SOURCE_DIR>
+                ${LIBCURL_CMAKE_FLAGS}
+        BUILD_COMMAND cd <BINARY_DIR> && $(MAKE) -j
+        INSTALL_COMMAND cd <BINARY_DIR> && $(MAKE) install)
 
     add_library(bundled-libcurl STATIC IMPORTED GLOBAL)
     set_target_properties(bundled-libcurl PROPERTIES IMPORTED_LOCATION
@@ -206,13 +122,6 @@ macro(curl_build)
         set(CURL_LIBRARIES ${CURL_LIBRARIES} rt)
     endif()
 
-    unset(ASYN_DNS_USED)
-    unset(ASYN_DNS_UNUSED)
-    unset(ASYN_DNS_PATH)
-    unset(ENABLED_DNS_OPT)
-    unset(DISABLED_DNS_OPT)
-    unset(LIBCURL_CPPFLAGS)
-    unset(LIBCURL_CFLAGS)
     unset(FOUND_OPENSSL_ROOT_DIR)
     unset(LIBCURL_INSTALL_DIR)
     unset(LIBCURL_BINARY_DIR)
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 6/7] Skip failing test from out-of-source build
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
                   ` (4 preceding siblings ...)
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 5/7] build: change autoconf to cmake in curl build Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 7/7] gitlab-ci: add " Alexander V. Tikhonov
  6 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, Alexander Turenko

Skipped failing test app-tap/http_client.test.lua
from out-of-source build. Left #4258 issue opened
till it will be fixed.

Part of #4874
---
 test/app-tap/http_client.skipcond | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/test/app-tap/http_client.skipcond b/test/app-tap/http_client.skipcond
index 108e776c4..df811dcc1 100644
--- a/test/app-tap/http_client.skipcond
+++ b/test/app-tap/http_client.skipcond
@@ -1,5 +1,10 @@
+import os
 import platform
 
+# Disabled at out-of-source build due to issue #4258.
+if os.getenv("OUTOFSRC_BUILD") == 'ON':
+    self.skip = 1
+
 # Disabled on FreeBSD due to flaky fail #4271.
 if platform.system() == 'FreeBSD':
     self.skip = 1
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Tarantool-patches] [PATCH v2 7/7] gitlab-ci: add out-of-source build
  2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
                   ` (5 preceding siblings ...)
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 6/7] Skip failing test from out-of-source build Alexander V. Tikhonov
@ 2020-05-26 14:42 ` Alexander V. Tikhonov
  6 siblings, 0 replies; 10+ messages in thread
From: Alexander V. Tikhonov @ 2020-05-26 14:42 UTC (permalink / raw)
  To: Oleg Piskunov, Sergey Bronnikov; +Cc: tarantool-patches, 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
---
 .gitlab-ci.yml         |  7 +++++++
 .travis.mk             | 26 ++++++++++++++++++++++++++
 cmake/utils.cmake      |  4 ++--
 src/box/CMakeLists.txt |  1 +
 4 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 256b368c4..d05c80692 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -105,6 +105,13 @@ variables:
 
 # 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 063537f25..a7717c92a 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -3,9 +3,13 @@
 #
 
 DOCKER_IMAGE?=packpack/packpack:debian-stretch
+DOCKER_TEST_IMAGE?=registry.gitlab.com/tarantool/tarantool/testing/debian-stretch:latest
 TEST_RUN_EXTRA_PARAMS?=
 MAX_FILES?=65534
 MAX_PROC?=2500
+OOS_SRC_PATH?=/source
+OOS_BUILD_PATH?=/rw_bins
+OOS_BUILD_RULE?=test_oos_no_deps
 
 all: package
 
@@ -146,6 +150,28 @@ test_static_build: deps_debian_static
 test_static_docker_build:
 	docker build --no-cache --network=host --build-arg RUN_TESTS=ON -f Dockerfile.staticbuild .
 
+# 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 && \
+		OUTOFSRC_BUILD=ON ${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_TEST_IMAGE} \
+		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 7dc94d893..feec2de01 100644
--- a/src/box/CMakeLists.txt
+++ b/src/box/CMakeLists.txt
@@ -32,6 +32,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)
-- 
2.17.1

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources Alexander V. Tikhonov
@ 2020-06-26 13:51   ` Alexander Turenko
  2020-07-03 11:13   ` Kirill Yukhin
  1 sibling, 0 replies; 10+ messages in thread
From: Alexander Turenko @ 2020-06-26 13:51 UTC (permalink / raw)
  To: Alexander V. Tikhonov; +Cc: Oleg Piskunov, tarantool-patches

> diff --git a/Dockerfile.staticbuild b/Dockerfile.staticbuild
> index 253f2d5e9..f67f46f5e 100644
> --- a/Dockerfile.staticbuild
> +++ b/Dockerfile.staticbuild
> @@ -75,7 +75,7 @@ RUN set -x && \
>  RUN set -x && \
>      find . -name 'CMakeFiles' -type d -exec rm -rf {} + && \
>      find . -name 'CMakeCache.txt' -type f -delete && \
> -    rm -rf build
> +    rm -rf build test/small test/luajit-tap

What if I'll push a short-term branch that adds one more test directory?

I think that the directory should be cleaned up entirely (git clean for
sources and submodules). And it seems that it is done with [1], right?
Such spotted cleanup will insuperably fails in some cases.

Anyway, I don't have objections against this certain patch if it still
needed after [1], just noted that it necessary only because the overall
approach is not good.

[1]: https://github.com/tarantool/tarantool/issues/5036

WBR, Alexander Turenko.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources
  2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources Alexander V. Tikhonov
  2020-06-26 13:51   ` Alexander Turenko
@ 2020-07-03 11:13   ` Kirill Yukhin
  1 sibling, 0 replies; 10+ messages in thread
From: Kirill Yukhin @ 2020-07-03 11:13 UTC (permalink / raw)
  To: Alexander V. Tikhonov; +Cc: Oleg Piskunov, tarantool-patches, Alexander Turenko

Hello,

n 26 май 17:42, Alexander V. Tikhonov wrote:
> Building Tarantool sources on make command run may fail with:
> 
>   [ 10%] make[2]: *** [test/small] Error 1
>   [ 10%] make[1]: *** [test/CMakeFiles/symlink_small_tests.dir/all] Error 2
>   make[1]: *** Waiting for unfinished jobs....
> 
> The root cause of the issue that Dockerfile.staticbuild
> uses local copy of sources:
> 
>   COPY . /tarantool
> 
> Which may have broken links in tests, like:
> 
>   $ ls -al test
>   ...
>   luajit-tap -> /<wrong path>/third_party/luajit/test
>   small -> /<wrong path>/src/lib/small/test/

I've checked your patch into 1.10, 2.3, 2.4 and master.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-07-03 11:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 14:42 [Tarantool-patches] [PATCH v2 0/7] Implement OOS build Alexander V. Tikhonov
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 1/7] build: static build needs more cleanup in sources Alexander V. Tikhonov
2020-06-26 13:51   ` Alexander Turenko
2020-07-03 11:13   ` Kirill Yukhin
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 2/7] build: fix static build w/ dockerfile with cmake Alexander V. Tikhonov
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 3/7] build: enable cmake in curl build Alexander V. Tikhonov
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 4/7] Fix curl repository for out-of-source build Alexander V. Tikhonov
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 5/7] build: change autoconf to cmake in curl build Alexander V. Tikhonov
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 6/7] Skip failing test from out-of-source build Alexander V. Tikhonov
2020-05-26 14:42 ` [Tarantool-patches] [PATCH v2 7/7] gitlab-ci: add " Alexander V. Tikhonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox