From 6ba505cf2c1752d8ea5abb21427e23ff89dc486f Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Fri, 28 Jan 2022 20:30:49 +0100 Subject: [PATCH] [vcpkg] collect error logs in logs.txt in the buildtrees folder (#22146) * collect error logs in logs.txt in the buildtrees folder * Use global variable * rename file to error-logs-.txt and remove error: prefix in file --- scripts/cmake/vcpkg_execute_build_process.cmake | 1 + scripts/cmake/vcpkg_execute_required_process.cmake | 1 + scripts/ports.cmake | 3 +++ 3 files changed, 5 insertions(+) diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake index bd34a252f9..921196cc28 100644 --- a/scripts/cmake/vcpkg_execute_build_process.cmake +++ b/scripts/cmake/vcpkg_execute_build_process.cmake @@ -151,6 +151,7 @@ function(vcpkg_execute_build_process) if(NOT log_size EQUAL "0") file(TO_NATIVE_PATH "${log}" native_log) string(APPEND stringified_logs " ${native_log}\n") + file(APPEND "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}" "${native_log}\n") endif() endforeach() z_vcpkg_prettify_command_line(pretty_command ${arg_COMMAND}) diff --git a/scripts/cmake/vcpkg_execute_required_process.cmake b/scripts/cmake/vcpkg_execute_required_process.cmake index 27024fecfc..cc18c41025 100644 --- a/scripts/cmake/vcpkg_execute_required_process.cmake +++ b/scripts/cmake/vcpkg_execute_required_process.cmake @@ -120,6 +120,7 @@ Halting portfile execution. if(NOT log_size EQUAL "0") file(TO_NATIVE_PATH "${log}" native_log) string(APPEND stringified_logs " ${native_log}\n") + file(APPEND "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}" "${native_log}\n") endif() endforeach() diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 7cc7afcb96..4d11521b4f 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -139,6 +139,9 @@ if(CMD MATCHES "^BUILD$") set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}") include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake") + set(Z_VCPKG_ERROR_LOG_COLLECTION_FILE "${CURRENT_BUILDTREES_DIR}/error-logs-${TARGET_TRIPLET}.txt") + file(REMOVE "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}") + include("${CURRENT_PORT_DIR}/portfile.cmake") if(DEFINED PORT) include("${SCRIPTS}/build_info.cmake")