mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
Save meson logs on failure (#25806)
* [vcpkg_configure_meson] Save log files on error * Document SAVE_LOG_FILES option
This commit is contained in:
parent
56cc138c0a
commit
687f4aab11
@ -13,6 +13,7 @@ vcpkg_execute_required_process(
|
|||||||
[TIMEOUT <seconds>]
|
[TIMEOUT <seconds>]
|
||||||
[OUTPUT_VARIABLE <var>]
|
[OUTPUT_VARIABLE <var>]
|
||||||
[ERROR_VARIABLE <var>]
|
[ERROR_VARIABLE <var>]
|
||||||
|
[SAVE_LOG_FILES <relative-path> [<relative-path>...]]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
## Parameters
|
## Parameters
|
||||||
@ -40,6 +41,14 @@ Optional variable to receive stderr of the command.
|
|||||||
|
|
||||||
This should be a unique name for different triplets so that the logs don't conflict when building multiple at once.
|
This should be a unique name for different triplets so that the logs don't conflict when building multiple at once.
|
||||||
|
|
||||||
|
### SAVE_LOG_FILES
|
||||||
|
|
||||||
|
Optional files to be moved from the working directory to `${CURRENT_BUILDTREES_DIR}`.
|
||||||
|
The files are copied even if the process failed.
|
||||||
|
The target file names are constructed from the `LOGNAME` parameter and the source filename.
|
||||||
|
If the target file name doesn't end in `.log`, this suffix is appended.
|
||||||
|
This helps to collect relevant log files in CI setups.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
* [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake)
|
* [ffmpeg](https://github.com/Microsoft/vcpkg/blob/master/ports/ffmpeg/portfile.cmake)
|
||||||
|
@ -446,21 +446,12 @@ function(vcpkg_configure_meson)
|
|||||||
COMMAND ${MESON} ${arg_OPTIONS} ${arg_OPTIONS_${buildtype}} ${arg_SOURCE_PATH}
|
COMMAND ${MESON} ${arg_OPTIONS} ${arg_OPTIONS_${buildtype}} ${arg_SOURCE_PATH}
|
||||||
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}"
|
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}"
|
||||||
LOGNAME config-${TARGET_TRIPLET}-${suffix_${buildtype}}
|
LOGNAME config-${TARGET_TRIPLET}-${suffix_${buildtype}}
|
||||||
|
SAVE_LOG_FILES
|
||||||
|
meson-logs/meson-log.txt
|
||||||
|
meson-info/intro-dependencies.json
|
||||||
|
meson-logs/install-log.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
#Copy meson log files into buildtree for CI
|
|
||||||
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}/meson-logs/meson-log.txt")
|
|
||||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}/meson-logs/meson-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
|
||||||
file(RENAME "${CURRENT_BUILDTREES_DIR}/meson-log.txt" "${CURRENT_BUILDTREES_DIR}/meson-log-${suffix_${buildtype}}.log")
|
|
||||||
endif()
|
|
||||||
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}/meson-info/intro-dependencies.json")
|
|
||||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}/meson-info/intro-dependencies.json" DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
|
||||||
file(RENAME "${CURRENT_BUILDTREES_DIR}/intro-dependencies.json" "${CURRENT_BUILDTREES_DIR}/intro-dependencies-${suffix_${buildtype}}.log")
|
|
||||||
endif()
|
|
||||||
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}/meson-logs/install-log.txt")
|
|
||||||
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${suffix_${buildtype}}/meson-logs/install-log.txt" DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
|
||||||
file(RENAME "${CURRENT_BUILDTREES_DIR}/install-log.txt" "${CURRENT_BUILDTREES_DIR}/install-log-${suffix_${buildtype}}.log")
|
|
||||||
endif()
|
|
||||||
message(STATUS "Configuring ${TARGET_TRIPLET}-${suffix_${buildtype}} done")
|
message(STATUS "Configuring ${TARGET_TRIPLET}-${suffix_${buildtype}} done")
|
||||||
|
|
||||||
if(NOT arg_NO_PKG_CONFIG)
|
if(NOT arg_NO_PKG_CONFIG)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user