cmake -P $buildDir/Coverage.cmake: Test execution for coverage fails. Wrapper resource “cov_tool_wrapper.sh.in” missing from build cache folder. #31638

issue jimhashhq openend this issue on January 10, 2025
  1. jimhashhq commented at 10:43 pm on January 10, 2025: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    When following Compiling for Test Coverage instructions: doc/developer-notes-CompilingForTestCoverage

    I encounter error:

    0CMake Error: File /home/alicebob/wkspc1/presets/bitcoin/cmake/cov_tool_wrapper.sh.in does not exist.
    1CMake Error at /home/alicebob/wkspc1/build/bitcoin/CoverageInclude.cmake:14 (configure_file):
    2  configure_file Problem configuring file
    3Call Stack (most recent call first):
    4  /home/alicebob/wkspc1/build/bitcoin/Coverage.cmake:5 (include)
    

    Expected behaviour

    Driver for functional tests should run, generating instrumentation report HTML.

    Steps to reproduce

    1. Compile for coverage. Following are sample cmake cache variables for the CLang tool chain:
    0"CMAKE_C_COMPILER": "clang",
    1"CMAKE_CXX_COMPILER": "clang++",
    2"CMAKE_CXX_FLAGS": "-fprofile-arcs -ftest-coverage",
    3"CMAKE_BUILD_TYPE": "Coverage",
    
    1. Follow instructions in developer notes to compile for coverage: doc/developer-notes-CompilingForTestCoverage

    Relevant log output

    CMake Error: File /home/alicebob/wkspc1/presets/bitcoin/cmake/cov_tool_wrapper.sh.in does not exist.
    CMake Error at /home/alicebob/wkspc1/build/bitcoin/CoverageInclude.cmake:14 (configure_file):
      configure_file Problem configuring file
    Call Stack (most recent call first):
      /home/alicebob/wkspc1/build/bitcoin/Coverage.cmake:5 (include)
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v28.99.0-37e49c2c7ca5

    Operating system and version

    Ubuntu 24.04.1 LTS

    Machine specifications

    Unix/Intel

  2. hebasto added the label Build system on Jan 11, 2025
  3. Andrewsr84 commented at 11:43 am on January 12, 2025: none
    Thank for the help
  4. hebasto commented at 9:31 am on January 20, 2025: member

    Current behaviour

    When following Compiling for Test Coverage instructions: doc/developer-notes-CompilingForTestCoverage

    I encounter error:

    0CMake Error: File /home/alicebob/wkspc1/presets/bitcoin/cmake/cov_tool_wrapper.sh.in does not exist.
    1CMake Error at /home/alicebob/wkspc1/build/bitcoin/CoverageInclude.cmake:14 (configure_file):
    2  configure_file Problem configuring file
    3Call Stack (most recent call first):
    4  /home/alicebob/wkspc1/build/bitcoin/Coverage.cmake:5 (include)
    

    I cannot reproduce this error on Ubuntu 24.10. UPD. See #31638 (comment). @jimhashhq

    Could you provide the exact command-line steps required to reproduce the issue?

    if you are using an IDE, please provide more details about the IDE, its configuration, and the steps you followed to encounter this problem.

    What version of CMake are you using?

  5. maflcko commented at 8:19 am on January 22, 2025: member

    I am not sure if clang coverage works out of the box right now with "CMAKE_BUILD_TYPE": "Coverage",.

    You’ll have to use the “normal” build type and manually pass all required flags to clang, or patch the cmakelists txt.

    Duplicate of #31047?

  6. hebasto commented at 9:41 am on January 23, 2025: member

    I encounter error:

    0CMake Error: File /home/alicebob/wkspc1/presets/bitcoin/cmake/cov_tool_wrapper.sh.in does not exist.
    1CMake Error at /home/alicebob/wkspc1/build/bitcoin/CoverageInclude.cmake:14 (configure_file):
    2  configure_file Problem configuring file
    3Call Stack (most recent call first):
    4  /home/alicebob/wkspc1/build/bitcoin/Coverage.cmake:5 (include)
    

    The error is reproducible when invoking cmake -P <path-to>/Coverage.cmake from a directory other than the repository root.

    In the following code:https://github.com/bitcoin/bitcoin/blob/5acf12bafeb126f2190b3f401f95199e0eea90c9/cmake/script/CoverageInclude.cmake.in#L14-L20 cmake/cov_tool_wrapper.sh.in is a relative path and resolved based on the current working directory. That happens to work when following the Developer Notes literally.

    I’ll submit a fix shortly.

  7. hebasto added this to the milestone 29.0 on Jan 23, 2025
  8. hebasto commented at 10:56 am on January 23, 2025: member

    I’ll submit a fix shortly.

    https://github.com/bitcoin/bitcoin/pull/31722

  9. jimhashhq renamed this:
    cmake: Compiling for test coverage (low-priority workaround exists)
    cmake -P $buildDir/Coverage.cmake: Test execution for coverage fails. Wrapper resource "cov_tool_wrapper.sh.in" missing from build cache folder.
    on Jan 23, 2025
  10. fanquake closed this on Feb 13, 2025

  11. fanquake referenced this in commit 55cf39e4c5 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