cmake: add CTestConfig.cmake #35222

pull willcl-ark wants to merge 1 commits into bitcoin:master from willcl-ark:ctest-config changing 1 files +1 −0
  1. willcl-ark commented at 12:01 PM on May 6, 2026: member

    Add a CTestConfig.cmake file with the CDash submission URL for Bitcoin Core at the project root.

    This lets developers use CTest’s built-in dashboard support to upload local configure, build, and test results to CDash. With this a developer can use their own CTest dashboard script or manual ctest workflow and upload results to a collection point.

    This is useful for sharing reproducible build/test results from local machines, CI experiments, and platform-specific debugging. CDash keeps the configure output, build warnings/errors, and test results grouped under a single dashboard submission, making it easier to inspect failures and compare behavior across environments.

    The file only defines the CDash upload location. It does not change the default build or test behavior.

    WARNING uploaded test results may also include (potentially) identifiable information, such as hostnames, usernames, especially if you attach notes which are located within you rhome directory, as the full file path is printed.

  2. DrahtBot added the label Build system on May 6, 2026
  3. DrahtBot commented at 12:01 PM on May 6, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35222.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK purpleKarrot, maflcko, hebasto

    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.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. willcl-ark commented at 12:02 PM on May 6, 2026: member

    The dashboard is visible here, with a few test builds of mine: https://my.cdash.org/index.php?project=bitcoin-core

  5. willcl-ark commented at 12:02 PM on May 6, 2026: member
  6. cmake: add CTestConfig.cmake
    Add a `CTestConfig.cmake` file with the CDash submission URL for Bitcoin
    Core.
    
    This lets developers use CTest’s built-in dashboard support to upload
    local configure, build, and test results to CDash. With this a developer
    can use their own CTest dashboard script or manual `ctest` workflow and
    upload results to a collection point.
    
    This is useful for sharing reproducible build/test results from local
    machines, CI experiments, and platform-specific debugging. CDash keeps
    the configure output, build warnings/errors, and test results grouped
    under a single dashboard submission, making it easier to inspect
    failures and compare behavior across environments.
    
    The file only defines the CDash upload location. It does not change the
    default build or test behavior.
    086894098e
  7. willcl-ark force-pushed on May 6, 2026
  8. DrahtBot added the label CI failed on May 6, 2026
  9. maflcko commented at 12:25 PM on May 6, 2026: member

    Could make sense to add an example command on how to use/test this? I presume it is not enabled by default?

  10. purpleKarrot commented at 12:26 PM on May 6, 2026: contributor

    ACK 086894098ecc40172abd15244803c426efda1d19

    Thanks!

  11. willcl-ark commented at 12:55 PM on May 6, 2026: member

    Could make sense to add an example command on how to use/test this? I presume it is not enabled by default?

    Good idea! If you create a file ./cmake/script/CDash.cmake with the following content:

    get_filename_component(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE)
    set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/build-cdash")
    file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
    
    if(NOT DEFINED CTEST_CMAKE_GENERATOR)
      set(CTEST_CMAKE_GENERATOR "Ninja")
    endif()
    
    site_name(CTEST_SITE)
    set(CTEST_BUILD_NAME "default")
    include(ProcessorCount)
    ProcessorCount(processor_count)
    
    ctest_start(Experimental)
    ctest_configure(RETURN_VALUE configure_result)
    ctest_build(RETURN_VALUE build_result)
    ctest_test(PARALLEL_LEVEL ${processor_count} RETURN_VALUE test_result)
    ctest_submit(RETURN_VALUE submit_result)
    
    if(configure_result OR build_result OR test_result OR submit_result)
      message(FATAL_ERROR "CDash run failed.")
    endif()
    

    And run ctest -S cmake/scripts/CDash.cmake then it will configure, build and run unit tests, followed by uploading to the dashboard.

  12. DrahtBot removed the label CI failed on May 6, 2026
  13. maflcko commented at 1:59 PM on May 6, 2026: member

    Thx, I used that and disabled a build option, because capnp seemed broken on OpenSuse 16?

    <details><summary>opensuse 16 capnp error?</summary>

    -- Configuring done (0.5s)
    -- Generating done (0.1s)
    -- Build files have been written to: /root/b-c/build-cdash
    Command exited with the value: 0
    SetCTestConfiguration:BuildDirectory:/root/b-c/build-cdash
    SetCTestConfiguration:SourceDirectory:/root/b-c
    SetMakeCommand:/usr/bin/cmake --build . --config "Release"
    SetCTestConfiguration:MakeCommand:/usr/bin/cmake --build . --config "Release"
    Build project
    MakeCommand:/usr/bin/cmake --build . --config "Release"
    Run command: "/usr/bin/cmake" "--build" "." "--config" "Release"
    [1/589] Compiling Cap'n Proto schema include/mp/proxy.capnp
    FAILED: src/ipc/libmultiprocess/include/mp/proxy.capnp.c++ src/ipc/libmultiprocess/include/mp/proxy.capnp.h /root/b-c/build-cdash/src/ipc/libmultiprocess/include/mp/proxy.capnp.c++ /root/b-c/build-cdash/src/ipc/libmultiprocess/include/mp/proxy.capnp.h 
    cd /root/b-c/build-cdash/src/ipc/libmultiprocess && //bin/capnp compile -o //bin/capnpc-c++:/root/b-c/build-cdash/src/ipc/libmultiprocess --src-prefix /root/b-c/src/ipc/libmultiprocess -I /root/b-c/src/ipc/libmultiprocess -I /lib64/cmake/CapnProto/../../../include /root/b-c/src/ipc/libmultiprocess/include/mp/proxy.capnp
    //bin/capnp compile: -I /lib64/cmake/CapnProto/../../../include: no such directory
    Try '//bin/capnp compile --help' for more information.
    

    </details>

    ctest_configure(
      OPTIONS "-DENABLE_IPC=OFF" 
      RETURN_VALUE configure_result
    )
    

    lgtm ACK 086894098ecc40172abd15244803c426efda1d19

  14. maflcko commented at 7:02 AM on May 7, 2026: member

    Two more questions:

    • It doesn't say the commit id anywhere? E.g. looking at https://my.cdash.org/builds/3525250. Maybe it would be helpful to have that?
    • The "Create GitHub issue for this build" doesn't work choosetitle should be ?title= in the url?
  15. fanquake commented at 7:52 AM on May 7, 2026: member

    Maybe also worth nothing (even just in the PR description) that uploaded test results will also include (potentially) identifiable information, such as hostnames, usernames etc.

  16. hebasto approved
  17. hebasto commented at 12:20 PM on May 7, 2026: member

    ACK 086894098ecc40172abd15244803c426efda1d19.

  18. hebasto merged this on May 7, 2026
  19. hebasto closed this on May 7, 2026

  20. willcl-ark deleted the branch on May 7, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-11 12:12 UTC

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