Skip to content
Snippets Groups Projects
  1. Jan 23, 2023
  2. Jan 18, 2023
  3. Jan 17, 2023
    • Nikolay Shirokovskiy's avatar
      libunwind: improve incremental build/rebuild · 14f93aee
      Nikolay Shirokovskiy authored
      Currently we use ExternalProject_Add to build libunwind subproject. The
      usecases it supports are not quite aligned with our. Configuration and
      build steps are rerun in case download step sees updated sources. But
      we use git submodules to fetch third-party projects and thus subproject
      is not rebuild when it's files are changed on disk. Either because of
      we doing some sort of experiments locally or because the new sources
      are brought by git pull.
      
      Actually libunwind has a CMakeList.txt so that we could try to build it
      just as project subdirectory. But it requires quite a fresh CMake
      version, currently supports only build on Visual Studio and probably is
      not up to date given it's package version variables. Keeping
      CMakeLists.txt in sync with main autotools build is additional
      maintenance burden. So I'd like to use main autotools build.
      
      So ext_project_autotools function is added to provide nicer build
      integration with third-party projects which are build using autotools.
      Actually incremental rebuild works only if CMake is at least 3.12 but
      I think this should be true for developer installations.
      
      Hopefully we can reuse the function in case we need to bundle more
      subprojects with autotools builds.
      
      Follow-up #5665
      
      NO_DOC=build improvement
      NO_TEST=build improvement
      NO_CHANGELOG=build improvement
      14f93aee
  4. Jan 12, 2023
    • Alexander Turenko's avatar
      build: fix build fail on clang 15 · 1c6b6f85
      Alexander Turenko authored
      Fixed pthread-related CMake checks. The checks code is built with
      `-pedantic-errors` and it leads to errors of the following kind on
      clang 15:
      
      ```
      <...>/CMakeFiles/CMakeScratch/TryCompile-78KaOK/src.c:4:17: error: a
          function declaration without a prototype is deprecated in all
          versions of C [-Werror,-Wstrict-prototypes]
              int main() { pthread_setname_np(pthread_self(), ""); }
                      ^
                       void
      ```
      
      Fixed a warning in the SQL code (it's an error in Debug build):
      
      ```
      <...>/src/box/sql/vdbeaux.c:170:13: error: variable 'n' set but not used
          [-Werror,-Wunused-but-set-variable]
              static int n = 0;
      ```
      
      Fixed several warnings from lemon.c of the following kind:
      
      ```
      <...>/extra/lemon.c:173:6: warning: a function declaration without a
          prototype is deprecated in all versions of C and is treated as a
          zero-parameter prototype in C2x, conflicting with a subsequent
          definition [-Wdeprecated-non-prototype]
      void FindRulePrecedences();
           ^
      <...>/extra/lemon.c:766:6: note: conflicting prototype is here
      void FindRulePrecedences(struct lemon *xp)
      ```
      
      See also https://github.com/tarantool/small/issues/57
      
      Fixes #8110
      
      NO_DOC=build fix
      NO_TEST=build fix
      1c6b6f85
  5. Dec 12, 2022
    • Vladimir Davydov's avatar
      Drop internal SHA1 implementation · 3aafa0ed
      Vladimir Davydov authored
      Not used anywhere anymore. No need in it, because SHA1 is provided by
      the OpenSSL library.
      
      Closes #7987
      
      NO_DOC=code cleanup
      NO_TEST=code cleanup
      NO_CHANGELOG=code cleanup
      3aafa0ed
  6. Dec 09, 2022
    • Ilya Verbin's avatar
      cmake: add -fasynchronous-unwind-tables compiler flag · 952c8335
      Ilya Verbin authored
      This option enables emission of the DWARF CFI (Call Frame Information)
      directives to the assembler. It is enabled by default on most compilers,
      but on GCC 7 for AArch64 and older it wasn't [1], so turn it on explicitly.
      When enabled, the compiler emits .cfi_* directives that are required for
      the stack unwinding, and defines __GCC_HAVE_DWARF2_CFI_ASM.
      
      Part of #7960
      
      [1] https://gcc.gnu.org/pipermail/gcc-patches/2018-March/495549.html
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      NO_TEST=Tested by test/app-luatest/fiber_parent_backtrace_test.lua
      952c8335
  7. Dec 07, 2022
  8. Dec 05, 2022
    • Nikolay Shirokovskiy's avatar
      libunwind: use latest release v1.6.2 as a base · 5b08d71a
      Nikolay Shirokovskiy authored
      Now we base on some unreleased state of libunwind. This is by itself not
      a good practice. Yet the main motivation is that in the current version of
      libunwind fast path for backtrace detection on x86_64 does not work.
      I guess this is because of libunwind/libunwind@400b3f819ad4 (" x86_64: Stop
      aliasing RSP and CFA"). See libunwind/libunwind#440. Fortunately this
      commit is not present it the latest release.
      
      Using fast or slow path has a great impact on performance of debug build
      where collecting fiber gc allocation backtrace is turned on by default.
      It surely depends on frequency and pattern of allocation. Test
      sql/delete3 depends on backtrace performance most dramatically. On some
      installations collecting backtraces slowed down the test up to 10 times.
      
      If fast path is available then collecting backtrace does not affect
      performance in a noticeable way.
      
      I propose not to keep autotools products in the libunwind fork repo as
      it is done previously. LOG_CONFIGURE is removed because it somehow
      incompatible with using && in CONFIGURE_COMMAND command and not critical
      to the build.
      
      Also add autotools build dependencies for packpack package specs.
      Currently not all packpack images have autotools preinstalled so this is
      required for build to success. Anyway we'b better have precise build
      requirements in build specs.
      
      Follow-up #5665
      
      NO_DOC=internal
      NO_TEST=internal
      NO_CHANGELOG=internal
      5b08d71a
    • Ilya Verbin's avatar
      cmake: fix wrong CPU architecture reported on M1/M2 Macs · d76be7ef
      Ilya Verbin authored
      This patch removes an old CMake kludge, which sets CMAKE_SYSTEM_PROCESSOR
      to "x86_64" on all 64-bit architectures, even on ARM (on Darwin).
      
      Closes #7495
      
      NO_DOC=bugfix
      d76be7ef
  9. Nov 09, 2022
    • Georgiy Lebedev's avatar
      build: enable unjustifiably disabled compiler warnings · 1d954825
      Georgiy Lebedev authored
      After revisiting the list of currently disabled compiler warnings it seems
      like the following are unjustifiably disabled:
      * `-Wunknown-pragmas`;
      * `-Wstrict-aliasing`;
      * `-Wunused-value`;
      * `-Wchar-subscripts`;
      * `-Wformat-truncation`.
      
      `-Wunused-value` appeared to be disabled due to a bug in Clang (see also
      llvm/llvm-project#14119): according to the LLVM release dates, the last
      affected Clang version was 3.1 and it was hopefully fixed in Clang 3.2.
      No currently alive (or recently EOLed) distributions offer such old Clang
      versions.
      
      Strict aliasing violation warnings coming from libev cannot be disabled
      with `system_header` pragma on GNU compilers older than 8, so we have to
      leave to leave it disabled for the whole project in this case.
      
      Otherwise, enable the warnings listed above for the sake of code health.
      
      Closes #7862
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      1d954825
  10. Nov 07, 2022
  11. Oct 21, 2022
    • Georgiy Lebedev's avatar
      build: use relative paths in diagnostics and debugging information · 256da010
      Georgiy Lebedev authored
      Since our diagnostics use the `__FILE__` macro, they provide absolute
      paths, which is kind of redundant and inconsistent: replace them with
      relative ones.
      
      As for debugging information, replacing absolute paths with relative ones
      also requires an extra command to tell the debugger where to find the
      source files, which is not convenient for developers: provide a new
      `DEV_BUILD` option (turned off by default), which replaces absolute paths
      with relative ones in debugging information if turned off.
      
      Strip the prefix map flags from compiler flags exported to tarantool via
      `src/trvia/config.h`.
      
      Closes #7808
      
      NO_DOC=<verbosity>
      NO_TEST=<verbosity>
      256da010
    • Georgiy Lebedev's avatar
      build: refactor setting hardening compiler flags · dd51a2fa
      Georgiy Lebedev authored
      Setting hardening compiler flags is used in three places: default build,
      static build and enterprise build — refactor it into a separate module.
      
      Follow-up e6abe1c9
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      NO_TEST=refactoring
      dd51a2fa
    • Georgiy Lebedev's avatar
      build: refactor passing compiler flags to dependencies · c6794757
      Georgiy Lebedev authored
      e6abe1c9 passes compiler flags to dependencies via a `<project>_build` macro
      parameter, which is, firstly, inconvenient, and, secondly, as a result, not
      all dependencies got the required compiler flags passed: use global
      variables instead and pass these flags to skipped dependencies.
      
      Follow-up e6abe1c9
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      NO_TEST=refactoring
      c6794757
    • Georgiy Lebedev's avatar
      build: fix unsetting of variables in `add_compile_flags` macro · 4aa9f154
      Georgiy Lebedev authored
      `add_compile_flags` macro relied on undefined behaviour: instead of
      unsetting the `_lang` and `_flag` variables, it tried to unset their
      values — fix this.
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      4aa9f154
  12. Oct 14, 2022
  13. Sep 15, 2022
    • Ilya Verbin's avatar
      cmake: add extra security compiler options · e6abe1c9
      Ilya Verbin authored
      Introduce cmake option ENABLE_HARDENING, which is TRUE by default for
      non-debug regular and static builds, excluding AArch64 and FreeBSD.
      It passess compiler flags that harden Tarantool (including the bundled
      libraries) against memory corruption attacks. The following flags are
      passed:
      
      * -Wformat - Check calls to printf and scanf, etc., to make sure that
        the arguments supplied have types appropriate to the format string
        specified.
      
      * -Wformat-security -Werror=format-security - Warn about uses of format
        functions that represent possible security problems. And make the
        warning into an error.
      
      * -fstack-protector-strong - Emit extra code to check for buffer
        overflows, such as stack smashing attacks.
      
      * -fPIC -pie - Generate position-independent code (PIC). It allows to
        take advantage of the Address Space Layout Randomization (ASLR).
      
      * -z relro -z now - Resolve all dynamically linked functions at the
        beginning of the execution, and then make the GOT read-only.
      
      Also do not disable hardening for Debian and RPM-based Linux distros.
      
      Closes #5372
      Closes #7536
      
      NO_DOC=build
      NO_TEST=build
      e6abe1c9
  14. Aug 04, 2022
  15. Aug 03, 2022
    • Serge Petrenko's avatar
      build: fix bundled libcurl and c-ares build on OS X · ed16c1e5
      Serge Petrenko authored
      c-ares relies on libresolv on OS X, and when built statically, brings
      the same dependency on to libcurl.
      
      Link libcurl with libresolv explicitly when linking with c-ares
      
      NO_DOC=build fix
      NO_TEST=build fix
      NO_CHANGELOG=build fix
      ed16c1e5
    • Vladimir Davydov's avatar
      build: bump zstd submodule · ec02a6ad
      Vladimir Davydov authored
      Updated third_party/zstd submodule from v1.5.0 to 1.5.2 version.
      The new version fixes a few bugs found by fuzzing testing.
      
      Note, the new zstd version contains a .S source file so we need to
      include ASM to the CMake project languages.
      
      NO_DOC=build
      NO_TEST=build
      ec02a6ad
  16. Jul 12, 2022
    • Alexander Turenko's avatar
      http client: return back CA certificates search · 9d620bd0
      Alexander Turenko authored
      Without CA certificates the HTTP client will unable to verify server's
      certificate, so the only way to perform an HTTPS request would be use
      the `verify_peer = false` option -- disable certificate validation at
      all.
      
      The runtime search of system CA bundle/certificates was unintentionally
      disabled in 2.10.0 (PR #7119). The patch enabled is back.
      
      The main motivation behind the runtime search is difference in paths on
      different systems. Since we ship Tarantool Enterprise Edition as
      executable with ability to run on different Linux distributions, we
      can't choose one particular path at build time. See details in #5746.
      
      The `CURL_CA_BUNDLE_SET` and `CURL_CA_PATH_SET` options were removed,
      because they are not 'real' curl configuration options, but rather
      cached values to don't repeat file/directory search at re-configuration.
      It looks as internal logic of Curl's CMake script.
      
      NO_DOC=Lack of proper HTTPS support is definitely broken behavior, there
             is no sense to document it or the opposite.
      NO_TEST=A simple test would require to send a request to external host.
              It would not work without internet connection or in a sandbox.
              Such test also would be unstable and would fail from time to
              time due to network conditions. I verified the patch manually. I
              have an idea to add more thorough http client testing later.
      
      Fixes #7372
      9d620bd0
  17. Jul 08, 2022
  18. Jun 30, 2022
    • Boris Stepanenko's avatar
      gcov: use __gcov_dump + __gcov_reset instead of __gcov_flush · bd813168
      Boris Stepanenko authored
      __gcov_flush was removed in gcc11.
      
      Since gcc11 __gcov_dump calls __gcov_lock at the start and
      __gcov_unlock before returning. Same is true for __gcov_reset.
      Because of that using __gcov_reset right after __gcov_dump since gcc11
      is the same as using __gcov_flush before gcc11.
      
      Closes #7302
      
      NO_CHANGELOG=internal
      NO_DOC=internal
      NO_TEST=internal
      bd813168
  19. Jun 23, 2022
    • Georgiy Lebedev's avatar
      build: pass necessary compiler flags to libunwind project submodule · bd026399
      Georgiy Lebedev authored
      For the sake of maximizing backtrace collection performance, build
      the libunwind project submodule with "-O2" compiler flag.
      
      Also, build it with the "-g" compiler flag just in case to simplify
      debugging.
      
      Last but not least, pass the same archive-maintaining program used by the
      main CMake project to the libunwind project submodule to make the build
      homogeneous.
      
      Needed for #7207
      
      NO_CHANGELOG=build
      NO_DOC=build
      NO_TEST=build
      bd026399
  20. Jun 20, 2022
  21. Jun 02, 2022
  22. May 19, 2022
  23. Apr 19, 2022
    • Georgiy Lebedev's avatar
      core: re-enable backtrace feature on AARCH64 · ef486a09
      Georgiy Lebedev authored
      After fixing libunwind issues in 7dc9fe44, libcoro fibers issues in
      761053f0 and c8ad49f0, we can now re-enable backtrace feature on
      AARCH64.
      
      For some not investigated reason `unw_backtrace` does not collect any
      ips when "-mbranch-protection" compile feature is enabled: provide a
      workaround for this case.
      
      Closes #6060
      
      NO_DOC=build system
      NO_TEST=build system
      ef486a09
  24. Apr 04, 2022
    • Timur Safin's avatar
      datetime: huge dates support in parse functions · 5511dda7
      Timur Safin authored
      * Default parse
        - new c-dt version used which handles extended years range
          while parse relaxed iso8601 gformat strings;
        - family of functions like dt_from_ymd_checked functions
          added to the new c-dt version, now used by conversion code
          to properly handle validation of a 32-bit boundary values;
        - datetime_parse_full() modified to properly handle huge years values;
        - added tests for extended years range.
      
      * strptime-like parse
        - properly handle longer than 4 years values, negative values,
          and handle zulu suffix, which may be generated by Tarantool
          stringization routines;
      
      Part of #6731
      
      NO_DOC=internal
      NO_CHANGELOG=internal
      5511dda7
  25. Mar 31, 2022
    • Vladimir Davydov's avatar
      cmake: fix lua_source for files stored in superproject · 3bacde16
      Vladimir Davydov authored
      If Tarantool is built as a subproject, and there's a Lua source file
      stored in the superproject directory, its path won't start with
      PROJECT_SOURCE_DIR and hence won't be replaced with PROJECT_BINARY_DIR
      by the lua_source() function. As a result, the lua.c file generated by
      lua_source() will be put in the source directory instead of the binary
      directory. Fix this by using CMAKE dirs instead of PROJECT dirs.
      
      Ironically, CMAKE dirs were replaced with PROJECT dirs everywhere in
      the first place to allow building Tarantool as a subproject, see commit
      d8097325 ("cmake: align folders dependencies"). This patch basically
      reverts that change.
      
      NO_DOC=cmake
      NO_TEST=cmake
      NO_CHANGELOG=cmake
      3bacde16
  26. Mar 29, 2022
  27. Mar 18, 2022
    • Georgiy Lebedev's avatar
      libunwind: add new submodule · 7dc9fe44
      Georgiy Lebedev authored
      Investigation of GNU libunwind problems on the aarch64-linux-gnu
      platform drive us to the conclusion that libunwind-1.2.1 provided by
      major distribution packages is broken. Not to mention that its test
      suite fails with SEGFAULTs.
      
      Last but not least, some distributions, e.g. CentOS 8 (see #4611) do
      not provide a libunwind package.
      
      Hence, bundle libunwind: bundling is enabled by default on all
      platforms, except for macOS — a system package can be used if its
      version is greater or equal than 1.3.0 (minimal version that does not
      seem to be broken on aarch64-linux-gnu).
      
      * Add new submodule: bump it to current master.
      * Refactor libunwind package search logic out of compiler.cmake.
      * Add CMake script for building bundled libunwind.
      * Add CMake script for extracting version of libunwind.
      * Re-enable backtrace for all RHEL distributions by default.
      * Remove libunwind from static build.
      
      Needed for #4002
      Closes #4611
      
      NO_DOC=build system
      NO_TEST=build system
      7dc9fe44
  28. Dec 21, 2021
    • AnaNek's avatar
      build: link bundled libcurl with nghttp2 · fa8d70ca
      AnaNek authored
      Before this patch Tarantool http client did not support HTTP/2.
      The reasons to enable HTTP/2 support are efficiency offered by
      the protocol and potential ability to interact with a GRPC server.
      The CMake version requirement is updated from 3.2 to 3.3, because
      we need generator expressions in cmake for setting multiple paths
      in CMAKE_FIND_ROOT_PATH for nghttp2 support.
      
      Closes #5771
      
      @TarantoolBot document
      Title: Now we require CMake 3.3 to build tarantool
      
      In tarantool/doc#2065 we requested to update
      the CMake minimum version to 3.2. Now it is time for 3.3.
      See details in the linked commit.
      fa8d70ca
  29. Dec 17, 2021
  30. Dec 10, 2021
    • Vladimir Davydov's avatar
      cmake: pass symbol name explicitly to lua_source and bin_source · f5a7bb42
      Vladimir Davydov authored
      Currently, the symbol name is deducted from the filename, but it may
      lead to name clashes if different packages have modules with same names.
      Let's pass the symbol name explicitly to avoid that.
      
      This is needed to embed luarocks in static build.
      f5a7bb42
    • Vladimir Davydov's avatar
      cmake: factor out FindZLIB · 4bd44330
      Vladimir Davydov authored
      Zlib is used in OpenSSL and in libCURL. Besides, we will need it for
      lua-zlib. So better define FindZLIB.
      
      Note, `add_library(ZLIB::ZLIB UNKNOWN IMPORTED)` and setting the
      corresponding properties in FindZLIB.cmake is needed to build libcurl,
      which depends on zlib.
      4bd44330
  31. Dec 09, 2021
  32. Dec 08, 2021
  33. Oct 14, 2021
    • Timur Safin's avatar
      build, lua: built-in module datetime · 43e10ed3
      Timur Safin authored
      Introduce a new builtin Tarantool module `datetime.lua` for timestamp
      and interval types support.
      
      New third_party module - c-dt
      -----------------------------
      
      * Integrated chansen/c-dt parser as 3rd party module to the
        Tarantool cmake build process;
      * We use tarantool/c-dt instead of original chansen/c-dt to
        have an easier cmake build integration, as we have added some
        changes, which provide cmake support, and allow to rename symbols
        if necessary (this symbol renaming is similar to that we see
        with xxhash or icu).
      
      New built-in module `datetime`
      ------------------------------
      
      * created a new Tarantool built-in module `datetime`, which uses
        `struct datetime` data structure for keeping timestamp values;
      * Lua module uses a number of `dt_*` functions from `c-dt` library,
        but they were renamed to `tnt_dt_*` at the moment of exporting
        from executable - to avoid possible name clashes with external
        libraries.
      
      * At the moment we libc `strftime` for formatting of datetime
        values according to flags passed, i.e. `date:format('%FT%T%z')`
        will return something like '1970-01-01T00:00:00+0000', but
        `date:format('%A %d, %B %Y')` will return 'Thursday 01, January 1970'
      
      * if there is no format provided then we use default
        `tnt_datetime_to_string()` function, which converts datetime
        to their default ISO-8601 output format, i.e.
        `tostring(date)` will return string like "1970-01-01T00:00:00Z"
      
      * There are a number of simplified interfaces
        - totable() for exporting table with attributes names as provided
          by `os.date('*t')`
        - set() method provides unified interface to set values using
          the set of attributes as defined above in totable()
      
      Example,
      
      ```
      local dt = datetime.new {
      	nsec      = 123456789,
      
      	sec       = 19,
      	min       = 29,
      	hour      = 18,
      
      	day       = 20,
      	month     = 8,
      	year      = 2021,
      
      	tzoffset  = 180
      }
      
      local t = dt:totable()
      --[[
      {
      	sec = 19,
      	min = 29,
      	wday = 6,
      	day = 20,
      	nsec = 123456789,
      	isdst = false,
      	yday = 232,
      	tzoffset = 180,
      	month = 8,
      	year = 2021,
      	hour = 18
      }
      --]]
      
      dt:format()   -- 2021-08-21T14:53:34.032Z
      dt:format('%Y-%m-%dT%H:%M:%S')   -- 2021-08-21T14:53:34
      
      dt:set {
      	usec      = 123456,
      
      	sec       = 19,
      	min       = 29,
      	hour      = 18,
      
      	day       = 20,
      	month     = 8,
      	year      = 2021,
      
      	tzoffset  = 180,
      
      }
      dt:set {
      	timestamp = 1629476485.124,
      
      	tzoffset  = 180,
      }
      
      ```
      
      Coverage is
      
      File                 Hits Missed Coverage
      -----------------------------------------
      builtin/datetime.lua 299  23     92.86%
      -----------------------------------------
      Total                299  23     92.86%
      
      Part of #5941
      
      @TarantoolBot document
      Title: Introduced a new `datetime` module for timestamp and interval support
      
      Create `datetime` module for timestamp and interval types support.
      It allows to create date and timestamp values using either object interface,
      or via parsing of string values conforming to iso-8601 standard.
      One may manipulate (modify, subtract or add) timestamp and interval values.
      
      Please refer to https://hackmd.io/@Mons/S1Vfc_axK#Datetime-in-Tarantool
      for a more detailed description of module API.
      43e10ed3
  34. Sep 28, 2021
    • VitaliyaIoffe's avatar
      github-ci: use openssl@1.1 · 33830978
      VitaliyaIoffe authored
      OSX workflows use brew for install openssl.
      There was a new release of openssl@3.0 and
      homebrew updated the openssl formula.
      
      Close #6468
      33830978
Loading