Skip to content
Snippets Groups Projects
  1. Sep 14, 2023
    • Sergey Bronnikov's avatar
      third_party: update libcurl from 7.87.0 to 8.3.0 · 979b4adb
      Sergey Bronnikov authored
      The patch updates curl module to the version 8.3.0 [1] and updates a
      CMake module for building curl library.
      
      Changes in CMake module:
      
      - Option `CURL_STATICLIB` is gone and replaced with `BUILD_STATIC_LIBS`.
      - Option `CURL_USE_GNUTLS` was added and disabled by default.
      - NSS library support was removed and option `CURL_USE_NSS` has been
        removed as well.
      - Option `CMAKE_UNITY_BUILD` was added and disabled by default.
      - Option `CURL_DISABLE_FORM_API` was added and disabled by default. It is
        in fact depends on `CURL_DISABLE_MIME`, but anyway disabled explicitly.
      
      Changelog: https://curl.se/changes.html#8_3_0
      
      1. https://github.com/curl/curl/releases/tag/curl-8_3_0
      
      NO_DOC=libcurl submodule bump
      NO_TEST=libcurl submodule bump
      
      Fixes #9086
      979b4adb
  2. Sep 04, 2023
    • Ilya Verbin's avatar
      cmake: fix warning in FindLibUnwind.cmake · d6845427
      Ilya Verbin authored
      This patch fixes the following warning:
      
      NO_WRAP
        CMake Warning (dev) at cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
          The package name passed to `find_package_handle_standard_args`
          (GetLIBUNWINDVersion.cmake) does not match the name of the calling package
          (LibUnwind).  This can lead to problems in calling code that expects
          `find_package` result variables (e.g., `_FOUND`) to follow a certain
          pattern.
        Call Stack (most recent call first):
          cmake/FindLibUnwind.cmake:82 (find_package_handle_standard_args)
          CMakeLists.txt:552 (find_package)
      NO_WRAP
      
      Closes #6998
      
      NO_DOC=build
      NO_TEST=build
      NO_CHANGELOG=build
      d6845427
  3. Aug 04, 2023
    • Igor Munkin's avatar
      asan: enable ASan and LSan support for LuaJIT back · bacf4e56
      Igor Munkin authored
      All LuaJIT related LSan warnings were suppressed in the scope of the
      commit 985548e4 ("asan: suppress all
      LSAN warnings related to LuaJIT"), since all compiler flags tweaks were
      enclosed in LuaJIT CMake machinery. As a result of the commit in LuaJIT
      submodule tarantool/luajit@a86e376 ("build: introduce LUAJIT_USE_ASAN
      option") ASan and LSan support has been finally added to LuaJIT runtime,
      so it was decided to remove LSan suppressions for LuaJIT functions.
      Unfortunately, it was not so easy as it looked like.
      
      At first, Lua global state is not closed properly at Tarantool instance
      exit (see <tarantool_free> in src/main.cc and <tarantool_lua_free> in
      src/lua/init.c for more info), so LSan false-positive leaks are detected
      (for more info, see #3071). Hence, the original LSan suppression for
      lj_BC_FUNCC is returned back (temporarily) until the aforementioned
      issue is not resolved.
      
      Furthermore, the internal LuaJIT memory allocator is not instrumented
      yet, so to find any memory faults it's worth building LuaJIT with system
      provided memory allocator (i.e. enable LUAJIT_USE_SYSMALLOC option).
      However, again, since Tarantool doesn't finalize Lua universe the right
      way, so running Tarantool testing routine with LUAJIT_USE_SYSMALLOC
      enabled generates false-positive LSan leaks. Return back here to enable
      LUAJIT_USE_SYSMALLOC, when #3071 is resolved.
      
      Last but not least, the default value of fiber stack size is 512Kb, but
      several tests in test/PUC-Rio-Lua-5.1-test suite in LuaJIT submodule
      (e.g. some cases with deep recursion in errors.lua or pm.lua) have
      already been tweaked according to the limitations mentioned in #5782,
      but the crashes still occur while running LuaJIT tests with ASan support
      enabled. Experiments once again confirm the notorious quote that "640 Kb
      ought to be enough for anybody".
      
      Anyway, LuaJIT tests are added to <test-release-asan> target in .test.mk
      and LUAJIT_TEST_ENV is extended with required ASan and LSan options.
      
      Follows up #5878
      
      NO_DOC=ci
      NO_TEST=ci
      NO_CHANGELOG=ci
      bacf4e56
  4. Jul 13, 2023
    • Igor Munkin's avatar
      cmake: introduce FIBER_STACK_SIZE option · ff57f990
      Igor Munkin authored
      In scope of the commit 82f4b4a3 ("lib/core/fiber: Increase default
      stack size") the default value of fiber stack size is increased up to
      512 Kb (you can find the reasons in the aforementioned commit message
      and in https://github.com/tarantool/tarantool/issues/3418 description).
      
      Some of the tests in test/PUC-Rio-Lua-5.1-test suite in LuaJIT repo
      (e.g. some cases with deep recursion in errors.lua or pm.lua) have
      already been tweaked according to the limitations mentioned in
      https://github.com/tarantool/tarantool/issues/5782, but the crashes
      still occurs while running LuaJIT tests with ASan support enabled.
      
      To make the testing routine more convenient, FIBER_STACK_SIZE option is
      introduced to Tarantool CMake machinery. One can provide the size either
      by raw digits (i.e. in bytes) or using Kb/Mb suffixes for convenience.
      
      A couple of important nits:
      * If the given value is not a multiple of 4Kb, CMake machinery adjusts
        it up to the nearest one greater than this value.
      * If the adjusted value is less than 512Kb, configuration fails with the
        corresponding CMake fatal error.
      
      Follows up #3418
      Relates to #5782
      
      @TarantoolBot document
      Title: introduce FIBER_STACK_SIZE configuration option
      
      To make managing of the default fiber stack size more convenient, the
      corresponding CMake option is added.
      
      **NB**: The stack size can't be less than 512Kb and if the given value
      is not a multiple of 4Kb, CMake machinery adjusts it up to the nearest
      one greater than this value.
      ff57f990
  5. Jun 22, 2023
  6. Jun 20, 2023
    • Ilya Verbin's avatar
      build: do not disable hardening on AArch64 systems · 5c1968ca
      Ilya Verbin authored
      It was disabled because ligomp.a on some AArch64 systems (e.g. CentOS)
      is compiled without PIC support. Now Tarantool doesn't depend on ligomp,
      so it's safe to turn on PIC for AArch64 systems.
      
      Follow-up #7536
      
      NO_DOC=build
      NO_TEST=build
      5c1968ca
    • Ilya Verbin's avatar
      build: do not disable hardening on FreeBSD · 05eba830
      Ilya Verbin authored
      It was disabled because dlsym tests failed when PIC is on (#7640).
      However, later it turned out that the issue is not related to PIC, and
      LuaJIT was turned off for such tests by commit 67e79b15 ("test: turn
      LuaJIT off in tests with dlsym"). Now it's safe to turn on PIC for FreeBSD.
      
      Follow-up #7536
      
      NO_DOC=build
      NO_TEST=build
      05eba830
    • Ilya Verbin's avatar
      build: remove dependencies on libgomp · bb7c1620
      Ilya Verbin authored
      OpenMP is no longer used since commit 4f617b70 ("box: introduce
      memtx_sort_threads config parameter"). All dependencies on libgomp
      should be removed.
      
      Follow-up #7689
      
      NO_DOC=build
      NO_TEST=build
      bb7c1620
  7. Jun 15, 2023
  8. Jun 09, 2023
    • Nikolay Shirokovskiy's avatar
      box: introduce memtx_sort_threads config parameter · 4f617b70
      Nikolay Shirokovskiy authored
      Closes #3389
      Closes #7689
      Closes #4646
      
      @TarantoolBot document
      Title: new box.cfg parameter memtx_sort_threads
      
      The parameter sets the number of threads used to sort keys of secondary
      indexes on loading memtx database. The parameter cannot be changed
      dynamically (as it does not make sense).
      
      Maximum value is 256, minimum is 1. Default is to use all available cores.
      
      Usage example:
      ```
      box.cfg{memtx_sort_threads=4}
      ```
      4f617b70
  9. May 18, 2023
    • Sergey Bronnikov's avatar
      lua: refactor integration code of EE and CE · ca804276
      Sergey Bronnikov authored
      Patch made following changes:
      - add a CMake function lua_multi_source that unpacks symbol names and
        Lua source paths in passed list and compiles Lua source into *.lua.c
        sources using lua_source() function. Function is needed for embedding
        Lua modules consisting from a number of files to Tarantool EE.
      - add using lua_multi_source instead of lua_source for etcd client module.
      - remove function prototypes and declarations related to extra features.
        All this code is moved to Tarantool EE source code.
      
      Part of #8620
      Follows up https://github.com/tarantool/tarantool-ee/issues/443
      
      NO_CHANGELOG=refactoring
      NO_DOC=refactoring
      NO_TEST=refactoring
      ca804276
  10. Apr 03, 2023
  11. Mar 21, 2023
    • Dmitriy Nesterov's avatar
      cmake: add dependencies for LuaJIT and SQL fuzzers · b11072a6
      Dmitriy Nesterov authored
      Added Google's 'libprotobuf-mutator' and 'protobuf' libraries
      for developing grammar-based LuaJIT and SQL fuzzers based on
      LibFuzzer.
      
      It is needed to build protobuf module from source because
      by default, the system-installed version of protobuf is used
      by libprotobuf-mutator, and this version can be too old.
      
      Part of #4823
      
      NO_CHANGELOG=<dependencies>
      NO_DOC=<dependencies>
      NO_TEST=<dependencies>
      b11072a6
  12. Feb 27, 2023
    • Boris Stepanenko's avatar
      third_party: update nghttp2 from 1.48.0 to 1.52.0 · a6fae421
      Boris Stepanenko authored
      Updating libcurl from 7.84.0 to 7.87.0 in commit 09f4eca1
      ("third_party: update libcurl from 7.84.0 to 7.87.0")
      made it impossible to built tarantool with bundled curl with nghttp2,
      because nghttp2 was not updated to fit libcurl 7.87.0, this led to
      missing function
      nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation
      during linking step.
      
      https://github.com/nghttp2/nghttp2/releases/tag/v1.52.0
      
      Closes #8268
      
      NO_DOC=there is no known behavior changes, consider the change as not
             visible for a user
      NO_TEST=can only reproduce in specific environment
      NO_CHANGELOG=see NO_DOC
      a6fae421
  13. Jan 23, 2023
  14. Jan 18, 2023
  15. 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
  16. 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
  17. 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
  18. 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
  19. Dec 07, 2022
  20. 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
  21. 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
  22. Nov 07, 2022
  23. 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
  24. Oct 14, 2022
  25. 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
  26. Aug 04, 2022
  27. 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
  28. 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
  29. Jul 08, 2022
  30. 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
  31. 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
  32. Jun 20, 2022
Loading