diff --git a/.github/workflows/full-ci.yml b/.github/workflows/full-ci.yml index 76b0c2129..276e432a5 100644 --- a/.github/workflows/full-ci.yml +++ b/.github/workflows/full-ci.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - tarantool-version: ["1.10", "2.10", "3.0"] + tarantool-version: ["3.0"] fail-fast: false steps: - uses: actions/checkout@v4 @@ -128,7 +128,6 @@ jobs: strategy: matrix: sdk-version: - - "2.11.2-0-r609.linux.x86_64" - "3.2.0-0-r40.linux.x86_64" fail-fast: false steps: @@ -296,7 +295,6 @@ jobs: strategy: matrix: sdk-version: - - "2.11.2-0-r609.linux.x86_64" - "3.2.0-0-r40.linux.x86_64" fail-fast: false steps: @@ -346,7 +344,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - tarantool-version: ["1.10", "2.10"] + tarantool-version: ["3.0"] fail-fast: false steps: # `ref` as merge request is needed for pull_request_target because this @@ -399,7 +397,7 @@ jobs: - name: Prepare CE env uses: ./.github/actions/prepare-ce-test-env with: - tarantool-version: '2.10.6' + tarantool-version: '3.0' skip-tarantool-install: true - name: Install dependencies diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e58c13366..3c2479dde 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - tarantool-version: ["1.10", "2.10", "3.0"] + tarantool-version: ["3.0"] fail-fast: false steps: - uses: actions/checkout@v4 @@ -128,7 +128,6 @@ jobs: strategy: matrix: sdk-version: - - "2.11.2-0-r609.linux.x86_64" - "3.2.0-0-r40.linux.x86_64" fail-fast: false steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 224af6677..9711fb769 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ for machine-readable output. - `tt init/create`: cartridge support removed. - `tt build/pack`: cartridge support removed. - tarantoolctl support has been completely removed. +- Removed support for Tarantool 1.10 and 2.x. Only Tarantool 3.x is supported. ### Fixed diff --git a/cli/cmd/binaries.go b/cli/cmd/binaries.go index 5688cbabe..6d1221dc7 100644 --- a/cli/cmd/binaries.go +++ b/cli/cmd/binaries.go @@ -42,7 +42,7 @@ You will need to choose version using arrow keys in your console. # Switch with program and version. - $ tt binaries switch tarantool 2.10.4`, + $ tt binaries switch tarantool 3.0.0`, Run: RunModuleFunc(internalSwitchModule), Args: cobra.MatchAll(cobra.MaximumNArgs(2), binariesSwitchValidateArgs), ValidArgs: binariesSupportedPrograms, diff --git a/cli/cmd/install.go b/cli/cmd/install.go index 21cb0bee4..f801f9187 100644 --- a/cli/cmd/install.go +++ b/cli/cmd/install.go @@ -99,9 +99,9 @@ func NewInstallCmd() *cobra.Command { $ tt install tt pr/534 -# Install Tarantool 2.10.5 with limit number of simultaneous jobs for make. +# Install Tarantool 3.0.0 with limit number of simultaneous jobs for make. - $ MAKEFLAGS="-j2" tt install tarantool 2.10.5`, + $ MAKEFLAGS="-j2" tt install tarantool 3.0.0`, } installCmd.Flags().BoolVarP(&installCtx.Force, "force", "f", false, "don't do a dependency check before installing") diff --git a/cli/cmd/run.go b/cli/cmd/run.go index ad734f0e7..398141e90 100644 --- a/cli/cmd/run.go +++ b/cli/cmd/run.go @@ -35,7 +35,7 @@ are passed after '--'. # Print current environment Tarantool version: $ tt run --version - Tarantool 2.11.0-entrypoint-724-gd2d7f4de3 + Tarantool 3.0.0-entrypoint-724-gd2d7f4de3 . . . # Run a script (which print passed arguments) with 3 arguments and 2 options: @@ -47,7 +47,7 @@ are passed after '--'. $ tt run -i script.lua -- -i -i - Tarantool 2.11.0-entrypoint-724-gd2d7f4de3 + Tarantool 3.0.0-entrypoint-724-gd2d7f4de3 type 'help' for interactive help tarantool> diff --git a/cli/cmd/search.go b/cli/cmd/search.go index 6e60720c2..92437c93e 100644 --- a/cli/cmd/search.go +++ b/cli/cmd/search.go @@ -82,9 +82,9 @@ func NewSearchCmd() *cobra.Command { $ tt search tarantool-ee -# Remote search across all 2.11 debug versions of Tarantool Enterprise Edition. +# Remote search across all 3.0 debug versions of Tarantool Enterprise Edition. - $ tt search tarantool-ee --debug --version 2.11 + $ tt search tarantool-ee --debug --version 3.0 # Remote search across all versions of Tarantool Cluster Manager. diff --git a/cli/install/extra/bump-libunwind-new.patch b/cli/install/extra/bump-libunwind-new.patch deleted file mode 100644 index 15beb240f..000000000 --- a/cli/install/extra/bump-libunwind-new.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt -index f76fcaf58..6f8172cee 100644 ---- a/static-build/CMakeLists.txt -+++ b/static-build/CMakeLists.txt -@@ -16,8 +16,8 @@ set(NCURSES_VERSION 6.2) - set(NCURSES_HASH e812da327b1c2214ac1aed440ea3ae8d) - set(READLINE_VERSION 8.0) - set(READLINE_HASH 7e6c1f16aee3244a69aba6e438295ca3) --set(UNWIND_VERSION 1.3-rc1) --set(UNWIND_HASH f09b670de5db6430a3de666e6aed60e3) -+set(UNWIND_VERSION 1.6.2) -+set(UNWIND_HASH f625b6a98ac1976116c71708a73dc44a) - set(BACKUP_STORAGE https://distrib.hb.bizmrg.com) - - # Pass -isysroot= option on Mac OS to a preprocessor and a C diff --git a/cli/install/extra/bump-libunwind-old.patch b/cli/install/extra/bump-libunwind-old.patch deleted file mode 100644 index 925afc0b3..000000000 --- a/cli/install/extra/bump-libunwind-old.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt -index 9a2f85052..bc73496e5 100644 ---- a/static-build/CMakeLists.txt -+++ b/static-build/CMakeLists.txt -@@ -12,7 +12,7 @@ set(OPENSSL_VERSION 1.1.1f) - set(ZLIB_VERSION 1.2.11) - set(NCURSES_VERSION 6.2) - set(READLINE_VERSION 8.0) --set(UNWIND_VERSION 1.3-rc1) -+set(UNWIND_VERSION 1.6.2) - - # Pass -isysroot= option on Mac OS to a preprocessor and a C - # compiler to find header files installed with an SDK. diff --git a/cli/install/extra/bump-libunwind.patch b/cli/install/extra/bump-libunwind.patch deleted file mode 100644 index 47a2005ab..000000000 --- a/cli/install/extra/bump-libunwind.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt -index 598c42bbc..e853f3364 100644 ---- a/static-build/CMakeLists.txt -+++ b/static-build/CMakeLists.txt -@@ -16,8 +16,8 @@ set(NCURSES_VERSION 6.2) - set(NCURSES_HASH e812da327b1c2214ac1aed440ea3ae8d) - set(READLINE_VERSION 8.0) - set(READLINE_HASH 7e6c1f16aee3244a69aba6e438295ca3) --set(UNWIND_VERSION 1.3-rc1) --set(UNWIND_HASH f09b670de5db6430a3de666e6aed60e3) -+set(UNWIND_VERSION 1.6.2) -+set(UNWIND_HASH f625b6a98ac1976116c71708a73dc44a) - - # Pass -isysroot= option on Mac OS to a preprocessor and a C - # compiler to find header files installed with an SDK. diff --git a/cli/install/extra/gh-6686-fix-build-with-glibc-2-34.patch b/cli/install/extra/gh-6686-fix-build-with-glibc-2-34.patch deleted file mode 100644 index a24e60c7b..000000000 --- a/cli/install/extra/gh-6686-fix-build-with-glibc-2-34.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/test/unit/guard.cc b/test/unit/guard.cc -index a2953b829..4762d5611 100644 ---- a/test/unit/guard.cc -+++ b/test/unit/guard.cc -@@ -28,13 +28,11 @@ stack_break_f(char *ptr) - return sum; - } - --static char stack_buf[SIGSTKSZ]; -- - static int - main_f(va_list ap) - { - stack_t stack; -- stack.ss_sp = stack_buf; -+ stack.ss_sp = malloc(SIGSTKSZ); - stack.ss_size = SIGSTKSZ; - stack.ss_flags = 0; - sigaltstack(&stack, NULL); diff --git a/cli/install/extra/openssl-symbols-1.10.14.patch b/cli/install/extra/openssl-symbols-1.10.14.patch deleted file mode 100644 index 79a446a5e..000000000 --- a/cli/install/extra/openssl-symbols-1.10.14.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff --git a/extra/exports b/extra/exports -index ef411a8c2..17140ecbf 100644 ---- a/extra/exports -+++ b/extra/exports -@@ -363,6 +363,8 @@ tnt_HMAC_CTX_new - tnt_HMAC_Init_ex - tnt_HMAC_Update - tnt_HMAC_Final -+tnt_EVP_get_digestbyname -+tnt_EVP_get_cipherbyname - tnt_iconv - tnt_iconv_close - tnt_iconv_open -diff --git a/src/lua/crypto.c b/src/lua/crypto.c -index 27b07191d..63882420b 100644 ---- a/src/lua/crypto.c -+++ b/src/lua/crypto.c -@@ -153,3 +153,15 @@ tnt_HMAC_Final(tnt_HMAC_CTX *ctx, unsigned char *md, unsigned int *len, - return rc; - #endif - } -+ -+const EVP_MD * -+tnt_EVP_get_digestbyname(const char *name) -+{ -+ return EVP_get_digestbyname(name); -+} -+ -+const EVP_CIPHER * -+tnt_EVP_get_cipherbyname(const char *name) -+{ -+ return EVP_get_cipherbyname(name); -+} -diff --git a/src/lua/crypto.lua b/src/lua/crypto.lua -index 800ccdb34..63f515fbd 100644 ---- a/src/lua/crypto.lua -+++ b/src/lua/crypto.lua -@@ -19,7 +19,7 @@ ffi.cdef[[ - int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); - int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); - int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); -- const EVP_MD *EVP_get_digestbyname(const char *name); -+ const EVP_MD *tnt_EVP_get_digestbyname(const char *name); - - typedef struct {} tnt_HMAC_CTX; - tnt_HMAC_CTX *tnt_HMAC_CTX_new(void); -@@ -48,7 +48,7 @@ ffi.cdef[[ - int tnt_EVP_CIPHER_key_length(const EVP_CIPHER *cipher); - - int tnt_EVP_CIPHER_block_size(const EVP_CIPHER *cipher); -- const EVP_CIPHER *EVP_get_cipherbyname(const char *name); -+ const EVP_CIPHER *tnt_EVP_get_cipherbyname(const char *name); - ]] - - ffi.C.tnt_openssl_init(); -@@ -63,7 +63,7 @@ for class, name in pairs({ - sha = 'SHA', sha1 = 'SHA1', sha224 = 'SHA224', - sha256 = 'SHA256', sha384 = 'SHA384', sha512 = 'SHA512', - dss = 'DSS', dss1 = 'DSS1', mdc2 = 'MDC2', ripemd160 = 'RIPEMD160'}) do -- local digest = ffi.C.EVP_get_digestbyname(class) -+ local digest = ffi.C.tnt_EVP_get_digestbyname(class) - if digest ~= nil then - digests[class] = digest - end -@@ -222,7 +222,7 @@ for algo, algo_name in pairs({des = 'DES', aes128 = 'AES-128', - for mode, mode_name in pairs({cfb = 'CFB', ofb = 'OFB', - cbc = 'CBC', ecb = 'ECB'}) do - local cipher = -- ffi.C.EVP_get_cipherbyname(algo_name .. '-' .. mode_name) -+ ffi.C.tnt_EVP_get_cipherbyname(algo_name .. '-' .. mode_name) - if cipher ~= nil then - algo_api[mode] = cipher - end diff --git a/cli/install/extra/openssl-symbols.patch b/cli/install/extra/openssl-symbols.patch deleted file mode 100644 index 3fd5e12fb..000000000 --- a/cli/install/extra/openssl-symbols.patch +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/extra/exports b/extra/exports -index b08cbc771..e131e1653 100644 ---- a/extra/exports -+++ b/extra/exports -@@ -374,3 +374,5 @@ uri_format - uri_parse - uuid_nil - _say -+tnt_EVP_get_digestbyname -+tnt_EVP_get_cipherbyname -diff --git a/src/lua/crypto.c b/src/lua/crypto.c -index 80adaca78..53a6a0254 100644 ---- a/src/lua/crypto.c -+++ b/src/lua/crypto.c -@@ -71,3 +71,15 @@ void tnt_HMAC_CTX_free(HMAC_CTX *ctx) - HMAC_CTX_free(ctx); - #endif - } -+ -+const EVP_MD * -+tnt_EVP_get_digestbyname(const char *name) -+{ -+ return EVP_get_digestbyname(name); -+} -+ -+const EVP_CIPHER * -+tnt_EVP_get_cipherbyname(const char *name) -+{ -+ return EVP_get_cipherbyname(name); -+} -diff --git a/src/lua/crypto.lua b/src/lua/crypto.lua -index cd1c78541..146926715 100644 ---- a/src/lua/crypto.lua -+++ b/src/lua/crypto.lua -@@ -19,7 +19,7 @@ ffi.cdef[[ - int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); - int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); - int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); -- const EVP_MD *EVP_get_digestbyname(const char *name); -+ const EVP_MD *tnt_EVP_get_digestbyname(const char *name); - - typedef struct {} HMAC_CTX; - HMAC_CTX *tnt_HMAC_CTX_new(void); -@@ -46,7 +46,7 @@ ffi.cdef[[ - int tnt_EVP_CIPHER_key_length(const EVP_CIPHER *cipher); - - int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); -- const EVP_CIPHER *EVP_get_cipherbyname(const char *name); -+ const EVP_CIPHER *tnt_EVP_get_cipherbyname(const char *name); - ]] - - ffi.C.tnt_openssl_init(); -@@ -61,7 +61,7 @@ for class, name in pairs({ - sha = 'SHA', sha1 = 'SHA1', sha224 = 'SHA224', - sha256 = 'SHA256', sha384 = 'SHA384', sha512 = 'SHA512', - dss = 'DSS', dss1 = 'DSS1', mdc2 = 'MDC2', ripemd160 = 'RIPEMD160'}) do -- local digest = ffi.C.EVP_get_digestbyname(class) -+ local digest = ffi.C.tnt_EVP_get_digestbyname(class) - if digest ~= nil then - digests[class] = digest - end -@@ -217,7 +217,7 @@ for algo, algo_name in pairs({des = 'DES', aes128 = 'AES-128', - for mode, mode_name in pairs({cfb = 'CFB', ofb = 'OFB', - cbc = 'CBC', ecb = 'ECB'}) do - local cipher = -- ffi.C.EVP_get_cipherbyname(algo_name .. '-' .. mode_name) -+ ffi.C.tnt_EVP_get_cipherbyname(algo_name .. '-' .. mode_name) - if cipher ~= nil then - algo_api[mode] = cipher - end diff --git a/cli/install/extra/tarantool-static-build.patch b/cli/install/extra/tarantool-static-build.patch deleted file mode 100644 index f31e4cacd..000000000 --- a/cli/install/extra/tarantool-static-build.patch +++ /dev/null @@ -1,349 +0,0 @@ -commit 62d096a7ec7bdff7db3c0f2718466ac78e4a8261 -Author: Pavel Balaev -Date: Fri Oct 7 12:51:47 2022 +0300 - - backport static build - -diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt -new file mode 100644 -index 0000000..a067704 ---- /dev/null -+++ b/static-build/CMakeLists.txt -@@ -0,0 +1,276 @@ -+cmake_minimum_required(VERSION 3.1) -+ -+# Detect system compilers for further dependencies configuring to be -+# built with these compilers. This is used to build tarantool and -+# it's dependencies by using one compiler system (for example libicu -+# by default uses clang if it exists when others uses gcc/g++ on -+# linux machine). -+project(tarantool-static C CXX) -+ -+include(ExternalProject) -+set(LIBICU_VERSION release-71-1/icu4c-71_1) -+set(LIBICU_HASH e06ffc96f59762bd3c929b217445aaec) -+set(LIBICONV_VERSION 1.17) -+set(LIBICONV_HASH d718cd5a59438be666d1575855be72c3) -+set(OPENSSL_VERSION 1.1.1q) -+set(OPENSSL_HASH c685d239b6a6e1bd78be45624c092f51) -+set(ZLIB_VERSION 1.2.12) -+set(ZLIB_HASH 5fc414a9726be31427b440b434d05f78) -+set(NCURSES_VERSION 6.3-20220716) -+set(NCURSES_HASH 2b7a0e31ebbd8144680f985d61f5bbd5) -+set(READLINE_VERSION 8.0) -+set(READLINE_HASH 7e6c1f16aee3244a69aba6e438295ca3) -+set(BACKUP_STORAGE https://distrib.hb.bizmrg.com) -+ -+# Pass -isysroot= option on Mac OS to a preprocessor and a C -+# compiler to find header files installed with an SDK. -+# -+# The idea is to set these (DEPENDENCY_*) variables to corresponding -+# environment variables at each depenency configure script. -+# -+# Note: Passing of CPPFLAGS / CFLAGS explicitly discards using of -+# corresponsing environment variables. So 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. -+set(DEPENDENCY_CFLAGS "") -+set(DEPENDENCY_CXXFLAGS "") -+set(DEPENDENCY_CPPFLAGS "") -+set(DEPENDENCY_LDFLAGS) -+if (APPLE) -+ set(DEPENDENCY_CFLAGS "${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}") -+ set(DEPENDENCY_CXXFLAGS "${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}") -+ set(DEPENDENCY_CPPFLAGS "${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}") -+endif() -+ -+# Install all libraries required by tarantool at current build dir -+ -+# -+# OpenSSL -+# -+# Patched to build on Mac OS. See -+# https://github.com/openssl/openssl/issues/18720 -+# -+ExternalProject_Add(openssl -+ URL ${BACKUP_STORAGE}/openssl/openssl-${OPENSSL_VERSION}.tar.gz -+ URL_MD5 ${OPENSSL_HASH} -+ CONFIGURE_COMMAND /config -+ CC=${CMAKE_C_COMPILER} -+ CXX=${CMAKE_CXX_COMPILER} -+ CFLAGS=${DEPENDENCY_CFLAGS} -+ CPPFLAGS=${DEPENDENCY_CPPFLAGS} -+ LDFLAGS=${DEPENDENCY_LDFLAGS} -+ -+ --prefix= -+ --libdir=lib -+ no-shared -+ INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install_sw -+ PATCH_COMMAND patch -d -p1 < -+ "${CMAKE_CURRENT_SOURCE_DIR}/openssl-111q-gh-18720.patch" -+) -+ -+# -+# ICU -+# -+ExternalProject_Add(icu -+ URL https://github.com/unicode-org/icu/releases/download/${LIBICU_VERSION}-src.tgz -+ URL_MD5 ${LIBICU_HASH} -+ # By default libicu is built by using clang/clang++ compiler (if it -+ # exists). Here is a link for detecting compilers at libicu configure -+ # script: https://github.com/unicode-org/icu/blob/7c7b8bd5702310b972f888299169bc3cc88bf0a6/icu4c/source/configure.ac#L135 -+ # This will cause the problem on linux machine: tarantool is built -+ # with gcc/g++ and libicu is built with clang/clang++ (if it exists) -+ # so at linking stage `rellocation` errors will occur. To solve this, -+ # we can set CC/CXX to CMAKE_C_COMPILER/CMAKE_CXX_COMPILER variables -+ # manually which are detected above (by cmake `project()` command) -+ CONFIGURE_COMMAND /source/configure -+ CC=${CMAKE_C_COMPILER} -+ CXX=${CMAKE_CXX_COMPILER} -+ CFLAGS=${DEPENDENCY_CFLAGS} -+ CXXFLAGS=${DEPENDENCY_CXXFLAGS} -+ CPPFLAGS=${DEPENDENCY_CPPFLAGS} -+ LDFLAGS=${DEPENDENCY_LDFLAGS} -+ -+ --with-data-packaging=static -+ --prefix= -+ --disable-shared -+ --enable-static -+) -+ -+# -+# ZLIB -+# -+ExternalProject_Add(zlib -+ URL ${BACKUP_STORAGE}/zlib/zlib-${ZLIB_VERSION}.tar.gz -+ URL_MD5 ${ZLIB_HASH} -+ CONFIGURE_COMMAND env -+ CC=${CMAKE_C_COMPILER} -+ CFLAGS=${DEPENDENCY_CFLAGS} -+ CPPFLAGS=${DEPENDENCY_CPPFLAGS} -+ LDFLAGS=${DEPENDENCY_LDFLAGS} -+ /configure -+ --prefix= -+ --static -+) -+ -+# -+# Ncurses -+# -+ExternalProject_Add(ncurses -+ URL ${BACKUP_STORAGE}/ncurses/ncurses-${NCURSES_VERSION}.tgz -+ URL_MD5 ${NCURSES_HASH} -+ CONFIGURE_COMMAND /configure -+ CC=${CMAKE_C_COMPILER} -+ CXX=${CMAKE_CXX_COMPILER} -+ CFLAGS=${DEPENDENCY_CFLAGS} -+ CPPFLAGS=${DEPENDENCY_CPPFLAGS} -+ LDFLAGS=${DEPENDENCY_LDFLAGS} -+ -+ --prefix= -+ -+ # This flag enables creation of libcurses.a as a symlink to libncurses.a -+ # and disables subdir creation `ncurses` at /include. It is -+ # necessary for correct work of FindCurses.cmake module (this module is -+ # builtin at cmake package) which used in cmake/FindReadline.cmake -+ --enable-overwrite -+ -+ # enable building libtinfo to prevent linking with libtinfo from system -+ # directories -+ --with-termlib -+ -+ # set search paths for terminfo db -+ --with-terminfo-dirs=/lib/terminfo:/usr/share/terminfo:/etc/terminfo -+ -+ # disable install created terminfo db, use db from system -+ --disable-db-install -+ --without-progs -+ --without-manpages -+) -+ -+# -+# ReadLine -+# -+# Patched to fix file descriptor leak with zero-length history file. -+# -+ExternalProject_Add(readline -+ URL https://ftp.gnu.org/gnu/readline/readline-${READLINE_VERSION}.tar.gz -+ URL_MD5 ${READLINE_HASH} -+ CONFIGURE_COMMAND /configure -+ CC=${CMAKE_C_COMPILER} -+ CFLAGS=${DEPENDENCY_CFLAGS} -+ CPPFLAGS=${DEPENDENCY_CPPFLAGS} -+ LDFLAGS=${DEPENDENCY_LDFLAGS} -+ -+ --prefix= -+ --disable-shared -+ PATCH_COMMAND patch -d -p0 < -+ "${CMAKE_CURRENT_SOURCE_DIR}/readline80-001.patch" -+) -+ -+# -+# ICONV -+# -+if (APPLE) -+ ExternalProject_Add(iconv -+ URL https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${LIBICONV_VERSION}.tar.gz -+ URL_MD5 ${LIBICONV_HASH} -+ CONFIGURE_COMMAND /configure -+ CC=${CMAKE_C_COMPILER} -+ CFLAGS=${DEPENDENCY_CFLAGS} -+ CPPFLAGS=${DEPENDENCY_CPPFLAGS} -+ LDFLAGS=${DEPENDENCY_LDFLAGS} -+ -+ --prefix= -+ --disable-shared -+ --enable-static -+ --with-gnu-ld -+ STEP_TARGETS download -+ ) -+else() -+ # In linux iconv is embedded into glibc -+ # So we find system header and copy it locally -+ find_path(ICONV_INCLUDE_DIR iconv.h) -+ if(NOT ICONV_INCLUDE_DIR) -+ message(FATAL_ERROR "iconv include header not found") -+ endif() -+ -+ set(ICONV_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/iconv-prefix") -+ -+ add_custom_command( -+ OUTPUT "${ICONV_INSTALL_PREFIX}/include/iconv.h" -+ COMMAND ${CMAKE_COMMAND} -E make_directory -+ "${ICONV_INSTALL_PREFIX}/include" -+ COMMAND ${CMAKE_COMMAND} -E copy -+ "${ICONV_INCLUDE_DIR}/iconv.h" -+ "${ICONV_INSTALL_PREFIX}/include/iconv.h" -+ ) -+ add_custom_target(iconv -+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/iconv-prefix/include/iconv.h" -+ ) -+ # This is a hack for further getting install directory of library -+ # by ExternalProject_Get_Property -+ set_target_properties(iconv -+ PROPERTIES _EP_INSTALL_DIR ${ICONV_INSTALL_PREFIX} -+ ) -+endif() -+ -+# Get install directories of builded libraries for building -+# tarantool with custon CMAKE_PREFIX_PATH -+foreach(PROJ openssl icu zlib ncurses readline iconv) -+ ExternalProject_Get_Property(${PROJ} install_dir) -+ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}:${install_dir}) -+ set(TARANTOOL_DEPENDS ${PROJ} ${TARANTOOL_DEPENDS}) -+ message(STATUS "Add external project ${PROJ} in ${install_dir}") -+endforeach() -+ -+ExternalProject_Add(tarantool -+ DEPENDS ${TARANTOOL_DEPENDS} -+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/.. -+ LIST_SEPARATOR : -+ CMAKE_ARGS -+ # Override LOCALSTATEDIR to avoid cmake "special" cases: -+ # https://cmake.org/cmake/help/v3.4/module/GNUInstallDirs.html#special-cases -+ -DCMAKE_INSTALL_LOCALSTATEDIR=/var -+ -DCMAKE_INSTALL_PREFIX= -+ -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -+ -DOPENSSL_USE_STATIC_LIBS=TRUE -+ -DBUILD_STATIC=TRUE -+ -DENABLE_DIST=TRUE -+ -DENABLE_BACKTRACE=TRUE -+ -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -+ -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -+ ${CMAKE_TARANTOOL_ARGS} -+ STEP_TARGETS build -+ BUILD_COMMAND $(MAKE) -+ BUILD_ALWAYS TRUE -+) -+ -+enable_testing() -+ExternalProject_Get_Property(tarantool install_dir) -+SET(TARANTOOL_BINARY ${install_dir}/bin/tarantool) -+ -+add_test( -+ NAME check-dependencies -+ COMMAND ${CMAKE_COMMAND} -+ -D FILE=${TARANTOOL_BINARY} -+ -P CheckDependencies.cmake -+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test -+) -+ -+add_test( -+ NAME check-exports -+ COMMAND ${TARANTOOL_BINARY} -+ ${CMAKE_CURRENT_SOURCE_DIR}/test/static-build/exports.test.lua -+) -+ -+add_test( -+ NAME check-traceback -+ COMMAND ${TARANTOOL_BINARY} -+ ${CMAKE_CURRENT_SOURCE_DIR}/test/static-build/traceback.test.lua -+) -+ -+add_test( -+ NAME check-luarocks -+ COMMAND ${TARANTOOL_BINARY} -+ ${CMAKE_CURRENT_SOURCE_DIR}/test/static-build/luarocks.test.lua -+) -diff --git a/static-build/openssl-111q-gh-18720.patch b/static-build/openssl-111q-gh-18720.patch -new file mode 100644 -index 0000000..5b64b54 ---- /dev/null -+++ b/static-build/openssl-111q-gh-18720.patch -@@ -0,0 +1,11 @@ -+diff -ru a/test/v3ext.c b/test/v3ext.c -+--- a/test/v3ext.c 2022-07-05 12:08:33.000000000 +0300 -++++ b/test/v3ext.c 2022-07-14 21:07:10.586081541 +0300 -+@@ -8,6 +8,7 @@ -+ */ -+ -+ #include -++#include -+ #include -+ #include -+ #include -diff --git a/static-build/readline80-001.patch b/static-build/readline80-001.patch -new file mode 100644 -index 0000000..aa72a9d ---- /dev/null -+++ b/static-build/readline80-001.patch -@@ -0,0 +1,38 @@ -+ READLINE PATCH REPORT -+ ===================== -+ -+Readline-Release: 8.0 -+Patch-ID: readline80-001 -+ -+Bug-Reported-by: chet.ramey@case.edu -+Bug-Reference-ID: -+Bug-Reference-URL: -+ -+Bug-Description: -+ -+The history file reading code doesn't close the file descriptor open to -+the history file when it encounters a zero-length file. -+ -+Patch (apply with `patch -p0'): -+ -+*** ../readline-8.0-patched/histfile.c 2018-06-11 09:14:52.000000000 -0400 -+--- histfile.c 2019-05-16 15:55:57.000000000 -0400 -+*************** -+*** 306,309 **** -+--- 312,316 ---- -+ { -+ free (input); -++ close (file); -+ return 0; /* don't waste time if we don't have to */ -+ } -+*** ../readline-8.0/patchlevel 2013-11-15 08:11:11.000000000 -0500 -+--- patchlevel 2014-03-21 08:28:40.000000000 -0400 -+*************** -+*** 1,3 **** -+ # Do not edit -- exists only for use by patch -+ -+! 0 -+--- 1,3 ---- -+ # Do not edit -- exists only for use by patch -+ -+! 1 diff --git a/cli/install/extra/zlib-backup-old.patch b/cli/install/extra/zlib-backup-old.patch deleted file mode 100644 index 659c2fa8d..000000000 --- a/cli/install/extra/zlib-backup-old.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt -index 9a2f85052..3d302e9f7 100644 ---- a/static-build/CMakeLists.txt -+++ b/static-build/CMakeLists.txt -@@ -83,7 +83,7 @@ ExternalProject_Add(icu - # ZLIB - # - ExternalProject_Add(zlib -- URL https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz -+ URL https://distrib.hb.bizmrg.com/zlib/zlib-${ZLIB_VERSION}.tar.gz - CONFIGURE_COMMAND env - CC=${CMAKE_C_COMPILER} - CFLAGS=${DEPENDENCY_CFLAGS} diff --git a/cli/install/extra/zlib-backup.patch b/cli/install/extra/zlib-backup.patch deleted file mode 100644 index c2acfe1e1..000000000 --- a/cli/install/extra/zlib-backup.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/static-build/CMakeLists.txt b/static-build/CMakeLists.txt -index 598c42bbc..a0aef08a4 100644 ---- a/static-build/CMakeLists.txt -+++ b/static-build/CMakeLists.txt -@@ -89,7 +89,7 @@ ExternalProject_Add(icu - # ZLIB - # - ExternalProject_Add(zlib -- URL https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz -+ URL https://distrib.hb.bizmrg.com/zlib/zlib-${ZLIB_VERSION}.tar.gz - URL_MD5 ${ZLIB_HASH} - CONFIGURE_COMMAND env - CC=${CMAKE_C_COMPILER} diff --git a/cli/install/install.go b/cli/install/install.go index 94b39abf7..41d7fb4e8 100644 --- a/cli/install/install.go +++ b/cli/install/install.go @@ -27,47 +27,6 @@ import ( "golang.org/x/sys/unix" ) -// Backported cmake rules for static build. -// Static build has appeared since version 2.6.1. -// -//go:embed extra/tarantool-static-build.patch -var staticBuildPatch []byte - -// Fix missing OpenSSL symbols. -// -//go:embed extra/openssl-symbols.patch -var opensslSymbolsPatch []byte - -//go:embed extra/openssl-symbols-1.10.14.patch -var opensslSymbolsPatch14 []byte - -// Necessary for building with >= glibc-2.34. -// Not actual for >= (1.10.11, 2.8.3). -// -//go:embed extra/gh-6686-fix-build-with-glibc-2-34.patch -var glibcPatch []byte - -// zlib version 1.2.11 is no longer available for download. -// Not actual for >= 2.10.0-rc1, 2.8.4. -// -//go:embed extra/zlib-backup-old.patch -var zlibPatchOld []byte - -//go:embed extra/zlib-backup.patch -var zlibPatch []byte - -// Old version of the libunwind doesn't compile under GCC 10. -// Not actual for >= 2.10.0-rc1. -// -//go:embed extra/bump-libunwind-old.patch -var unwindPatchOld []byte - -//go:embed extra/bump-libunwind.patch -var unwindPatch []byte - -//go:embed extra/bump-libunwind-new.patch -var unwindPatchNew []byte - const ( // defaultDirPermissions is rights used to create folders. // 0755 - drwxr-xr-x @@ -706,72 +665,14 @@ func installTt(binDir string, installCtx InstallCtx, distfiles string) error { return nil } -// patchTarantool applies patches to specific versions of tarantool. -func patchTarantool(srcPath, tarVersion string, - installCtx InstallCtx, logFile *os.File, -) error { - log.Infof("Patching tarantool...") - - if tarVersion == "master" { - return nil - } - - ver, err := version.Parse(tarVersion) - if err != nil { - return err - } - - patches := []patcher{ - patchRange_1_to_2_6_1{defaultPatchApplier{staticBuildPatch}}, - patchRange_1_to_1_10_14{defaultPatchApplier{opensslSymbolsPatch}}, - patchRange_1_10_14_to_1_10_16{defaultPatchApplier{opensslSymbolsPatch14}}, - patchRange_1_to_1_10_12{defaultPatchApplier{glibcPatch}}, - patchRange_2_to_2_8{defaultPatchApplier{glibcPatch}}, - patchRange_2_8_to_2_8_3{defaultPatchApplier{glibcPatch}}, - patch_2_10_0_rc1{defaultPatchApplier{glibcPatch}}, - patchRange_2_7_to_2_7_2{defaultPatchApplier{zlibPatchOld}}, - patchRange_2_7_2_to_2_7_4{defaultPatchApplier{zlibPatch}}, - patchRange_2_8_1_to_2_8_4{defaultPatchApplier{zlibPatch}}, - patch_2_10_beta{defaultPatchApplier{zlibPatch}}, - patchRange_2_7_to_2_7_2{defaultPatchApplier{unwindPatchOld}}, - patch_2_8_4{defaultPatchApplier{unwindPatchNew}}, - patchRange_2_7_2_to_2_7_4{defaultPatchApplier{unwindPatch}}, - patchRange_2_8_1_to_2_8_4{defaultPatchApplier{unwindPatch}}, - patch_2_10_beta{defaultPatchApplier{unwindPatch}}, - } - - for _, patch := range patches { - if patch.isApplicable(ver) { - err = patch.apply(srcPath, installCtx.verbose, logFile) - if err != nil { - return err - } - } - } - - return nil -} - // prepareCmakeOpts prepares cmake command line options for tarantool building. -func prepareCmakeOpts(buildPath, tntVersion string, +func prepareCmakeOpts(buildPath string, installCtx InstallCtx, ) ([]string, error) { cmakeOpts := []string{".."} - // Disable backtrace feature for versions 1.10.X. - // This feature is not supported by a backported static build. - btFlag := "ON" - if tntVersion != "master" { - version, err := version.Parse(tntVersion) - if err == nil { - if version.Major == 1 { - btFlag = "OFF" - } - } - } - cmakeOpts = append(cmakeOpts, `-DCMAKE_TARANTOOL_ARGS=-DCMAKE_BUILD_TYPE=RelWithDebInfo;`+ - `-DENABLE_WERROR=OFF;-DENABLE_BACKTRACE=`+btFlag) + `-DENABLE_WERROR=OFF;-DENABLE_BACKTRACE=ON`) if installCtx.Dynamic { cmakeOpts = append(cmakeOpts, "-DCMAKE_INSTALL_PREFIX="+filepath.Join(buildPath, @@ -797,7 +698,7 @@ func prepareMakeOpts(installCtx InstallCtx) []string { } // buildTarantool builds tarantool from source. Returns a path, where build artifacts are placed. -func buildTarantool(srcPath, tarVersion string, +func buildTarantool(srcPath string, installCtx InstallCtx, logFile *os.File, ) (string, error) { buildPath := filepath.Join(srcPath, "/static-build/build") @@ -809,7 +710,7 @@ func buildTarantool(srcPath, tarVersion string, return "", err } - cmakeOpts, err := prepareCmakeOpts(buildPath, tarVersion, installCtx) + cmakeOpts, err := prepareCmakeOpts(buildPath, installCtx) if err != nil { return "", err } @@ -1182,18 +1083,9 @@ func installTarantool(binDir string, installCtx InstallCtx, distfiles string) er return err } - // Patch tarantool. - if versionFound { - err = patchTarantool(path, tarVersion, installCtx, logFile) - if err != nil { - printLog(logFile.Name()) - return err - } - } - // Build tarantool. log.Infof("Building tarantool...") - buildPath, err := buildTarantool(path, tarVersion, installCtx, logFile) + buildPath, err := buildTarantool(path, installCtx, logFile) if err != nil { printLog(logFile.Name()) return err diff --git a/cli/install/patch.go b/cli/install/patch.go deleted file mode 100644 index f078966af..000000000 --- a/cli/install/patch.go +++ /dev/null @@ -1,121 +0,0 @@ -package install - -import ( - "os" - - "github.com/tarantool/tt/cli/util" - "github.com/tarantool/tt/cli/version" -) - -type patcher interface { - isApplicable(ver version.Version) bool - apply(srcPath string, verbose bool, logFile *os.File) error -} - -type defaultPatchApplier struct { - patch []byte -} - -func (applier defaultPatchApplier) apply(srcPath string, verbose bool, logFile *os.File) error { - err := util.ExecuteCommandStdin("git", verbose, logFile, - srcPath, applier.patch, "apply") - - return err -} - -type patchRange_1_to_2_6_1 struct { - defaultPatchApplier -} - -func (patchRange_1_to_2_6_1) isApplicable(ver version.Version) bool { - return (ver.Major == 2 && ver.Minor == 6 && ver.Patch < 1) || ver.Major == 1 -} - -type patch_2_8_4 struct { - defaultPatchApplier -} - -func (patch_2_8_4) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 8 && ver.Patch == 4 -} - -type patch_2_10_beta struct { - defaultPatchApplier -} - -func (patch_2_10_beta) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 10 && ver.Release.Type == version.TypeBeta -} - -type patch_2_10_0_rc1 struct { - defaultPatchApplier -} - -func (patch_2_10_0_rc1) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 10 && ver.Patch == 0 && - ver.Release.Type == version.TypeBeta && ver.Release.Num == 1 -} - -type patchRange_1_to_1_10_12 struct { - defaultPatchApplier -} - -func (patchRange_1_to_1_10_12) isApplicable(ver version.Version) bool { - return ver.Major == 1 && ver.Minor == 10 && ver.Patch < 12 -} - -type patchRange_2_7_to_2_7_2 struct { - defaultPatchApplier -} - -func (patchRange_2_7_to_2_7_2) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 7 && ver.Patch < 2 -} - -type patchRange_2_7_2_to_2_7_4 struct { - defaultPatchApplier -} - -func (patchRange_2_7_2_to_2_7_4) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 7 && (ver.Patch > 1 && ver.Patch < 4) -} - -type patchRange_2_8_1_to_2_8_4 struct { - defaultPatchApplier -} - -func (patchRange_2_8_1_to_2_8_4) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 8 && (ver.Patch > 0 && ver.Patch < 4) -} - -type patchRange_1_to_1_10_14 struct { - defaultPatchApplier -} - -func (patchRange_1_to_1_10_14) isApplicable(ver version.Version) bool { - return ver.Major == 1 && ver.Minor == 10 && ver.Patch < 14 -} - -type patchRange_1_10_14_to_1_10_16 struct { - defaultPatchApplier -} - -func (patchRange_1_10_14_to_1_10_16) isApplicable(ver version.Version) bool { - return ver.Major == 1 && ver.Minor == 10 && (ver.Patch > 13 && ver.Patch < 16) -} - -type patchRange_2_8_to_2_8_3 struct { - defaultPatchApplier -} - -func (patchRange_2_8_to_2_8_3) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor == 8 && ver.Patch < 3 -} - -type patchRange_2_to_2_8 struct { - defaultPatchApplier -} - -func (patchRange_2_to_2_8) isApplicable(ver version.Version) bool { - return ver.Major == 2 && ver.Minor < 8 -} diff --git a/cli/install/patch_test.go b/cli/install/patch_test.go deleted file mode 100644 index 581eae9a7..000000000 --- a/cli/install/patch_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package install - -import ( - "os" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "github.com/tarantool/tt/cli/util" - "github.com/tarantool/tt/cli/version" -) - -type patchRange_1_0_to_2_9 struct { - defaultPatchApplier -} - -func (patchRange_1_0_to_2_9) isApplicable(ver version.Version) bool { - return (ver.Major == 2 && ver.Minor < 10) || ver.Major == 1 -} - -func (applier patchRange_1_0_to_2_9) apply(srcPath string, verbose bool, logFile *os.File) error { - err := util.ExecuteCommandStdin("patch", verbose, logFile, - srcPath, applier.patch) - - return err -} - -type patcherInput struct { - ver version.Version -} - -type patcherOutput struct { - result *[]byte -} - -func TestPatcher(t *testing.T) { - assert := assert.New(t) - testDir := t.TempDir() - - targetData := []byte("aaa\n") - patchData := []byte("--- testdata.old 2022-10-11 10:32:28.011753821 +0300\n" + - "+++ testdata 2022-10-11 10:32:34.811754169 +0300\n" + "@@ -1 +1,2 @@\n aaa\n+bbb\n") - targetPath := testDir + "/testdata" - - testCases := make(map[patcherInput]patcherOutput) - - patchResult0 := []byte("aaa\nbbb\n") - testCases[patcherInput{version.Version{Major: 1, Minor: 2}}] = patcherOutput{&patchResult0} - - patchResult1 := []byte("aaa\n") - testCases[patcherInput{version.Version{Major: 3, Minor: 0}}] = patcherOutput{&patchResult1} - - for input, output := range testCases { - targetFile, err := os.Create(targetPath) - require.NoError(t, err) - - _, err = targetFile.Write(targetData) - require.NoError(t, err) - targetFile.Close() - - patch := patchRange_1_0_to_2_9{defaultPatchApplier{patchData}} - - if patch.isApplicable(input.ver) { - patch.apply(testDir, false, nil) - } - - patchedData, err := os.ReadFile(targetPath) - require.NoError(t, err) - - assert.Equal(*output.result, patchedData) - - os.Remove(targetPath) - } -} diff --git a/cli/replicaset/cmd/status.go b/cli/replicaset/cmd/status.go index 278ccf3e6..a135edf50 100644 --- a/cli/replicaset/cmd/status.go +++ b/cli/replicaset/cmd/status.go @@ -75,8 +75,7 @@ func statusReplicasets(replicasets replicaset.Replicasets) error { return nil } -// fillAliases fills missed aliases with UUID. The case: Tarantool 1.10 without -// an orchestrator. +// fillAliases fills missed aliases with UUID. func fillAliases(replicasets replicaset.Replicasets) replicaset.Replicasets { for i := range replicasets.Replicasets { replicaset := &replicasets.Replicasets[i] diff --git a/cli/running/cluster_instance.go b/cli/running/cluster_instance.go index 0e9496051..3d0fdebda 100644 --- a/cli/running/cluster_instance.go +++ b/cli/running/cluster_instance.go @@ -30,14 +30,6 @@ func newClusterInstance(tarantoolCli cmdcontext.TarantoolCli, instanceCtx Instan return nil, err } - tntVersion, err := tarantoolCli.GetVersion() - if err != nil { - return nil, err - } - if tntVersion.Major < 3 { - return nil, fmt.Errorf("cluster config is supported starting from Tarantool 3.0") - } - return &clusterInstance{ baseInstance: newBaseInstance(tarantoolCli.Executable, instanceCtx, opts...), runDir: instanceCtx.RunDir, diff --git a/cli/running/cluster_instance_test.go b/cli/running/cluster_instance_test.go index caf5e7f06..3b864acc9 100644 --- a/cli/running/cluster_instance_test.go +++ b/cli/running/cluster_instance_test.go @@ -19,7 +19,7 @@ import ( "github.com/tarantool/tt/cli/util" ) -var tntCli cmdcontext.TarantoolCli +var tntCli = cmdcontext.TarantoolCli{Executable: "tarantool"} const stopTimeout = 5 * time.Second @@ -49,18 +49,7 @@ func waitForMsgInBuffer(reader io.Reader, msgToWait string, waitFor time.Duratio return nil } -func SkipForTntMajorBefore3(t *testing.T) { - tntCli.Executable = "tarantool" - tntVersion, err := tntCli.GetVersion() - require.NoError(t, err) - if tntVersion.Major < 3 { - t.Skipf("cluster instances test is skipped for tarantool version %s", tntVersion.Str) - } -} - func TestClusterInstance_Start(t *testing.T) { - SkipForTntMajorBefore3(t) - configPath, err := filepath.Abs(filepath.Join("testdata", "instances_enabled", "cluster_app", "config.yml")) require.NoError(t, err) @@ -95,8 +84,6 @@ func TestClusterInstance_Start(t *testing.T) { } func TestClusterInstance_StartChangeDefaults(t *testing.T) { - SkipForTntMajorBefore3(t) - configPath, err := filepath.Abs(filepath.Join("testdata", "instances_enabled", "cluster_app", "config.yml")) require.NoError(t, err) @@ -142,8 +129,6 @@ func TestClusterInstance_StartChangeDefaults(t *testing.T) { } func TestClusterInstance_StartChangeSomeDefaults(t *testing.T) { - SkipForTntMajorBefore3(t) - configPath, err := filepath.Abs(filepath.Join("testdata", "instances_enabled", "cluster_app", "config.yml")) require.NoError(t, err) @@ -196,8 +181,6 @@ func TestClusterInstance_StartChangeSomeDefaults(t *testing.T) { } func TestClusterInstance_StopByContext(t *testing.T) { - SkipForTntMajorBefore3(t) - configPath, err := filepath.Abs(filepath.Join("testdata", "instances_enabled", "cluster_app", "config.yml")) require.NoError(t, err) diff --git a/cli/running/lua/launcher.lua b/cli/running/lua/launcher.lua index 47a161b7a..b054e6179 100644 --- a/cli/running/lua/launcher.lua +++ b/cli/running/lua/launcher.lua @@ -272,30 +272,19 @@ local function start_instance() ffi.C.chdir(console_sock_dir) end - -- If tarantool version is above 2.8.1, then can use environment variables - -- instead of wrapping cfg. - if not check_version({2,8,1,0}) then - box.cfg = cfg_wrapper - end -- Preparation of the "console" socket. local console_sock = os.getenv('TT_CLI_CONSOLE_SOCKET') if console_sock ~= nil and console_sock ~= '' then local cons_listen_sock = console.listen(console_sock) - -- tarantool 1.10 does not have a trigger on terminate a process. - -- So the socket will be closed automatically on termination and - -- deleted from "running.go". - if box.ctl.on_shutdown ~= nil then - local function close_sock_tr() - box.ctl.on_shutdown(nil, close_sock_tr) - local res, err = pcall(cons_listen_sock.close, cons_listen_sock) - if not res then - log.error('Failed to close console socket %s: %s', console_sock, err) - end + local function close_sock_tr() + box.ctl.on_shutdown(nil, close_sock_tr) + local res, err = pcall(cons_listen_sock.close, cons_listen_sock) + if not res then + log.error('Failed to close console socket %s: %s', console_sock, err) end - box.ctl.on_shutdown(close_sock_tr) end - + box.ctl.on_shutdown(close_sock_tr) end -- After making console socket chdir back to work directory. @@ -317,11 +306,6 @@ local function start_instance() end -- Start the Instance. - -- Cartridge takes instance path from arg[0] and use this path - -- for a workaround for rocks loading in tarantool 1.10. - -- This can be removed when tarantool 1.10 is no longer supported. - arg[0] = instance_path - local ok, err = pcall(dofile, instance_path) if not ok then log.error('Failed to run instance: %s, error: "%s"', instance_path, err) diff --git a/cli/running/running.go b/cli/running/running.go index cdf6085e7..fb975d353 100644 --- a/cli/running/running.go +++ b/cli/running/running.go @@ -810,13 +810,6 @@ func Stop(run *InstanceCtx) error { return err } - // tarantool 1.10 does not have a trigger on terminate a process. - // So the socket will be closed automatically on termination and - // we need to delete the file. - if _, err := os.Stat(run.ConsoleSocket); err == nil { - os.Remove(run.ConsoleSocket) - } - log.Infof("The Instance %s (PID = %v) has been terminated.", fullInstanceName, pid) return nil @@ -925,20 +918,9 @@ func GetAppInstanceName(instance InstanceCtx) string { func IsAbleToStartInstances(instances []InstanceCtx, cmdCtx *cmdcontext.CmdCtx) ( bool, string, ) { - tntVersion, err := cmdCtx.Cli.TarantoolCli.GetVersion() - if err != nil { + if _, err := cmdCtx.Cli.TarantoolCli.GetVersion(); err != nil { return false, err.Error() } - for _, inst := range instances { - if inst.ClusterConfigPath != "" { - if tntVersion.Major < 3 { - return false, fmt.Sprintf( - `cluster config is supported by Tarantool starting from version 3.0. -Current Tarantool version: %s -Cluster config path: %q`, tntVersion.Str, inst.ClusterConfigPath) - } - } - } return true, "" } diff --git a/cli/running/running_test.go b/cli/running/running_test.go index 3e226af9c..ac6c699f6 100644 --- a/cli/running/running_test.go +++ b/cli/running/running_test.go @@ -345,7 +345,7 @@ func TestIsAbleToStartInstances(t *testing.T) { err := os.WriteFile(filepath.Join(tmpDir, "tnt.sh"), []byte(`#!/bin/bash -echo "Tarantool 2.11.0"`), +echo "Tarantool 3.0.0"`), 0o755) require.NoError(t, err) @@ -362,26 +362,11 @@ echo "Tarantool 2.11.0"`), }) assert.True(t, canStart) - canStart, reason := IsAbleToStartInstances([]InstanceCtx{ - { - InstanceScript: "init.lua", - ClusterConfigPath: "config.yml", - }, - }, &cmdcontext.CmdCtx{ - Cli: cmdcontext.CliCtx{ - TarantoolCli: cmdcontext.TarantoolCli{ - Executable: filepath.Join(tmpDir, "tnt.sh"), - }, - }, - }) - assert.False(t, canStart) - assert.Contains(t, reason, "supported by Tarantool starting from version 3.0") - err = os.WriteFile(filepath.Join(tmpDir, "tnt_non_executable.sh"), []byte(`#!/bin/bash -echo "Tarantool 2.11.0"`), 0o644) +echo "Tarantool 3.0.0"`), 0o644) require.NoError(t, err) - canStart, reason = IsAbleToStartInstances([]InstanceCtx{ + canStart, reason := IsAbleToStartInstances([]InstanceCtx{ { InstanceScript: "init.lua", }, diff --git a/cli/search/search_git.go b/cli/search/search_git.go index e00ecf1d7..039bd4575 100644 --- a/cli/search/search_git.go +++ b/cli/search/search_git.go @@ -19,33 +19,9 @@ const ( ) // isMasked function checks that the given version of tarantool is masked. +// Tarantool 1.x and 2.x are no longer supported. func isMasked(version version.Version) bool { - // Mask all versions below 1.10: deprecated. - if version.Major == 1 && version.Minor < 10 { - return true - } - - // Mask all versions below 1.10.11: static build is not supported. - if version.Major == 1 && version.Minor == 10 && version.Patch < 11 { - return true - } - - // Mask all versions below 2.7: static build is not supported. - if version.Major == 2 && version.Minor < 7 { - return true - } - - // Mask 2.10.1 version: https://github.com/orgs/tarantool/discussions/7646. - if version.Major == 2 && version.Minor == 10 && version.Patch == 1 { - return true - } - - // Mask all 2.X.0 below 2.10.0: technical tags. - if version.Major == 2 && version.Minor < 10 && version.Patch == 0 { - return true - } - - return false + return version.Major < 3 } // GetVersionsFromGitRemote returns sorted versions list from specified remote git repo. diff --git a/cli/status/status.go b/cli/status/status.go index d00a6d18e..fbb420dab 100644 --- a/cli/status/status.go +++ b/cli/status/status.go @@ -215,8 +215,7 @@ func Status(runningCtx running.RunningCtx, printer InstanceStatusPrinter) error continue } - // Since Tarantool 2.x doesn't support instance names, only UUIDs are available. - // To make the alerts more readable, we map the UUIDs to instance names. + // Map UUIDs to instance names so replication alerts are readable. uuid2name[instanceState.UUID] = fullInstanceName processConfigInfo(&instStatus, instanceState)