From 6e5f33af581e0a74897a6cc9fad558b29ad8b88e Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:38:14 +0100 Subject: [PATCH 1/2] ci: Handle log files regardless of CMake's version --- ci/test/03_test_script.sh | 2 +- ci/test/GetCMakeLogFiles.cmake | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ci/test/GetCMakeLogFiles.cmake diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index eebdfbc9e5c..0fbd7dbfaa2 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -121,7 +121,7 @@ if [[ "${RUN_TIDY}" == "true" ]]; then BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" fi -bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log) && false)" +bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat $(cmake -P "${BASE_ROOT_DIR}/ci/test/GetCMakeLogFiles.cmake")) && false)" bash -c "make $MAKEJOBS all $GOAL" || ( echo "Build failure. Verbose build follows." && make all "$GOAL" V=1 ; false ) diff --git a/ci/test/GetCMakeLogFiles.cmake b/ci/test/GetCMakeLogFiles.cmake new file mode 100644 index 00000000000..80f71dcf635 --- /dev/null +++ b/ci/test/GetCMakeLogFiles.cmake @@ -0,0 +1,11 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.26) + set(log_files "CMakeFiles/CMakeConfigureLog.yaml") +else() + set(log_files "CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log") +endif() + +execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${log_files}) From c45186ca548362b75a6640393ccf79b11ff727da Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 7 Sep 2024 14:28:28 +0100 Subject: [PATCH 2/2] ci: Switch from `make` to `cmake --build` --- ci/test/03_test_script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 0fbd7dbfaa2..7ee424ac9bb 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -123,7 +123,7 @@ fi bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat $(cmake -P "${BASE_ROOT_DIR}/ci/test/GetCMakeLogFiles.cmake")) && false)" -bash -c "make $MAKEJOBS all $GOAL" || ( echo "Build failure. Verbose build follows." && make all "$GOAL" V=1 ; false ) +bash -c "cmake --build . $MAKEJOBS --target all $GOAL" || ( echo "Build failure. Verbose build follows." && cmake --build . --target all "$GOAL" --verbose ; false ) bash -c "${PRINT_CCACHE_STATISTICS}" du -sh "${DEPENDS_DIR}"/*/