From 6263c0bbdaa2b72e5dd0513bb4535e070cdf127d Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Sun, 11 Feb 2024 10:52:50 +0100 Subject: [PATCH] Fixed CI errors --- .github/workflows/c-cpp.yml | 8 ++++---- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/msvc-analysis.yml | 2 +- .github/workflows/test-sync.yml | 14 +++++++------- CMakeLists.txt | 4 ++++ cmake/grpc.cmake | 2 ++ src/merge_mining_client.cpp | 8 +++++++- tests/CMakeLists.txt | 1 - 8 files changed, 26 insertions(+), 15 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index 904f83c..ff3faec 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -12,7 +12,7 @@ on: jobs: build-alpine-static: - timeout-minutes: 75 + timeout-minutes: 120 runs-on: ubuntu-22.04 strategy: @@ -243,7 +243,7 @@ jobs: build-ubuntu-aarch64: - timeout-minutes: 15 + timeout-minutes: 60 runs-on: ${{ matrix.config.os }} strategy: @@ -466,7 +466,7 @@ jobs: build-macos: - timeout-minutes: 20 + timeout-minutes: 60 runs-on: macos-11 steps: @@ -532,7 +532,7 @@ jobs: build-macos-aarch64: - timeout-minutes: 20 + timeout-minutes: 60 runs-on: macos-11 steps: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index fa12f8f..3952497 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -26,7 +26,7 @@ on: jobs: analyze: name: Analyze - timeout-minutes: 30 + timeout-minutes: 60 runs-on: ubuntu-latest permissions: actions: read diff --git a/.github/workflows/msvc-analysis.yml b/.github/workflows/msvc-analysis.yml index 2666b37..abe4746 100644 --- a/.github/workflows/msvc-analysis.yml +++ b/.github/workflows/msvc-analysis.yml @@ -28,7 +28,7 @@ env: jobs: analyze: name: Analyze - timeout-minutes: 30 + timeout-minutes: 60 runs-on: windows-latest steps: diff --git a/.github/workflows/test-sync.yml b/.github/workflows/test-sync.yml index 70dba14..d269a88 100644 --- a/.github/workflows/test-sync.yml +++ b/.github/workflows/test-sync.yml @@ -12,7 +12,7 @@ on: jobs: sync-test-ubuntu-tsan: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: ubuntu-22.04 steps: @@ -83,7 +83,7 @@ jobs: build/data/ sync-test-ubuntu-msan: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: ubuntu-22.04 steps: @@ -172,7 +172,7 @@ jobs: sync-test-ubuntu-ubsan: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: ubuntu-22.04 steps: @@ -221,7 +221,7 @@ jobs: sync-test-ubuntu-asan: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: ubuntu-22.04 steps: @@ -270,7 +270,7 @@ jobs: sync-test-macos: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: macos-11 steps: @@ -341,7 +341,7 @@ jobs: sync-test-windows-debug-asan: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: windows-2022 steps: @@ -389,7 +389,7 @@ jobs: sync-test-windows-leaks: - timeout-minutes: 30 + timeout-minutes: 60 runs-on: windows-2022 steps: diff --git a/CMakeLists.txt b/CMakeLists.txt index f802e82..bc2ddb6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,10 @@ option(DEV_TRACK_MEMORY "[Developer only] Track memory allocations" OFF) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool) +if (CMAKE_CXX_COMPILER_ID MATCHES MSVC) + set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0) +endif() + include(cmake/grpc.cmake) add_subdirectory(external/src/Tari) diff --git a/cmake/grpc.cmake b/cmake/grpc.cmake index 3158ca1..7483acd 100644 --- a/cmake/grpc.cmake +++ b/cmake/grpc.cmake @@ -29,6 +29,8 @@ if (CMAKE_CXX_COMPILER_ID MATCHES MSVC) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT /GL") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT /GL") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT") else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w") diff --git a/src/merge_mining_client.cpp b/src/merge_mining_client.cpp index 771ff3e..e100e47 100644 --- a/src/merge_mining_client.cpp +++ b/src/merge_mining_client.cpp @@ -18,17 +18,23 @@ #include "common.h" #include "merge_mining_client.h" #include "merge_mining_client_json_rpc.h" + +#ifndef P2POOL_UNIT_TESTS #include "merge_mining_client_tari.h" +#endif namespace p2pool { IMergeMiningClient* IMergeMiningClient::create(p2pool* pool, const std::string& host, const std::string& wallet) noexcept { try { +#ifndef P2POOL_UNIT_TESTS if (host.find(MergeMiningClientTari::TARI_PREFIX) == 0) { return new MergeMiningClientTari(pool, host, wallet); } - else { + else +#endif + { return new MergeMiningClientJSON_RPC(pool, host, wallet); } } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8342cd7..dc863a2 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -57,7 +57,6 @@ set(SOURCES ../src/mempool.cpp ../src/merge_mining_client.cpp ../src/merge_mining_client_json_rpc.cpp - ../src/merge_mining_client_tari.cpp ../src/merkle.cpp ../src/miner.cpp ../src/p2p_server.cpp