[Tarantool-patches] [PATCH v2 2/2] build: add bundled curl and c-ares to version output

Alexander Turenko alexander.turenko at tarantool.org
Wed Mar 4 15:03:33 MSK 2020


On Tue, Jan 21, 2020 at 02:54:32PM +0300, Serge Petrenko wrote:
> Since we may use bundled lubcurl and c-ares, it can be useful to know
> the exact curl and c-ares versions tarantool was built with.
> 
> Follow-up #4591
> ---
>  cmake/BuildAres.cmake     | 10 ++++++++++
>  cmake/BuildLibCURL.cmake  | 10 ++++++++++
>  src/lua/init.c            | 14 ++++++++++++++
>  src/main.cc               |  6 ++++++
>  src/trivia/config.h.cmake |  4 ++++
>  test/box-py/args.result   |  8 ++++++++
>  test/box-py/args.test.py  |  5 ++++-
>  7 files changed, 56 insertions(+), 1 deletion(-)
> 
> diff --git a/cmake/BuildAres.cmake b/cmake/BuildAres.cmake
> index 0f9f174ce..7be6f5b00 100644
> --- a/cmake/BuildAres.cmake
> +++ b/cmake/BuildAres.cmake
> @@ -4,6 +4,16 @@ macro(ares_build)
>      set(ARES_BINARY_DIR ${PROJECT_BINARY_DIR}/build/ares/work)
>      set(ARES_INSTALL_DIR ${PROJECT_BINARY_DIR}/build/ares/dest)
>  
> +    # Get bundled ares version for `tarantool -v` output.
> +    if (EXISTS "${ARES_SOURCE_DIR}/.git" AND GIT)
> +        execute_process (COMMAND ${GIT} describe HEAD
> +            OUTPUT_VARIABLE BUNDLED_ARES_VERSION
> +            OUTPUT_STRIP_TRAILING_WHITESPACE
> +            WORKING_DIRECTORY ${ARES_SOURCE_DIR})
> +            string(REPLACE cares- "" BUNDLED_ARES_VERSION ${BUNDLED_ARES_VERSION})
> +            string(REPLACE _ . BUNDLED_ARES_VERSION ${BUNDLED_ARES_VERSION})
> +    endif()

This way does not work when tarantool sources are fetched from a tarball
(rather from git repository). It'll affect all packages, our ones and
external. Our packages are built from tarballs, created by packpack
before run rpmbuild / debuild. External packages (like Gentoo) also
fetch tarballs, so it will not work too. Likely the same on Mac OS
(brew) and FreeBSD (port / pkg).

For tarantool itself it is handles using a VERSION file, which is alway
shipped within a tarball. packpack stores a git version in this file
when creating a tarball. CMakeLists.txt reads it if exists.

How to check:

$ TARBALL_COMPRESSOR=gz ~/p/t/packpack/packpack tarball

It'll create a tarball in build directory. You can unpack it and build.

The reason why *-full-ci does not fail is that box-py test suite is not
included yet in all testing jobs (see [1]).

To be honest, I don't see a way to overcome this problem. Need to think
more. Maybe add some hooks to packpack to create extra VERSION files.

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


More information about the Tarantool-patches mailing list