-
Notifications
You must be signed in to change notification settings - Fork 55
ci: add cmake debug output #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 $?" | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The second
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re: #352 (comment)
I think there are tradeoffs. I'd presume more likely than not if if results were cached they were probably successful results, so the current change lets the script be faster and simpler and show strictly more information than it did previously. It could be a good idea to delete the cache or build directory though, and I'd happy review if someone wanted to implement this followup.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. re: #352 (comment)
Decided not to implement a change here because erasing CMakeCache.txt could make failures harder to debug locally and would not be respecting the |
||||||||||||||
| if ver_ge "$cmake_ver" "3.26"; then cat CMakeFiles/CMakeConfigureLog.yaml || true; fi | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| find . -ls || true | ||||||||||||||
| false | ||||||||||||||
| fi | ||||||||||||||
| if ver_ge "$cmake_ver" "3.15"; then | ||||||||||||||
| cmake --build . -t "${BUILD_TARGETS[@]}" -- "${BUILD_ARGS[@]+"${BUILD_ARGS[@]}"}" | ||||||||||||||
| else | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I know this is duplicate, but this way non-Bash people won't have to confirm this works:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: #352 (comment)
From my perspective, the suggested change makes output more verbose, and I don't know what problem it would be solving. I'd definitely change this if it looked misleading, but it seems pretty obvious this is trying to show an error message. I also don't know why someone who didn't know bash would worry about this. It should take only few seconds to look up how this works if anyone is worried.