Removed unused code from tests, tweaked build scripts

This commit is contained in:
SChernykh
2025-07-26 12:17:04 +02:00
parent f7c1baa453
commit 240cbd100e
14 changed files with 43 additions and 53 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ on:
jobs:
build-alpine-static:
timeout-minutes: 60
timeout-minutes: 90
runs-on: ubuntu-latest
strategy:
+13 -9
View File
@@ -11,12 +11,16 @@ if [ $? -ne 0 ]; then
images/ubuntu/build.sh
fi
gnome-terminal --tab -- freebsd_aarch64/build.sh $1
gnome-terminal --tab -- freebsd_x64/build.sh $1
gnome-terminal --tab -- linux_aarch64/build.sh $1
gnome-terminal --tab -- linux_riscv64/build.sh $1
gnome-terminal --tab -- linux_x64/build.sh $1
gnome-terminal --tab -- windows_x64/build.sh $1
gnome-terminal --tab -- macos_aarch64/build.sh $1
gnome-terminal --tab -- macos_x64/build.sh $1
gnome-terminal --tab -- source/build.sh $1
N=$(($(nproc)-1))
N1=$(($N/2))
N2=$(($N1+1))
gnome-terminal --tab -- freebsd_aarch64/build.sh $1 0-$N1
gnome-terminal --tab -- freebsd_x64/build.sh $1 $N2-$N
gnome-terminal --tab -- linux_aarch64/build.sh $1 0-$N1
gnome-terminal --tab -- linux_riscv64/build.sh $1 $N2-$N
gnome-terminal --tab -- linux_x64/build.sh $1 0-$N1
gnome-terminal --tab -- windows_x64/build.sh $1 $N2-$N
gnome-terminal --tab -- macos_aarch64/build.sh $1 0-$N1
gnome-terminal --tab -- macos_x64/build.sh $1 $N2-$N
gnome-terminal --tab -- source/build.sh $1 0-$N1
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_aarch64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_aarch64_build_$1 .
docker create --name p2pool_freebsd_aarch64_build_$1_container p2pool_freebsd_aarch64_build_$1:latest
docker cp p2pool_freebsd_aarch64_build_$1_container:/p2pool/build/p2pool-$1-freebsd-aarch64.tar.gz ../p2pool-$1-freebsd-aarch64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_x64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_x64_build_$1 .
docker create --name p2pool_freebsd_x64_build_$1_container p2pool_freebsd_x64_build_$1:latest
docker cp p2pool_freebsd_x64_build_$1_container:/p2pool/build/p2pool-$1-freebsd-x64.tar.gz ../p2pool-$1-freebsd-x64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_aarch64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_aarch64_build_$1 .
docker create --name p2pool_ubuntu_aarch64_build_$1_container p2pool_ubuntu_aarch64_build_$1:latest
docker cp p2pool_ubuntu_aarch64_build_$1_container:/p2pool/build/p2pool-$1-linux-aarch64.tar.gz ../p2pool-$1-linux-aarch64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_riscv64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_riscv64_build_$1 .
docker create --name p2pool_ubuntu_riscv64_build_$1_container p2pool_ubuntu_riscv64_build_$1:latest
docker cp p2pool_ubuntu_riscv64_build_$1_container:/p2pool/build/p2pool-$1-linux-riscv64.tar.gz ../p2pool-$1-linux-riscv64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_linux_x64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_linux_x64_build_$1 .
docker create --name p2pool_linux_x64_build_$1_container p2pool_linux_x64_build_$1:latest
docker cp p2pool_linux_x64_build_$1_container:/p2pool/build/p2pool-$1-linux-x64.tar.gz ../p2pool-$1-linux-x64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_macos_aarch64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_macos_aarch64_build_$1 .
docker create --name p2pool_macos_aarch64_build_$1_container p2pool_macos_aarch64_build_$1:latest
docker cp p2pool_macos_aarch64_build_$1_container:/p2pool/build/p2pool-$1-macos-aarch64.tar.gz ../p2pool-$1-macos-aarch64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_macos_x64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_macos_x64_build_$1 .
docker create --name p2pool_macos_x64_build_$1_container p2pool_macos_x64_build_$1:latest
docker cp p2pool_macos_x64_build_$1_container:/p2pool/build/p2pool-$1-macos-x64.tar.gz ../p2pool-$1-macos-x64.tar.gz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_source_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_source_build_$1 .
docker create --name p2pool_source_build_$1_container p2pool_source_build_$1:latest
docker cp p2pool_source_build_$1_container:/p2pool_source-$1.tar.xz ../p2pool_source-$1.tar.xz
+1 -1
View File
@@ -4,7 +4,7 @@
cd "$(dirname "$0")"
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_windows_x64_build_$1 .
docker build --cpuset-cpus $2 --build-arg P2POOL_VERSION=$1 -t p2pool_windows_x64_build_$1 .
docker create --name p2pool_windows_x64_build_$1_container p2pool_windows_x64_build_$1:latest
docker cp p2pool_windows_x64_build_$1_container:/p2pool/build/p2pool-$1-windows-x64.zip ../p2pool-$1-windows-x64.zip
+7
View File
@@ -40,7 +40,10 @@
#include <resolv.h>
#endif
#ifndef P2POOL_UNIT_TESTS
#include <curl/curl.h>
#endif
#include <zmq.h>
#ifdef HAVE_GLIBC
@@ -75,7 +78,9 @@ const char* VERSION = "v" STR2(P2POOL_VERSION_MAJOR) "." STR2(P2POOL_VERSION_MIN
std::string p2pool_version()
{
#ifndef P2POOL_UNIT_TESTS
const curl_version_info_data* curl_version_data = curl_version_info(CURLVERSION_NOW);
#endif
int zmq_major, zmq_minor, zmq_patch;
zmq_version(&zmq_major, &zmq_minor, &zmq_patch);
@@ -91,7 +96,9 @@ std::string p2pool_version()
#ifdef WITH_GRPC
<< " - grpc " << GRPC_CPP_VERSION_STRING << '\n'
#endif
#ifndef P2POOL_UNIT_TESTS
<< " - libcurl " << (curl_version_data ? curl_version_data->version : "unknown") << '\n'
#endif
<< " - libuv " << uv_version_string() << '\n'
<< " - libzmq " << zmq_major << '.' << zmq_minor << '.' << zmq_patch << '\n'
#ifdef WITH_UPNP
+1 -34
View File
@@ -36,11 +36,6 @@ else()
endif()
add_definitions(-DWITH_RANDOMX)
add_subdirectory(cmake/ssl)
include_directories(../external/src/grpc/third_party/boringssl-with-bazel/src/include)
add_definitions(-DWITH_TLS)
add_definitions(-DWITH_MERGE_MINING_DONATION)
add_definitions(-DP2POOL_UNIT_TESTS)
@@ -72,13 +67,10 @@ set(SOURCES
../src/block_template.cpp
../src/console_commands.cpp
../src/crypto.cpp
../src/json_rpc_request.cpp
../src/keccak.cpp
../src/log.cpp
../src/memory_leak_debug.cpp
../src/mempool.cpp
../src/merge_mining_client.cpp
../src/merge_mining_client_json_rpc.cpp
../src/merkle.cpp
../src/miner.cpp
../src/p2p_server.cpp
@@ -90,7 +82,6 @@ set(SOURCES
../src/side_chain.cpp
../src/stratum_server.cpp
../src/tcp_server.cpp
../src/tls.cpp
../src/util.cpp
../src/wallet.cpp
../src/zmq_reader.cpp
@@ -103,16 +94,6 @@ if (AMD64)
endif()
endif()
if (NOT ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS))
include(FindCURL)
endif()
if (CURL_INCLUDE_DIRS)
include_directories(${CURL_INCLUDE_DIRS})
else()
include_directories(../external/src/curl/include)
endif()
if ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS)
set(UV_INCLUDE_DIR ../external/src/libuv/include)
set(ZMQ_INCLUDE_DIR ../external/src/libzmq/include)
@@ -140,7 +121,6 @@ if (WIN32)
if ((CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
set(LIBS ${LIBS} bcrypt)
endif()
add_definitions(-DCURL_STATICLIB)
elseif (NOT APPLE)
set(LIBS ${LIBS} pthread)
endif()
@@ -150,24 +130,13 @@ if (STATIC_LIBS)
set(ZMQ_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/../external/src/libzmq/build/lib/libzmq.a")
set(UV_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/../external/src/libuv/build/libuv.a")
set(UV_LIBRARY "${CMAKE_SOURCE_DIR}/../external/src/libuv/build/libuv.a")
set(CURL_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/../external/src/curl/lib/.libs/libcurl.a")
set(CURL_LIBRARY "${CMAKE_SOURCE_DIR}/../external/src/curl/lib/.libs/libcurl.a")
else()
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
find_library(CURL_LIBRARY_DEBUG NAMES libcurl-d PATHS "../external/lib/libcurl_tls/Debug")
find_library(CURL_LIBRARY NAMES libcurl PATHS "../external/lib/libcurl_tls/Release")
elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
find_library(ZMQ_LIBRARY_DEBUG NAMES zmq libzmq.a)
find_library(ZMQ_LIBRARY NAMES zmq libzmq.a)
find_library(UV_LIBRARY_DEBUG NAMES uv libuv.a)
find_library(UV_LIBRARY NAMES uv libuv.a)
if (WIN32)
find_library(CURL_LIBRARY_DEBUG NAMES libcurl.a PATHS "../external/src/curl/lib/.libs" NO_DEFAULT_PATH)
find_library(CURL_LIBRARY NAMES libcurl.a PATHS "../external/src/curl/lib/.libs" NO_DEFAULT_PATH)
else()
find_library(CURL_LIBRARY_DEBUG NAMES curl)
find_library(CURL_LIBRARY NAMES curl)
endif()
find_library(SODIUM_LIBRARY sodium)
endif()
@@ -194,8 +163,6 @@ if(APPLE)
set(LIBS ${LIBS} ${FOUNDATION_LIB} ${CORE_FOUNDATION_LIB} ${SYSTEM_CONFIGURATION_LIB})
endif()
set(LIBS ${LIBS} ssl crypto)
add_definitions(/DZMQ_STATIC /DP2POOL_LOG_DISABLE)
include(CheckCXXSourceCompiles)
@@ -214,7 +181,7 @@ endif()
add_definitions("-DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag")
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} debug ${CURL_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} optimized ${CURL_LIBRARY} ${LIBS})
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} ${LIBS})
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/crypto_tests.txt" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/block.dat" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/sidechain_dump.dat.xz" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
+12
View File
@@ -18,11 +18,23 @@
#include "common.h"
#include "util.h"
#include "pool_block.h"
#include "json_rpc_request.h"
#include "merge_mining_client.h"
#include "gtest/gtest.h"
void p2pool_usage() {}
namespace p2pool {
IMergeMiningClient* IMergeMiningClient::create(p2pool*, const std::string&, const std::string&) noexcept { return nullptr; }
namespace JSONRPCRequest {
void Call(const std::string&, int, const std::string&, const std::string&, const std::string&, bool, const std::string&, CallbackBase*, CallbackBase*, uv_loop_t*) {}
}
}
using namespace p2pool;
int main(int argc, char** argv)