cmake: Copy cov_tool_wrapper.sh.in to the build tree #31722

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:250123-cmake-cov changing 3 files +2 −1
  1. hebasto commented at 10:51 am on January 23, 2025: member

    This PR ensures that cov_tool_wrapper.sh.in is available when invoking the Coverage.cmake script from any directory.

    Here is an example of usage on Ubuntu 24.10 with the default GCC 14.2.0:

    0$ cmake -B build -DCMAKE_BUILD_TYPE=Coverage -DCMAKE_CXX_FLAGS="-fprofile-update=atomic" -DCMAKE_C_FLAGS="-fprofile-update=atomic"
    1$ cmake --build build -j $(nproc)
    2$ cd ..
    3$ cmake -DJOBS=$(nproc) -DLCOV_OPTS="--ignore-errors inconsistent,inconsistent" -P bitcoin/build/Coverage.cmake
    

    Fixes #31638.

  2. cmake: Copy `cov_tool_wrapper.sh.in` to the build tree
    This change ensures that `cov_tool_wrapper.sh.in` is available when
    invoking the `Coverage.cmake` script from any directory.
    e3c0152769
  3. DrahtBot commented at 10:51 am on January 23, 2025: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK theuni

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Build system on Jan 23, 2025
  5. hebasto added this to the milestone 29.0 on Jan 23, 2025
  6. jimhashhq approved
  7. jimhashhq commented at 9:46 pm on January 23, 2025: none
    Looks very good to me. Thank you for the fix, and for pointing out & correcting the relative path issue.
  8. hebasto added the label Bug on Feb 3, 2025
  9. in cmake/script/CoverageInclude.cmake.in:15 in e3c0152769
    11@@ -12,7 +12,7 @@ endif()
    12 
    13 # COV_TOOL is used to replace a placeholder.
    14 configure_file(
    15-  cmake/cov_tool_wrapper.sh.in ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh
    16+  ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh.in ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh
    


    theuni commented at 7:02 pm on February 7, 2025:
    Could this not be relative to ${PROJECT_SOURCE_DIR} instead to avoid the two-step copy/process?

    hebasto commented at 9:47 am on February 8, 2025:
    With the current design, the required gcov or llvm-cov tools are searched during the Coverage{Fuzz}.cmake script invocation. This two-step processing could potentially be avoided by moving these tool checks into the main buildsystem script. However, there is no reliable way to gate them depending on whether the build configuration is ‘Coverage’ or not.
  10. theuni approved
  11. theuni commented at 5:42 pm on February 12, 2025: member
    utACK e3c015276962192355e16ca91391b8bc8e188291
  12. fanquake merged this on Feb 13, 2025
  13. fanquake closed this on Feb 13, 2025

  14. hebasto deleted the branch on Feb 13, 2025

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: 2025-02-22 06:12 UTC

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