ci: add cmake debug output #352

pull ryanofsky wants to merge 1 commits into bitcoin-core:master from ryanofsky:pr/cmake-debug changing 1 files +10 −1
  1. ryanofsky commented at 8:34 PM on August 20, 2026: collaborator

    Show detailed debug information if cmake fails in CI

  2. ci: add cmake debug output 6d719cf7cc
  3. DrahtBot commented at 8:34 PM on August 20, 2026: none

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK maflcko, ViniciusCestarii

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #353 (ci: add cmake --parallel build option by ryanofsky)
    • #212 (ci: add newdeps job testing newer versions of cmake and capnproto by ryanofsky)
    • #209 (cmake: Increase cmake policy version by ryanofsky)
    • #175 (Set cmake_minimum_required(VERSION 3.22) by maflcko)

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. in ci/scripts/ci.sh:33 in 6d719cf7cc
      29 | +cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}")
      30 | +if ! cmake "$src_dir" "${cmake_args[@]}"; then
      31 | +  # If cmake failed, try it again with debug options.
      32 | +  # Could add --trace / --trace-expand here too but they are very verbose.
      33 | +  cmake_args+=(--debug-find --debug-output --debug-trycompile --log-level=DEBUG)
      34 | +  cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?"
    


    maflcko commented at 6:35 AM on August 21, 2026:
      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
    

    hebasto commented at 12:12 PM on August 23, 2026:

    The second cmake invocation is reusing CMakeCache.txt, skipping the checks whose results are cached. Is this the desired behaviour?


    ryanofsky commented at 2:54 AM on August 26, 2026:

    re: #352 (review)

    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.


    ryanofsky commented at 3:02 AM on August 26, 2026:

    re: #352 (review)

    The second cmake invocation is reusing CMakeCache.txt, skipping the checks whose results are cached. Is this the desired behaviour?

    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.

  5. maflcko commented at 6:35 AM on August 21, 2026: contributor

    lgtm ACK 6d719cf7ccb1cd6d958898cc11db528a334b9d39

  6. in ci/scripts/ci.sh:32 in 6d719cf7cc
      24 | @@ -25,7 +25,16 @@ src_dir=$PWD
      25 |  mkdir -p "$CI_DIR"
      26 |  cd "$CI_DIR"
      27 |  export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
      28 | -cmake "$src_dir" "${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}"
      29 | +cmake_args=("${CMAKE_ARGS[@]+"${CMAKE_ARGS[@]}"}")
      30 | +if ! cmake "$src_dir" "${cmake_args[@]}"; then
      31 | +  # If cmake failed, try it again with debug options.
      32 | +  # Could add --trace / --trace-expand here too but they are very verbose.
      33 | +  cmake_args+=(--debug-find --debug-output --debug-trycompile --log-level=DEBUG)
    


    ViniciusCestarii commented at 1:21 PM on August 21, 2026:

    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


    ryanofsky commented at 2:58 AM on August 26, 2026:

    re: https://github.com/bitcoin-core/libmultiprocess/pull/352/changes#r3830510005

    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.

    Agree these would be nice changes and I'd be happy to review a followup adding them.

  7. ViniciusCestarii commented at 1:26 PM on August 21, 2026: contributor

    ACK 6d719cf7ccb1cd6d958898cc11db528a334b9d39

    Looks good, just added a comment about cmake support for the flags used.

  8. in ci/scripts/ci.sh:34 in 6d719cf7cc
      30 | +if ! cmake "$src_dir" "${cmake_args[@]}"; then
      31 | +  # If cmake failed, try it again with debug options.
      32 | +  # Could add --trace / --trace-expand here too but they are very verbose.
      33 | +  cmake_args+=(--debug-find --debug-output --debug-trycompile --log-level=DEBUG)
      34 | +  cmake "$src_dir" "${cmake_args[@]}" || : "cmake exited with $?"
      35 | +  cat CMakeFiles/CMakeConfigureLog.yaml || true
    


    hebasto commented at 12:04 PM on August 23, 2026:

    The CMakeFiles/CMakeConfigureLog.yaml is available only in CMake >=3.26.


    ryanofsky commented at 2:57 AM on August 26, 2026:

    re: #352 (review)

    The CMakeFiles/CMakeConfigureLog.yaml is available only in CMake >=3.26.

    Thanks, this good to know. The || true should let the script continue if the file isn't created for any other reason as well. But it could be a good idea to add a ver_ge check like the ones ViniciusCestarii suggested above

  9. ryanofsky commented at 3:42 AM on August 26, 2026: collaborator

    Thanks for the reviews! Looks like this conflicted with #212 so I'll make all the suggested changes above in the rebase.

  10. DrahtBot added the label Needs rebase on Aug 26, 2026
  11. DrahtBot commented at 4:50 AM on August 26, 2026: none

    <!--cf906140f33d8803c4a75a2196329ecb-->

    🐙 This pull request conflicts with the target branch and needs rebase.


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-08-26 11:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me