ci: add cmake debug output - #352
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
| # If cmake failed, try it again with debug options. | ||
| # Could add --trace / --trace-expand here too but they are very verbose. | ||
| cmake_args+=(--debug-find --debug-output --debug-trycompile --log-level=DEBUG) | ||
| cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?" |
There was a problem hiding this comment.
| cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?" | |
| cmake "$src_dir" "${cmake_args[@]}" || echo "cmake exited with $?" |
nit: I know this is duplicate, but this way non-Bash people won't have to confirm this works:
# set -o xtrace
false || : "command exited with $?"
set +o xtrace
+ false
+ : 'command exited with 1'
+ set +o xtrace
ViniciusCestarii
left a comment
There was a problem hiding this comment.
ACK 6d719cf
Looks good, just added a comment about cmake support for the flags used.
| 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-find --debug-output --debug-trycompile --log-level=DEBUG) |
There was a problem hiding this comment.
Since this project supports cmake 3.12+ it would be good to guard these flags against a minimum version otherwise the command will just fail for these lower versions.
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
Show detailed debug information if cmake fails in CI