From d5814c7884d2bdbfc012ed3bedbf76a70976a26e Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 22:11:22 +0300 Subject: [PATCH 01/12] feat cmake: download userver using CPM unless installed --- .github/workflows/ci.yml | 4 ++-- CMakeLists.txt | 19 +++++-------------- cmake/DownloadUserver.cmake | 34 ++++++++++++++++++++++++++++++++++ cmake/get_cpm.cmake | 24 ++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 cmake/DownloadUserver.cmake create mode 100644 cmake/get_cpm.cmake diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cf36f0..6f7b39e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,9 +44,9 @@ jobs: - name: Install packages run: | - (cd third_party && git clone -b develop --single-branch --depth 1 https://github.com/userver-framework/userver.git) + DEPS_FILE="https://github.com/userver-framework/userver/scripts/docs/en/deps/${{matrix.os}}.md" sudo apt update - sudo apt install --allow-downgrades -y $(cat third_party/userver/scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ') + sudo apt install --allow-downgrades -y $(wget -q -O - ${DEPS_FILE} | tr '\n' ' ') python3 -m pip install -r requirements.txt - name: Setup ccache diff --git a/CMakeLists.txt b/CMakeLists.txt index c4513d2..a1191e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,23 +1,14 @@ cmake_minimum_required(VERSION 3.12) project(service_template CXX) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +include(DownloadUserver) -# Adding userver dependency find_package(userver COMPONENTS core postgresql QUIET) -if(NOT userver_FOUND) # Fallback to subdirectory usage - # Compatibility mode: some systems don't support these features - set(USERVER_FEATURE_CRYPTOPP_BLAKE2 OFF CACHE BOOL "" FORCE) - set(USERVER_FEATURE_GRPC_CHANNELZ OFF CACHE BOOL "" FORCE) - set(USERVER_FEATURE_REDIS_HI_MALLOC ON CACHE BOOL "" FORCE) - - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver) - message(STATUS "Using userver framework from third_party/userver") - add_subdirectory(third_party/userver) - else() - message(FATAL_ERROR "Either install the userver or provide a path to it") - endif() +if(NOT userver_FOUND) + # download_userver() tries TRY_DIR first, fallbacks to downloading userver from github + download_userver(TRY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver") endif() - userver_setup_environment() diff --git a/cmake/DownloadUserver.cmake b/cmake/DownloadUserver.cmake new file mode 100644 index 0000000..9909b71 --- /dev/null +++ b/cmake/DownloadUserver.cmake @@ -0,0 +1,34 @@ +include_guard(GLOBAL) + +function(download_userver) + set(OPTIONS) + set(ONE_VALUE_ARGS VERSION TRY_DIR) + set(MULTI_VALUE_ARGS OPTIONS) + cmake_parse_arguments( + ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} + ) + if(NOT ARG_VERSION) + set(ARG_VERSION develop) + endif() + + if(ARG_TRY_DIR AND EXISTS "${ARG_TRY_DIR}") + foreach(OPTION IN LIST ARG_OPTIONS) + separate_arguments(OPTION) + list(GET OPTION 0 KEY) + list(GET OPTION 1 VALUE) + set("${KEY}" "${VALUE}" CACHE STRING "" FORCE) + endforeach() + + message(STATUS "Using userver from ${ARG_TRY_DIR}") + add_subdirectory("${ARG_TRY_DIR}") + return() + endif() + + include(get_cpm) + CPMAddPackage( + NAME userver + GITHUB_REPOSITORY userver-framework/userver + GIT_TAG "${ARG_VERSION}" + OPTIONS ${ARG_OPTIONS} + ) +endfunction() diff --git a/cmake/get_cpm.cmake b/cmake/get_cpm.cmake new file mode 100644 index 0000000..f80013e --- /dev/null +++ b/cmake/get_cpm.cmake @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors + +set(CPM_DOWNLOAD_VERSION 0.40.2) +set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d") + +if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) + +file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} +) + +include(${CPM_DOWNLOAD_LOCATION}) From 1c7dfeea42f9f2059382109147f365b9d8aca561 Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 22:21:21 +0300 Subject: [PATCH 02/12] Fix --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f7b39e..f8eca12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,10 +41,9 @@ jobs: restore-keys: | ${{matrix.os}} ${{matrix.info}} ccache-dir ${{github.ref}} run-' ${{matrix.os}} ${{matrix.info}} ccache- - - name: Install packages run: | - DEPS_FILE="https://github.com/userver-framework/userver/scripts/docs/en/deps/${{matrix.os}}.md" + DEPS_FILE="https://raw.githubusercontent.com/userver-framework/userver/refs/heads/develop/scripts/docs/en/deps/${{matrix.os}}.md" sudo apt update sudo apt install --allow-downgrades -y $(wget -q -O - ${DEPS_FILE} | tr '\n' ' ') python3 -m pip install -r requirements.txt From 1e8dfd433f5a1a92764693e57801a17d2e06d92e Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 22:45:37 +0300 Subject: [PATCH 03/12] Fix --- .github/workflows/ci.yml | 1 + CMakeLists.txt | 11 ++++++++--- cmake/DownloadUserver.cmake | 10 +++------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8eca12..e9454f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,7 @@ jobs: restore-keys: | ${{matrix.os}} ${{matrix.info}} ccache-dir ${{github.ref}} run-' ${{matrix.os}} ${{matrix.info}} ccache- + - name: Install packages run: | DEPS_FILE="https://raw.githubusercontent.com/userver-framework/userver/refs/heads/develop/scripts/docs/en/deps/${{matrix.os}}.md" diff --git a/CMakeLists.txt b/CMakeLists.txt index a1191e9..9630dea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,16 @@ project(service_template CXX) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(DownloadUserver) -find_package(userver COMPONENTS core postgresql QUIET) +find_package(userver COMPONENTS core QUIET) if(NOT userver_FOUND) - # download_userver() tries TRY_DIR first, fallbacks to downloading userver from github - download_userver(TRY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver") + # Tries TRY_DIR first, fallbacks to downloading userver using CPM. + download_userver( + TRY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver" + GITHUB_REPOSITORY userver-framework/userver + GIT_TAG develop + ) endif() + userver_setup_environment() diff --git a/cmake/DownloadUserver.cmake b/cmake/DownloadUserver.cmake index 9909b71..5deb5cc 100644 --- a/cmake/DownloadUserver.cmake +++ b/cmake/DownloadUserver.cmake @@ -2,14 +2,11 @@ include_guard(GLOBAL) function(download_userver) set(OPTIONS) - set(ONE_VALUE_ARGS VERSION TRY_DIR) + set(ONE_VALUE_ARGS TRY_DIR) set(MULTI_VALUE_ARGS OPTIONS) cmake_parse_arguments( ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} ) - if(NOT ARG_VERSION) - set(ARG_VERSION develop) - endif() if(ARG_TRY_DIR AND EXISTS "${ARG_TRY_DIR}") foreach(OPTION IN LIST ARG_OPTIONS) @@ -27,8 +24,7 @@ function(download_userver) include(get_cpm) CPMAddPackage( NAME userver - GITHUB_REPOSITORY userver-framework/userver - GIT_TAG "${ARG_VERSION}" - OPTIONS ${ARG_OPTIONS} + ${ARG_UNPARSED_ARGUMENTS} + OPTIONS ${OPTIONS} ) endfunction() From ee74b540008b7110a482fa71093c0df9aa6632d8 Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 23:02:36 +0300 Subject: [PATCH 04/12] Fix --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9630dea..7df3df5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ if(NOT userver_FOUND) download_userver( TRY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver" GITHUB_REPOSITORY userver-framework/userver + # Optionally: pin userver version for reproducible builds. GIT_TAG develop ) endif() From f6b25e456f6c0892e47e19588e202c9a6d97d5b0 Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 23:03:56 +0300 Subject: [PATCH 05/12] Fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7df3df5..290a714 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ include(DownloadUserver) find_package(userver COMPONENTS core QUIET) if(NOT userver_FOUND) - # Tries TRY_DIR first, fallbacks to downloading userver using CPM. + # Tries TRY_DIR first, falls back to downloading userver using CPM. download_userver( TRY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver" GITHUB_REPOSITORY userver-framework/userver From c872c8a3c030d1251654b2dbbc2d8f884dc28dbb Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 23:43:42 +0300 Subject: [PATCH 06/12] Fix --- cmake/DownloadUserver.cmake | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmake/DownloadUserver.cmake b/cmake/DownloadUserver.cmake index 5deb5cc..db32e91 100644 --- a/cmake/DownloadUserver.cmake +++ b/cmake/DownloadUserver.cmake @@ -3,19 +3,12 @@ include_guard(GLOBAL) function(download_userver) set(OPTIONS) set(ONE_VALUE_ARGS TRY_DIR) - set(MULTI_VALUE_ARGS OPTIONS) + set(MULTI_VALUE_ARGS) cmake_parse_arguments( ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} ) if(ARG_TRY_DIR AND EXISTS "${ARG_TRY_DIR}") - foreach(OPTION IN LIST ARG_OPTIONS) - separate_arguments(OPTION) - list(GET OPTION 0 KEY) - list(GET OPTION 1 VALUE) - set("${KEY}" "${VALUE}" CACHE STRING "" FORCE) - endforeach() - message(STATUS "Using userver from ${ARG_TRY_DIR}") add_subdirectory("${ARG_TRY_DIR}") return() @@ -25,6 +18,5 @@ function(download_userver) CPMAddPackage( NAME userver ${ARG_UNPARSED_ARGUMENTS} - OPTIONS ${OPTIONS} ) endfunction() From 4f5596bb22a1b83e856ff57e3e7e906a37da86d1 Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 23:51:16 +0300 Subject: [PATCH 07/12] Fix --- cmake/DownloadUserver.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/DownloadUserver.cmake b/cmake/DownloadUserver.cmake index db32e91..9ab169d 100644 --- a/cmake/DownloadUserver.cmake +++ b/cmake/DownloadUserver.cmake @@ -2,7 +2,7 @@ include_guard(GLOBAL) function(download_userver) set(OPTIONS) - set(ONE_VALUE_ARGS TRY_DIR) + set(ONE_VALUE_ARGS TRY_DIR VERSION) set(MULTI_VALUE_ARGS) cmake_parse_arguments( ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} @@ -14,9 +14,16 @@ function(download_userver) return() endif() + if(NOT DEFINED ARG_VERSION) + set(GIT_TAG develop) + endif() + include(get_cpm) CPMAddPackage( NAME userver + GITHUB_REPOSITORY userver-framework/userver + VERSION ${ARG_VERSION} + GIT_TAG ${ARG_GIT_TAG} ${ARG_UNPARSED_ARGUMENTS} ) endfunction() From 033e4ca29636c585d1b12f0c1945b75a0aa3d4ba Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 23:51:55 +0300 Subject: [PATCH 08/12] Fix --- cmake/DownloadUserver.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/DownloadUserver.cmake b/cmake/DownloadUserver.cmake index 9ab169d..83cc000 100644 --- a/cmake/DownloadUserver.cmake +++ b/cmake/DownloadUserver.cmake @@ -2,7 +2,7 @@ include_guard(GLOBAL) function(download_userver) set(OPTIONS) - set(ONE_VALUE_ARGS TRY_DIR VERSION) + set(ONE_VALUE_ARGS TRY_DIR VERSION GIT_TAG) set(MULTI_VALUE_ARGS) cmake_parse_arguments( ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} @@ -14,8 +14,8 @@ function(download_userver) return() endif() - if(NOT DEFINED ARG_VERSION) - set(GIT_TAG develop) + if(NOT DEFINED ARG_VERSION AND NOT DEFINED ARG_GIT_TAG) + set(ARG_GIT_TAG develop) endif() include(get_cpm) From e2dea06300f571ce20c45f020c37e83c731c93dd Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 12 Dec 2024 23:55:04 +0300 Subject: [PATCH 09/12] Fix --- CMakeLists.txt | 9 ++------- third_party/Readme.md | 11 ----------- 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 third_party/Readme.md diff --git a/CMakeLists.txt b/CMakeLists.txt index 290a714..3166b13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,13 +6,8 @@ include(DownloadUserver) find_package(userver COMPONENTS core QUIET) if(NOT userver_FOUND) - # Tries TRY_DIR first, falls back to downloading userver using CPM. - download_userver( - TRY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/userver" - GITHUB_REPOSITORY userver-framework/userver - # Optionally: pin userver version for reproducible builds. - GIT_TAG develop - ) + # Tries TRY_DIR first, falls back to downloading userver from GitHub using CPM. + download_userver(TRY_DIR third_party/userver) endif() userver_setup_environment() diff --git a/third_party/Readme.md b/third_party/Readme.md deleted file mode 100644 index 2e623aa..0000000 --- a/third_party/Readme.md +++ /dev/null @@ -1,11 +0,0 @@ -### Directory for third party libraries - -`userver` placed into this directory would be used if there's no installed -userver framework. For example: - -``` -cd /data/code -git clone --depth 1 https://github.com/userver-framework/userver.git -git clone --depth 1 https://github.com/userver-framework/service_template.git -ln -s /data/code/userver /data/code/service_template/third_party/userver -``` From 4c459fa44ffa42f35122f1bcffdb1457b4a024cb Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Fri, 13 Dec 2024 12:16:32 +0300 Subject: [PATCH 10/12] Fix --- .gitignore | 1 + CMakePresets.json | 81 +++++++++++++++++++++++++++++++++++++ Makefile | 6 +-- cmake/DownloadUserver.cmake | 18 ++++++--- 4 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 CMakePresets.json diff --git a/.gitignore b/.gitignore index c631f25..9e986f8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ cmake-build-* Testing/ .DS_Store Makefile.local +CmakeUserPresets.json diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..8c2e68d --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,81 @@ +{ + "version": 2, + "cmakeMinimumRequired": { + "major": 3, + "minor": 20, + "patch": 0 + }, + "configurePresets": [ + { + "name": "debug", + "displayName": "Debug", + "description": "Fully featured Debug build, some platforms miss the required dependencies", + "inherits": [ + "common-flags" + ], + "binaryDir": "${sourceDir}/build_debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "USERVER_SANITIZE": "addr;ub" + } + }, + { + "name": "release", + "displayName": "Release", + "description": "Fully featured Release build, some platforms miss the required dependencies", + "inherits": [ + "common-flags" + ], + "binaryDir": "${sourceDir}/build_release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "compat-debug", + "displayName": "Compatibility-mode Debug", + "description": "Debug build with some features (e.g. sanitizers) disabled for compatibility", + "inherits": [ + "compat-flags", + "common-flags" + ], + "binaryDir": "${sourceDir}/build_debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "compat-release", + "displayName": "Compatibility-mode Release", + "description": "Release build with some features disabled for compatibility", + "inherits": [ + "common-flags", + "compat-flags" + ], + "binaryDir": "${sourceDir}/build_release", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "common-flags", + "hidden": true, + "generator": "Ninja", + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_C_COMPILER": "cc", + "CMAKE_CXX_COMPILER": "c++" + } + }, + { + "name": "compat-flags", + "hidden": true, + "generator": "Unix Makefiles", + "cacheVariables": { + "USERVER_FEATURE_CRYPTOPP_BLAKE2": "OFF", + "USERVER_FEATURE_GRPC_CHANNELZ": "OFF", + "USERVER_FEATURE_REDIS_HI_MALLOC": "ON" + } + } + ] +} diff --git a/Makefile b/Makefile index 234880f..e9725c5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CMAKE_COMMON_FLAGS ?= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -CMAKE_DEBUG_FLAGS ?= -DUSERVER_SANITIZE='addr ub' -CMAKE_RELEASE_FLAGS ?= +CMAKE_DEBUG_FLAGS ?= --preset debug +CMAKE_RELEASE_FLAGS ?= --preset release NPROCS ?= $(shell nproc) CLANG_FORMAT ?= clang-format DOCKER_COMPOSE ?= docker-compose @@ -42,7 +42,7 @@ test-debug test-release: test-%: build-% # Start the service (via testsuite service runner) .PHONY: start-debug start-release start-debug start-release: start-%: - cmake --build build_$* -v --target=start-service_template + cmake --build build_$* -v --target start-service_template .PHONY: service-start-debug service-start-release service-start-debug service-start-release: service-start-%: start-% diff --git a/cmake/DownloadUserver.cmake b/cmake/DownloadUserver.cmake index 83cc000..390533a 100644 --- a/cmake/DownloadUserver.cmake +++ b/cmake/DownloadUserver.cmake @@ -8,17 +8,25 @@ function(download_userver) ARG "${OPTIONS}" "${ONE_VALUE_ARGS}" "${MULTI_VALUE_ARGS}" ${ARGN} ) - if(ARG_TRY_DIR AND EXISTS "${ARG_TRY_DIR}") - message(STATUS "Using userver from ${ARG_TRY_DIR}") - add_subdirectory("${ARG_TRY_DIR}") - return() + if(ARG_TRY_DIR) + get_filename_component(ARG_TRY_DIR "${ARG_TRY_DIR}" REALPATH) + if(EXISTS "${ARG_TRY_DIR}") + message(STATUS "Using userver from ${ARG_TRY_DIR}") + add_subdirectory("${ARG_TRY_DIR}" third_party/userver) + return() + endif() endif() + include(get_cpm) + if(NOT DEFINED ARG_VERSION AND NOT DEFINED ARG_GIT_TAG) set(ARG_GIT_TAG develop) endif() - include(get_cpm) + if(NOT DEFINED CPM_USE_NAMED_CACHE_DIRECTORIES) + set(CPM_USE_NAMED_CACHE_DIRECTORIES ON) + endif() + CPMAddPackage( NAME userver GITHUB_REPOSITORY userver-framework/userver From ecb19641ff3139454074a909694604b135133668 Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Thu, 19 Dec 2024 00:31:09 +0300 Subject: [PATCH 11/12] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9454f7..6b29dee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: run: | DEPS_FILE="https://raw.githubusercontent.com/userver-framework/userver/refs/heads/develop/scripts/docs/en/deps/${{matrix.os}}.md" sudo apt update - sudo apt install --allow-downgrades -y $(wget -q -O - ${DEPS_FILE} | tr '\n' ' ') + sudo apt install --allow-downgrades -y $(wget -q -O - ${DEPS_FILE}) python3 -m pip install -r requirements.txt - name: Setup ccache From b6199493c622b51d5ac01d428e7d6741c2724640 Mon Sep 17 00:00:00 2001 From: Anton Zhilin Date: Wed, 15 Jan 2025 11:53:06 +0300 Subject: [PATCH 12/12] Scrap compat presets, leave them to the user --- CMakePresets.json | 40 ++-------------------------------------- 1 file changed, 2 insertions(+), 38 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 8c2e68d..dff550d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,7 +9,7 @@ { "name": "debug", "displayName": "Debug", - "description": "Fully featured Debug build, some platforms miss the required dependencies", + "description": "Fully featured Debug build", "inherits": [ "common-flags" ], @@ -22,7 +22,7 @@ { "name": "release", "displayName": "Release", - "description": "Fully featured Release build, some platforms miss the required dependencies", + "description": "Fully featured Release build", "inherits": [ "common-flags" ], @@ -31,32 +31,6 @@ "CMAKE_BUILD_TYPE": "Release" } }, - { - "name": "compat-debug", - "displayName": "Compatibility-mode Debug", - "description": "Debug build with some features (e.g. sanitizers) disabled for compatibility", - "inherits": [ - "compat-flags", - "common-flags" - ], - "binaryDir": "${sourceDir}/build_debug", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - { - "name": "compat-release", - "displayName": "Compatibility-mode Release", - "description": "Release build with some features disabled for compatibility", - "inherits": [ - "common-flags", - "compat-flags" - ], - "binaryDir": "${sourceDir}/build_release", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - }, { "name": "common-flags", "hidden": true, @@ -66,16 +40,6 @@ "CMAKE_C_COMPILER": "cc", "CMAKE_CXX_COMPILER": "c++" } - }, - { - "name": "compat-flags", - "hidden": true, - "generator": "Unix Makefiles", - "cacheVariables": { - "USERVER_FEATURE_CRYPTOPP_BLAKE2": "OFF", - "USERVER_FEATURE_GRPC_CHANNELZ": "OFF", - "USERVER_FEATURE_REDIS_HI_MALLOC": "ON" - } } ] }