From fbd50d2f5dd2ed5311ba457ea9de57322da9b0b2 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Wed, 10 Sep 2025 07:06:21 -0400 Subject: [PATCH] ci: add cmake debug output Co-Authored-By: ViniciusCestarii <124843824+ViniciusCestarii@users.noreply.github.com> Co-Authored-By: hebasto <32963518+hebasto@users.noreply.github.com> Co-Authored-By: Claude Sonnet 4.6 --- ci/scripts/ci.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/scripts/ci.sh b/ci/scripts/ci.sh index b4bd8fb4..a466ab02 100755 --- a/ci/scripts/ci.sh +++ b/ci/scripts/ci.sh @@ -42,7 +42,18 @@ mkdir -p "$CI_DIR" cd "$CI_DIR" export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)" git --no-pager log -1 || true -cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}" +cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}") +if ! cmake "$src_dir" "${cmake_args[@]}"; then + # If cmake failed, try it again with debug options. + # Could add --trace / --trace-expand here too but they are very verbose. + cmake_args+=(--debug-output --debug-trycompile) + if ver_ge "$cmake_ver" "3.16"; then cmake_args+=(--log-level=DEBUG); fi + if ver_ge "$cmake_ver" "3.17"; then cmake_args+=(--debug-find); fi + cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?" + if ver_ge "$cmake_ver" "3.26"; then cat CMakeFiles/CMakeConfigureLog.yaml || true; fi + find . -ls || true + false +fi if ver_ge "$cmake_ver" "3.15"; then cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" else