Unable to compile for test coverage on Nixos 24.05 #31087

issue danielabrozzoni openend this issue on October 14, 2024
  1. danielabrozzoni commented at 7:03 pm on October 14, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    I’m trying to compile Bitcoin Core for test coverage as explained in doc/developer-notes.md, but the command cmake -P build/Coverage.cmake fails with

     0[...]
     1Finished .info-file creation
     2Deleting all .da files in src and subdirectories
     3Done.
     4.lcov-wrapped: WARNING: negative counts found in tracefile test_bitcoin_filtered.info
     5Combining tracefiles.
     6Reading tracefile test_bitcoin_filtered.info
     7Writing data to test_bitcoin_filtered.info
     8Summary coverage rate:
     9  lines......: 70.5% (76896 of 109080 lines)
    10  functions..: 64.7% (21913 of 33862 functions)
    11  branches...: no data found
    12Combining tracefiles.
    13Reading tracefile baseline_filtered.info
    14Reading tracefile test_bitcoin_filtered.info
    15Writing data to test_bitcoin_coverage.info
    16Summary coverage rate:
    17  lines......: 69.6% (76896 of 110489 lines)
    18  functions..: 64.0% (21913 of 34217 functions)
    19  branches...: no data found
    20Reading data file test_bitcoin_coverage.info
    21Found 1038 entries.
    22Found common filename prefix "/home/daniela/Developer/bitcoin"
    23Writing .css and .png files.
    24Generating output.
    25genhtml: ERROR: cannot read /home/daniela/Developer/bitcoin/build/src/include/boost/operators.hpp
    26Processing file build/src/include/boost/operators.hpp
    27CMake Error at build/Coverage.cmake:46 (execute_process):
    28  execute_process failed command indexes:
    29
    30    1: "Child return code: 2"
    

    The command output is also full of similar warnings:

    0geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/smart_ptr/detail/shared_count.hpp
    

    The files ./build/test_bitcoin.coverage/index.html and ./build/total.coverage/index.html are not created

    Expected behaviour

    Compilation succeeds and I’m able to see the ./build/test_bitcoin.coverage/index.html and ./build/total.coverage/index.html files

    Steps to reproduce

    0cmake -B build -DCMAKE_BUILD_TYPE=Coverage
    1cmake --build build
    2cmake -P build/Coverage.cmake
    

    Relevant log output

     0$ cmake -B build -DCMAKE_BUILD_TYPE=Coverage
     1
     2Configuring secp256k1 subtree...
     3-- Could NOT find Valgrind (missing: Valgrind_INCLUDE_DIR Valgrind_WORKS) 
     4
     5
     6secp256k1 configure summary
     7===========================
     8Build artifacts:
     9library type ........................ Static
    10Optional modules:
    11ECDH ................................ OFF
    12ECDSA pubkey recovery ............... ON
    13extrakeys ........................... ON
    14schnorrsig .......................... ON
    15ElligatorSwift ...................... ON
    16Parameters:
    17ecmult window size .................. 15
    18ecmult gen table size ............... 86 KiB
    19Optional features:
    20assembly ............................ x86_64
    21external callbacks .................. OFF
    22Optional binaries:
    23benchmark ........................... OFF
    24noverify_tests ...................... ON
    25tests ............................... OFF
    26exhaustive tests .................... ON
    27ctime_tests ......................... OFF
    28examples ............................ OFF
    29
    30Cross compiling ....................... FALSE
    31Valgrind .............................. OFF
    32Preprocessor defined macros ........... ENABLE_MODULE_ELLSWIFT=1 ENABLE_MODULE_SCHNORRSIG=1 ENABLE_MODULE_EXTRAKEYS=1 ENABLE_MODULE_RECOVERY=1 ECMULT_WINDOW_SIZE=15 COMB_BLOCKS=43 COMB_TEETH=6 USE_ASM_X86_64=1
    33C compiler ............................ GNU 13.2.0, /nix/store/r73z9i18vbjcph7k2f3isrysxzx6sqjx-gcc-wrapper-13.2.0/bin/gcc
    34CFLAGS ................................ 
    35Compile options ....................... -pedantic -Wall -Wcast-align -Wcast-align=strict -Wextra -Wnested-externs -Wno-long-long -Wno-overlength-strings -Wno-unused-function -Wshadow -Wstrict-prototypes -Wundef
    36Build type:
    37- CMAKE_BUILD_TYPE ................... Coverage
    38- CFLAGS ............................. -O2 -g  -O0 -DCOVERAGE=1 --coverage
    39- LDFLAGS for executables ............  --coverage
    40- LDFLAGS for shared libraries .......  --coverage
    41
    42
    43
    44Configure summary
    45=================
    46Executables:
    47bitcoind ............................ ON
    48bitcoin-node (multiprocess) ......... OFF
    49bitcoin-qt (GUI) .................... OFF
    50bitcoin-gui (GUI, multiprocess) ..... OFF
    51bitcoin-cli ......................... ON
    52bitcoin-tx .......................... ON
    53bitcoin-util ........................ ON
    54bitcoin-wallet ...................... ON
    55bitcoin-chainstate (experimental) ... OFF
    56libbitcoinkernel (experimental) ..... OFF
    57Optional features:
    58wallet support ...................... ON
    59 - descriptor wallets (SQLite) ...... ON
    60 - legacy wallets (Berkeley DB) ..... OFF
    61external signer ..................... ON
    62port mapping using UPnP ............. OFF
    63ZeroMQ .............................. OFF
    64USDT tracing ........................ OFF
    65QR code (GUI) ....................... OFF
    66DBus (GUI, Linux only) .............. OFF
    67Tests:
    68test_bitcoin ........................ ON
    69test_bitcoin-qt ..................... OFF
    70bench_bitcoin ....................... OFF
    71fuzz binary ......................... OFF
    72
    73Cross compiling ....................... FALSE
    74C++ compiler .......................... GNU 13.2.0, /nix/store/r73z9i18vbjcph7k2f3isrysxzx6sqjx-gcc-wrapper-13.2.0/bin/g++
    75CMAKE_BUILD_TYPE ...................... Coverage
    76Preprocessor defined macros ........... 
    77C++ compiler flags .................... -g -Og --coverage -std=c++20 -fPIC -fdebug-prefix-map=/home/daniela/Developer/bitcoin=. -fmacro-prefix-map=/home/daniela/Developer/bitcoin=. -fno-extended-identifiers -fstack-reuse=none -Wall -Wextra -Wformat -Wformat-security -Wvla -Wredundant-decls -Wdate-time -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection
    78Linker flags .......................... -g -Og --coverage -fstack-reuse=none -fstack-protector-all -fcf-protection=full -fstack-clash-protection -Wl,-z,relro -Wl,-z,now -Wl,-z,separate-code -fPIE -pie
    79
    80NOTE: The summary above may not exactly match the final applied build flags
    81    if any additional CMAKE_* or environment variables have been modified.
    82    To see the exact flags applied, build with the --verbose option.
    83
    84Attempt to harden executables ......... ON
    85Treat compiler warnings as errors ..... OFF
    86Use ccache for compiling .............. ON
    87
    88
    89-- Configuring done (0.3s)
    90-- Generating done (0.1s)
    91-- Build files have been written to: /home/daniela/Developer/bitcoin/build
    
     0Capturing coverage data from src
     1Found gcov version: 13.2.0
     2Using intermediate gcov format
     3Using JSON module JSON::PP
     4Scanning src for .gcno files ...
     5Found 398 graph files in src
     6Processing univalue/CMakeFiles/object.dir/test/object.cpp.gcno
     7Processing univalue/CMakeFiles/unitester.dir/test/unitester.cpp.gcno
     8Processing univalue/CMakeFiles/univalue.dir/lib/univalue_read.cpp.gcno
     9Processing univalue/CMakeFiles/univalue.dir/lib/univalue_write.cpp.gcno
    10Processing univalue/CMakeFiles/univalue.dir/lib/univalue_get.cpp.gcno
    11Processing univalue/CMakeFiles/univalue.dir/lib/univalue.cpp.gcno
    12Processing util/CMakeFiles/bitcoin_util.dir/exception.cpp.gcno
    13Processing util/CMakeFiles/bitcoin_util.dir/__/random.cpp.gcno
    14Processing util/CMakeFiles/bitcoin_util.dir/__/streams.cpp.gcno
    15Processing util/CMakeFiles/bitcoin_util.dir/__/support/lockedpool.cpp.gcno
    16Processing util/CMakeFiles/bitcoin_util.dir/__/randomenv.cpp.gcno
    17Processing util/CMakeFiles/bitcoin_util.dir/__/sync.cpp.gcno
    18/home/daniela/Developer/bitcoin/build/src/util/CMakeFiles/bitcoin_util.dir/__/sync.cpp.gcno:no functions found
    19geninfo: WARNING: GCOV did not produce any data for /home/daniela/Developer/bitcoin/build/src/util/CMakeFiles/bitcoin_util.dir/__/sync.cpp.gcno
    20[...]
    21Processing CMakeFiles/bitcoin_node.dir/txmempool.cpp.gcno
    22geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/bidir_node_iterator.hpp
    23geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/hash_index_iterator.hpp
    24geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/utility/base_from_member.hpp
    25geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/operators.hpp
    26geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/tuple/detail/tuple_basic.hpp
    27geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/bucket_array.hpp
    28geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/hashed_index.hpp
    29geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/hash_index_node.hpp
    30geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/auto_space.hpp
    31geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/index_base.hpp
    32geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/ord_index_node.hpp
    33geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/ord_index_impl.hpp
    34geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/index_node_base.hpp
    35geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index/detail/header_holder.hpp
    36geninfo: WARNING: could not open /home/daniela/Developer/bitcoin/build/src/include/boost/multi_index_container.hpp
    37geninfo: WARNING: some exclusion markers may be ignored
    38Processing CMakeFiles/bitcoin_node.dir/netgroup.cpp.gcno
    39[...]
    40Finished .info-file creation
    41Deleting all .da files in src and subdirectories
    42Done.
    43.lcov-wrapped: WARNING: negative counts found in tracefile test_bitcoin_filtered.info
    44Combining tracefiles.
    45Reading tracefile test_bitcoin_filtered.info
    46Writing data to test_bitcoin_filtered.info
    47Summary coverage rate:
    48  lines......: 70.5% (76896 of 109080 lines)
    49  functions..: 64.7% (21913 of 33862 functions)
    50  branches...: no data found
    51Combining tracefiles.
    52Reading tracefile baseline_filtered.info
    53Reading tracefile test_bitcoin_filtered.info
    54Writing data to test_bitcoin_coverage.info
    55Summary coverage rate:
    56  lines......: 69.6% (76896 of 110489 lines)
    57  functions..: 64.0% (21913 of 34217 functions)
    58  branches...: no data found
    59Reading data file test_bitcoin_coverage.info
    60Found 1038 entries.
    61Found common filename prefix "/home/daniela/Developer/bitcoin"
    62Writing .css and .png files.
    63Generating output.
    64genhtml: ERROR: cannot read /home/daniela/Developer/bitcoin/build/src/include/boost/operators.hpp
    65Processing file build/src/include/boost/operators.hpp
    66CMake Error at build/Coverage.cmake:46 (execute_process):
    67  execute_process failed command indexes:
    68
    69    1: "Child return code: 2"
    

    For full output: coverage.txt (sorry, github doesn’t let me paste the full output as it’s too long)

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@48cf3da636089873ba7280e0d5b22eb81811d194

    Operating system and version

    NixOS 24.05

    Machine specifications

    No response

  2. hebasto assigned hebasto on Oct 15, 2024
  3. maflcko added the label Build system on Oct 15, 2024
  4. fanquake commented at 3:38 pm on October 22, 2024: member
    Note that this issue isn’t Nix specifix, the coverage build type is somewhat broken (see also #31047). The steps to reproduce result in the same/similar failure on non-nix platforms.
  5. fanquake added this to the milestone 29.0 on Nov 13, 2024


danielabrozzoni fanquake

Labels
Build system

Milestone
29.0


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: 2024-11-21 09:12 UTC

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