Depends toolchain doesn’t contain enough info to build from depends on a fresh NixOS install #32428

issue willcl-ark openend this issue on May 6, 2025
  1. willcl-ark commented at 3:31 pm on May 6, 2025: member

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    On a fresh NixOS install when building using depends, the generated toolchain does not pass along enough info for the depends packages to be found by cmake:

    • Following the reproduction steps below will cause cmake -B build --toolchain <toolchain> to error with:
     0-- The CXX compiler identification is Clang 19.1.3
     1-- Detecting CXX compiler ABI info
     2-- Detecting CXX compiler ABI info - done
     3-- Check for working CXX compiler: /nix/store/l4bagvaywzkq3cbjd98rjkqwc0vkpxxw-clang-wrapper-19.1.3/bin/clang++ - skipped
     4-- Detecting CXX compile features
     5-- Detecting CXX compile features - done
     6-- Setting build type to "RelWithDebInfo" as none was specified
     7-- Performing Test CXX_SUPPORTS__WERROR
     8-- Performing Test CXX_SUPPORTS__WERROR - Success
     9-- Performing Test CXX_SUPPORTS__G3
    10-- Performing Test CXX_SUPPORTS__G3 - Success
    11-- Performing Test LINKER_SUPPORTS__G3
    12-- Performing Test LINKER_SUPPORTS__G3 - Success
    13-- Performing Test CXX_SUPPORTS__FTRAPV
    14-- Performing Test CXX_SUPPORTS__FTRAPV - Success
    15-- Performing Test LINKER_SUPPORTS__FTRAPV
    16-- Performing Test LINKER_SUPPORTS__FTRAPV - Success
    17CMake Error at /nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
    18  Could NOT find SQLite3 (missing: SQLite3_INCLUDE_DIR SQLite3_LIBRARY)
    19  (Required is at least version "3.7.17")
    20Call Stack (most recent call first):
    21  /nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
    22  /nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/share/cmake-3.30/Modules/FindSQLite3.cmake:66 (find_package_handle_standard_args)
    23  CMakeLists.txt:110 (find_package)
    24
    25
    26-- Configuring incomplete, errors occurred!
    

    I have started some basic investigation of this and found that with this patch we can detect the depends libraries correctly and build successfully, but I am unsure if this is the correct approach for a fix.

    Expected behaviour

    The toolchain should pass along enough information so that packages can be located on a fresh system install.

    Steps to reproduce

    0docker run --pull=always -it nixos/nix
    1git clone --depth=1 https://github.com/bitcoin/bitcoin && cd bitcoin
    2nix-shell -p binutils cmake curl gcc gitMinimal gnumake patch pkg-config python3
    3make -C depends -j10 NO_QT=1
    4cmake -B build --toolchain /bitcoin/depends/<host-platform-triplet>/toolchain.cmake
    

    Relevant log output

      0# Copyright (c) 2023-present The Bitcoin Core developers
      1# Distributed under the MIT software license, see the accompanying
      2# file COPYING or https://opensource.org/license/mit/.
      3
      4# This file is expected to be highly volatile and may still change substantially.
      5
      6# If CMAKE_SYSTEM_NAME is set within a toolchain file, CMake will also
      7# set CMAKE_CROSSCOMPILING to TRUE, even if CMAKE_SYSTEM_NAME matches
      8# CMAKE_HOST_SYSTEM_NAME. To avoid potential misconfiguration of CMake,
      9# it is best not to touch CMAKE_SYSTEM_NAME unless cross-compiling is
     10# intended.
     11if(FALSE)
     12  set(CMAKE_SYSTEM_NAME Linux)
     13  set(CMAKE_SYSTEM_VERSION 3.17.0)
     14  set(CMAKE_SYSTEM_PROCESSOR x86_64)
     15
     16  set(CMAKE_C_COMPILER_TARGET x86_64-pc-linux-gnu)
     17  set(CMAKE_CXX_COMPILER_TARGET x86_64-pc-linux-gnu)
     18  set(CMAKE_OBJCXX_COMPILER_TARGET x86_64-pc-linux-gnu)
     19endif()
     20
     21if(NOT DEFINED CMAKE_C_FLAGS_INIT)
     22  set(CMAKE_C_FLAGS_INIT "-pipe -std=c11")
     23endif()
     24if(NOT DEFINED CMAKE_C_FLAGS_RELWITHDEBINFO_INIT)
     25  set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2")
     26endif()
     27if(NOT DEFINED CMAKE_C_FLAGS_DEBUG_INIT)
     28  set(CMAKE_C_FLAGS_DEBUG_INIT "")
     29endif()
     30
     31if(NOT DEFINED CMAKE_C_COMPILER)
     32  set(CMAKE_C_COMPILER clang)
     33endif()
     34
     35if(NOT DEFINED CMAKE_CXX_FLAGS_INIT)
     36  set(CMAKE_CXX_FLAGS_INIT "-pipe -std=c++20")
     37  set(CMAKE_OBJCXX_FLAGS_INIT "-pipe -std=c++20")
     38endif()
     39if(NOT DEFINED CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT)
     40  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
     41  set(CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
     42endif()
     43if(NOT DEFINED CMAKE_CXX_FLAGS_DEBUG_INIT)
     44  set(CMAKE_CXX_FLAGS_DEBUG_INIT "")
     45  set(CMAKE_OBJCXX_FLAGS_DEBUG_INIT "")
     46endif()
     47
     48if(NOT DEFINED CMAKE_CXX_COMPILER)
     49  set(CMAKE_CXX_COMPILER clang++)
     50  set(CMAKE_OBJCXX_COMPILER ${CMAKE_CXX_COMPILER})
     51endif()
     52
     53# The DEPENDS_COMPILE_DEFINITIONS* variables are to be treated as lists.
     54set(DEPENDS_COMPILE_DEFINITIONS )
     55set(DEPENDS_COMPILE_DEFINITIONS_RELWITHDEBINFO )
     56set(DEPENDS_COMPILE_DEFINITIONS_DEBUG )
     57
     58if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
     59  set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=mold")
     60endif()
     61if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_INIT)
     62  set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=mold")
     63endif()
     64if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT)
     65  set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "")
     66endif()
     67if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT)
     68  set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "")
     69endif()
     70if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT)
     71  set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "")
     72endif()
     73if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT)
     74  set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "")
     75endif()
     76
     77set(CMAKE_AR "ar")
     78set(CMAKE_RANLIB "ranlib")
     79set(CMAKE_STRIP "strip")
     80set(CMAKE_OBJCOPY "objcopy")
     81set(CMAKE_OBJDUMP "objdump")
     82
     83# Using our own built dependencies should not be
     84# affected by a potentially random environment.
     85set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF)
     86
     87set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}")
     88set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
     89set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
     90set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
     91set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
     92set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations")
     93
     94if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
     95  # The find_package(Qt ...) function internally uses find_library()
     96  # calls for all dependencies to ensure their availability.
     97  # In turn, the find_library() inspects the well-known locations
     98  # on the file system; therefore, a hint is required.
     99  set(CMAKE_FRAMEWORK_PATH "/System/Library/Frameworks")
    100endif()
    101
    102
    103if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
    104  # Customize pkg-config behavior for finding dependencies
    105  # of the xcb QPA platform plugin:
    106  # 1. Restrict search paths to the depends.
    107  # 2. Make output suitable for static linking.
    108  cmake_path(APPEND CMAKE_CURRENT_LIST_DIR "lib" "pkgconfig" OUTPUT_VARIABLE pkg_config_path)
    109  set(ENV{PKG_CONFIG_PATH} ${pkg_config_path})
    110  set(ENV{PKG_CONFIG_LIBDIR} ${pkg_config_path})
    111  unset(pkg_config_path)
    112  set(PKG_CONFIG_ARGN --static)
    113endif()
    114
    115
    116# Set configuration options for the main build system.
    117set(qt_packages  qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_cursor libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm  qrencode)
    118if("${qt_packages}" STREQUAL "")
    119  set(BUILD_GUI OFF CACHE BOOL "")
    120else()
    121  set(BUILD_GUI ON CACHE BOOL "")
    122  set(Qt6_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "")
    123endif()
    124
    125set(qrencode_packages qrencode)
    126if("${qrencode_packages}" STREQUAL "")
    127  set(WITH_QRENCODE OFF CACHE BOOL "")
    128else()
    129  set(WITH_QRENCODE ON CACHE BOOL "")
    130endif()
    131
    132set(zmq_packages zeromq)
    133if("${zmq_packages}" STREQUAL "")
    134  set(WITH_ZMQ OFF CACHE BOOL "")
    135else()
    136  set(WITH_ZMQ ON CACHE BOOL "")
    137endif()
    138
    139set(wallet_packages bdb sqlite)
    140if("${wallet_packages}" STREQUAL "")
    141  set(ENABLE_WALLET OFF CACHE BOOL "")
    142else()
    143  set(ENABLE_WALLET ON CACHE BOOL "")
    144endif()
    145
    146set(bdb_packages bdb)
    147if("${wallet_packages}" STREQUAL "" OR "${bdb_packages}" STREQUAL "")
    148  set(WITH_BDB OFF CACHE BOOL "")
    149else()
    150  set(WITH_BDB ON CACHE BOOL "")
    151endif()
    152
    153set(usdt_packages systemtap)
    154if("${usdt_packages}" STREQUAL "")
    155  set(WITH_USDT OFF CACHE BOOL "")
    156else()
    157  set(WITH_USDT ON CACHE BOOL "")
    158endif()
    159
    160if("" STREQUAL "1")
    161  set(ENABLE_IPC ON CACHE BOOL "")
    162  set(MPGEN_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/mpgen" CACHE FILEPATH "")
    163  set(CAPNP_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/capnp" CACHE FILEPATH "")
    164  set(CAPNPC_CXX_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/capnpc-c++" CACHE FILEPATH "")
    165else()
    166  set(ENABLE_IPC OFF CACHE BOOL "")
    167endif()
    
      0# This is the CMakeCache file.
      1# For build in directory: /home/will/src/core/bitcoin/build
      2# It was generated by CMake: /nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/bin/cmake
      3# You can edit this file to change values found and used by cmake.
      4# If you do not want to change any of the values, simply exit the editor.
      5# If you do want to change a value, simply edit, save, and exit the editor.
      6# The syntax for the file is as follows:
      7# KEY:TYPE=VALUE
      8# KEY is the name of a variable in the cache.
      9# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
     10# VALUE is the current value for the KEY.
     11
     12########################
     13# EXTERNAL cache entries
     14########################
     15
     16//Build bitcoin-cli executable.
     17BUILD_CLI:BOOL=ON
     18
     19//Build bitcoind executable.
     20BUILD_DAEMON:BOOL=ON
     21
     22//Build bitcoin-qt executable.
     23BUILD_GUI:BOOL=ON
     24
     25//Build experimental bitcoinkernel library.
     26BUILD_KERNEL_LIB:BOOL=OFF
     27
     28//Build test_bitcoin and other unit test executables.
     29BUILD_TESTS:BOOL=ON
     30
     31//Build bitcoin-tx executable.
     32BUILD_TX:BOOL=ON
     33
     34//Build bitcoin-util executable.
     35BUILD_UTIL:BOOL=ON
     36
     37//Build experimental bitcoin-chainstate executable.
     38BUILD_UTIL_CHAINSTATE:BOOL=OFF
     39
     40//Value Computed by CMake
     41BitcoinCore_BINARY_DIR:STATIC=/home/will/src/core/bitcoin/build
     42
     43//Value Computed by CMake
     44BitcoinCore_IS_TOP_LEVEL:STATIC=ON
     45
     46//Value Computed by CMake
     47BitcoinCore_SOURCE_DIR:STATIC=/home/will/src/core/bitcoin
     48
     49//Path to a program.
     50CMAKE_ADDR2LINE:FILEPATH=/nix/store/l4bagvaywzkq3cbjd98rjkqwc0vkpxxw-clang-wrapper-19.1.3/bin/addr2line
     51
     52//Choose the type of build, options are: None Debug Release RelWithDebInfo
     53// MinSizeRel ...
     54CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
     55
     56//LLVM archiver
     57CMAKE_CXX_COMPILER_AR:FILEPATH=CMAKE_CXX_COMPILER_AR-NOTFOUND
     58
     59//`clang-scan-deps` dependency scanner
     60CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS:FILEPATH=/nix/store/zld513b4myr3yhs4yyjrcaxag5fcgd57-clang-tools-19.1.3/bin/clang-scan-deps
     61
     62//Generate index for LLVM archive
     63CMAKE_CXX_COMPILER_RANLIB:FILEPATH=CMAKE_CXX_COMPILER_RANLIB-NOTFOUND
     64
     65//Flags used by the CXX compiler during all build types.
     66CMAKE_CXX_FLAGS:STRING=-pipe -std=c++20
     67
     68//Flags used by the CXX compiler during DEBUG builds.
     69CMAKE_CXX_FLAGS_DEBUG:STRING=-O0 -ftrapv -g3
     70
     71//Flags used by the CXX compiler during MINSIZEREL builds.
     72CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os
     73
     74//Flags used by the CXX compiler during RELEASE builds.
     75CMAKE_CXX_FLAGS_RELEASE:STRING=-O2
     76
     77//Flags used by the CXX compiler during RELWITHDEBINFO builds.
     78CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -O2 -g
     79
     80//Path to a program.
     81CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
     82
     83//Flags used by the linker during all build types.
     84CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=mold -fuse-ld=mold
     85
     86//Flags used by the linker during DEBUG builds.
     87CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
     88
     89//Flags used by the linker during MINSIZEREL builds.
     90CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
     91
     92//Flags used by the linker during RELEASE builds.
     93CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
     94
     95//Flags used by the linker during RELWITHDEBINFO builds.
     96CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
     97
     98//Enable/Disable output of compile commands during generation.
     99CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=1
    100
    101//Value Computed by CMake.
    102CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/home/will/src/core/bitcoin/build/CMakeFiles/pkgRedirects
    103
    104//Install path prefix, prepended onto install directories.
    105CMAKE_INSTALL_PREFIX:PATH=/var/empty/local
    106
    107//Path to a program.
    108CMAKE_LINKER:FILEPATH=/nix/store/l4bagvaywzkq3cbjd98rjkqwc0vkpxxw-clang-wrapper-19.1.3/bin/ld
    109
    110//Program used to build from build.ninja files.
    111CMAKE_MAKE_PROGRAM:FILEPATH=/nix/store/nwsn9hg84pf9rpy3bgdpssa2b6qc7w3p-ninja-1.12.1/bin/ninja
    112
    113//Flags used by the linker during the creation of modules during
    114// all build types.
    115CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=mold
    116
    117//Flags used by the linker during the creation of modules during
    118// DEBUG builds.
    119CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
    120
    121//Flags used by the linker during the creation of modules during
    122// MINSIZEREL builds.
    123CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
    124
    125//Flags used by the linker during the creation of modules during
    126// RELEASE builds.
    127CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
    128
    129//Flags used by the linker during the creation of modules during
    130// RELWITHDEBINFO builds.
    131CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
    132
    133//Path to a program.
    134CMAKE_NM:FILEPATH=/nix/store/l4bagvaywzkq3cbjd98rjkqwc0vkpxxw-clang-wrapper-19.1.3/bin/nm
    135
    136//Value Computed by CMake
    137CMAKE_PROJECT_DESCRIPTION:STATIC=Bitcoin client software
    138
    139//Value Computed by CMake
    140CMAKE_PROJECT_HOMEPAGE_URL:STATIC=https://bitcoincore.org/
    141
    142//Value Computed by CMake
    143CMAKE_PROJECT_NAME:STATIC=BitcoinCore
    144
    145//Value Computed by CMake
    146CMAKE_PROJECT_VERSION:STATIC=29.99.0
    147
    148//Value Computed by CMake
    149CMAKE_PROJECT_VERSION_MAJOR:STATIC=29
    150
    151//Value Computed by CMake
    152CMAKE_PROJECT_VERSION_MINOR:STATIC=99
    153
    154//Value Computed by CMake
    155CMAKE_PROJECT_VERSION_PATCH:STATIC=0
    156
    157//Value Computed by CMake
    158CMAKE_PROJECT_VERSION_TWEAK:STATIC=
    159
    160//Path to a program.
    161CMAKE_READELF:FILEPATH=/nix/store/l4bagvaywzkq3cbjd98rjkqwc0vkpxxw-clang-wrapper-19.1.3/bin/readelf
    162
    163//Flags used by the linker during the creation of shared libraries
    164// during all build types.
    165CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=mold -fuse-ld=mold
    166
    167//Flags used by the linker during the creation of shared libraries
    168// during DEBUG builds.
    169CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
    170
    171//Flags used by the linker during the creation of shared libraries
    172// during MINSIZEREL builds.
    173CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
    174
    175//Flags used by the linker during the creation of shared libraries
    176// during RELEASE builds.
    177CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
    178
    179//Flags used by the linker during the creation of shared libraries
    180// during RELWITHDEBINFO builds.
    181CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
    182
    183//If set, runtime paths are not added when installing shared libraries,
    184// but are added when building.
    185CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
    186
    187//If set, runtime paths are not added when using shared libraries.
    188CMAKE_SKIP_RPATH:BOOL=NO
    189
    190//Flags used by the linker during the creation of static libraries
    191// during all build types.
    192CMAKE_STATIC_LINKER_FLAGS:STRING=
    193
    194//Flags used by the linker during the creation of static libraries
    195// during DEBUG builds.
    196CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
    197
    198//Flags used by the linker during the creation of static libraries
    199// during MINSIZEREL builds.
    200CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
    201
    202//Flags used by the linker during the creation of static libraries
    203// during RELEASE builds.
    204CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
    205
    206//Flags used by the linker during the creation of static libraries
    207// during RELWITHDEBINFO builds.
    208CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
    209
    210//Path to a program.
    211CMAKE_TAPI:FILEPATH=CMAKE_TAPI-NOTFOUND
    212
    213//The CMake toolchain file
    214CMAKE_TOOLCHAIN_FILE:FILEPATH=/home/will/src/core/bitcoin/depends/x86_64-pc-linux-gnu/toolchain.cmake
    215
    216//If this value is on, makefiles will be generated without the
    217// .SILENT directive, and all commands will be echoed to the console
    218// during the make.  This is useful for debugging only. With Visual
    219// Studio IDE projects all commands are done without /nologo.
    220CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
    221
    222ENABLE_IPC:BOOL=OFF
    223
    224//Enable wallet.
    225ENABLE_WALLET:BOOL=ON
    226
    227//Arguments to supply to pkg-config
    228PKG_CONFIG_ARGN:STRING=--static
    229
    230//pkg-config executable
    231PKG_CONFIG_EXECUTABLE:FILEPATH=/nix/store/f1gamyykr0f8n4afy910ass2jx2g9zkv-pkg-config-wrapper-0.29.2/bin/pkg-config
    232
    233Qt6_ROOT:PATH=/home/will/src/core/bitcoin/depends/x86_64-pc-linux-gnu
    234
    235//Path to a file.
    236SQLite3_INCLUDE_DIR:PATH=SQLite3_INCLUDE_DIR-NOTFOUND
    237
    238//Path to a library.
    239SQLite3_LIBRARY:FILEPATH=SQLite3_LIBRARY-NOTFOUND
    240
    241WITH_BDB:BOOL=ON
    242
    243WITH_QRENCODE:BOOL=ON
    244
    245WITH_USDT:BOOL=ON
    246
    247WITH_ZMQ:BOOL=ON
    248
    249
    250########################
    251# INTERNAL cache entries
    252########################
    253
    254//ADVANCED property for variable: CMAKE_ADDR2LINE
    255CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1
    256//STRINGS property for variable: CMAKE_BUILD_TYPE
    257CMAKE_BUILD_TYPE-STRINGS:INTERNAL=RelWithDebInfo;Debug;Release;MinSizeRel
    258//This is the directory where this CMakeCache.txt was created
    259CMAKE_CACHEFILE_DIR:INTERNAL=/home/will/src/core/bitcoin/build
    260//Major version of cmake used to create the current loaded cache
    261CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3
    262//Minor version of cmake used to create the current loaded cache
    263CMAKE_CACHE_MINOR_VERSION:INTERNAL=30
    264//Patch version of cmake used to create the current loaded cache
    265CMAKE_CACHE_PATCH_VERSION:INTERNAL=5
    266//Path to CMake executable.
    267CMAKE_COMMAND:INTERNAL=/nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/bin/cmake
    268//Path to cpack program executable.
    269CMAKE_CPACK_COMMAND:INTERNAL=/nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/bin/cpack
    270//Path to ctest program executable.
    271CMAKE_CTEST_COMMAND:INTERNAL=/nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/bin/ctest
    272//ADVANCED property for variable: CMAKE_CXX_COMPILER_AR
    273CMAKE_CXX_COMPILER_AR-ADVANCED:INTERNAL=1
    274//ADVANCED property for variable: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS
    275CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-ADVANCED:INTERNAL=1
    276//ADVANCED property for variable: CMAKE_CXX_COMPILER_RANLIB
    277CMAKE_CXX_COMPILER_RANLIB-ADVANCED:INTERNAL=1
    278//ADVANCED property for variable: CMAKE_CXX_FLAGS
    279CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1
    280//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG
    281CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1
    282//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL
    283CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
    284//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE
    285CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1
    286//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO
    287CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
    288//ADVANCED property for variable: CMAKE_DLLTOOL
    289CMAKE_DLLTOOL-ADVANCED:INTERNAL=1
    290//Executable file format
    291CMAKE_EXECUTABLE_FORMAT:INTERNAL=ELF
    292//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS
    293CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1
    294//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG
    295CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
    296//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
    297CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
    298//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE
    299CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
    300//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
    301CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
    302//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS
    303CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1
    304//Name of external makefile project generator.
    305CMAKE_EXTRA_GENERATOR:INTERNAL=
    306//Name of generator.
    307CMAKE_GENERATOR:INTERNAL=Ninja
    308//Generator instance identifier.
    309CMAKE_GENERATOR_INSTANCE:INTERNAL=
    310//Name of generator platform.
    311CMAKE_GENERATOR_PLATFORM:INTERNAL=
    312//Name of generator toolset.
    313CMAKE_GENERATOR_TOOLSET:INTERNAL=
    314//Source directory with the top level CMakeLists.txt file for this
    315// project
    316CMAKE_HOME_DIRECTORY:INTERNAL=/home/will/src/core/bitcoin
    317//Install .so files without execute permission.
    318CMAKE_INSTALL_SO_NO_EXE:INTERNAL=0
    319//ADVANCED property for variable: CMAKE_LINKER
    320CMAKE_LINKER-ADVANCED:INTERNAL=1
    321//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
    322CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
    323//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS
    324CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1
    325//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG
    326CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
    327//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
    328CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
    329//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE
    330CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
    331//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
    332CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
    333//ADVANCED property for variable: CMAKE_NM
    334CMAKE_NM-ADVANCED:INTERNAL=1
    335//number of local generators
    336CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
    337//Platform information initialized
    338CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
    339//ADVANCED property for variable: CMAKE_READELF
    340CMAKE_READELF-ADVANCED:INTERNAL=1
    341//Path to CMake installation.
    342CMAKE_ROOT:INTERNAL=/nix/store/4kb60dy0dg80ww8gh2av4by4vwn8l48k-cmake-3.30.5/share/cmake-3.30
    343//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS
    344CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1
    345//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG
    346CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
    347//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
    348CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
    349//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE
    350CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
    351//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
    352CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
    353//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH
    354CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1
    355//ADVANCED property for variable: CMAKE_SKIP_RPATH
    356CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1
    357//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS
    358CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1
    359//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG
    360CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1
    361//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL
    362CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1
    363//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE
    364CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1
    365//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO
    366CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
    367//ADVANCED property for variable: CMAKE_TAPI
    368CMAKE_TAPI-ADVANCED:INTERNAL=1
    369//uname command
    370CMAKE_UNAME:INTERNAL=/nix/store/k48bha2fjqzarg52picsdfwlqx75aqbb-coreutils-9.5/bin/uname
    371//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
    372CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
    373//Test CXX_SUPPORTS__FTRAPV
    374CXX_SUPPORTS__FTRAPV:INTERNAL=1
    375//Test CXX_SUPPORTS__G3
    376CXX_SUPPORTS__G3:INTERNAL=1
    377//Test CXX_SUPPORTS__WERROR
    378CXX_SUPPORTS__WERROR:INTERNAL=1
    379//Test LINKER_SUPPORTS__FTRAPV
    380LINKER_SUPPORTS__FTRAPV:INTERNAL=1
    381//Test LINKER_SUPPORTS__G3
    382LINKER_SUPPORTS__G3:INTERNAL=1
    383PC_SQLite3_CFLAGS:INTERNAL=
    384PC_SQLite3_CFLAGS_I:INTERNAL=
    385PC_SQLite3_CFLAGS_OTHER:INTERNAL=
    386PC_SQLite3_FOUND:INTERNAL=
    387PC_SQLite3_INCLUDEDIR:INTERNAL=
    388PC_SQLite3_LIBDIR:INTERNAL=
    389PC_SQLite3_LIBS:INTERNAL=
    390PC_SQLite3_LIBS_L:INTERNAL=
    391PC_SQLite3_LIBS_OTHER:INTERNAL=
    392PC_SQLite3_LIBS_PATHS:INTERNAL=
    393PC_SQLite3_MODULE_NAME:INTERNAL=
    394PC_SQLite3_PREFIX:INTERNAL=
    395PC_SQLite3_STATIC_CFLAGS:INTERNAL=
    396PC_SQLite3_STATIC_CFLAGS_I:INTERNAL=
    397PC_SQLite3_STATIC_CFLAGS_OTHER:INTERNAL=
    398PC_SQLite3_STATIC_LIBDIR:INTERNAL=
    399PC_SQLite3_STATIC_LIBS:INTERNAL=
    400PC_SQLite3_STATIC_LIBS_L:INTERNAL=
    401PC_SQLite3_STATIC_LIBS_OTHER:INTERNAL=
    402PC_SQLite3_STATIC_LIBS_PATHS:INTERNAL=
    403PC_SQLite3_VERSION:INTERNAL=
    404PC_SQLite3_sqlite3_INCLUDEDIR:INTERNAL=
    405PC_SQLite3_sqlite3_LIBDIR:INTERNAL=
    406PC_SQLite3_sqlite3_PREFIX:INTERNAL=
    407PC_SQLite3_sqlite3_VERSION:INTERNAL=
    408//ADVANCED property for variable: PKG_CONFIG_ARGN
    409PKG_CONFIG_ARGN-ADVANCED:INTERNAL=1
    410//ADVANCED property for variable: PKG_CONFIG_EXECUTABLE
    411PKG_CONFIG_EXECUTABLE-ADVANCED:INTERNAL=1
    412//ADVANCED property for variable: SQLite3_INCLUDE_DIR
    413SQLite3_INCLUDE_DIR-ADVANCED:INTERNAL=1
    414//ADVANCED property for variable: SQLite3_LIBRARY
    415SQLite3_LIBRARY-ADVANCED:INTERNAL=1
    416//linker supports push/pop state
    417_CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED:INTERNAL=FALSE
    418__pkg_config_checked_PC_SQLite3:INTERNAL=1
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@885b4bc8b59d1cbbaea519207f715eab447cc0ff

    Operating system and version

    NixOS 25.05 (Warbler) x86_64

    Machine specifications

    No response

  2. hebasto added the label Build system on May 6, 2025
  3. ryanofsky commented at 3:49 pm on May 6, 2025: contributor

    I debugged this issue at some point before and have been working around it since by setting the PATH variable when using depends like:

    0export PATH=$PATH:$PWD/depends/x86_64-pc-linux-gnu/include
    1export PATH=$PATH:$PWD/depends/x86_64-pc-linux-gnu/lib
    2cmake -B build -DCMAKE_TOOLCHAIN_FILE=depends/x86_64-pc-linux-gnu/toolchain.cmake
    

    More ideally, we would be able to do:

    0export CMAKE_PREFIX_PATH=$PWD/depends/x86_64-pc-linux-gnu
    1cmake -B build -DCMAKE_TOOLCHAIN_FILE=depends/x86_64-pc-linux-gnu/toolchain.cmake
    

    but this only works if you delete set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) from the toolchain file:

    https://github.com/bitcoin/bitcoin/blob/baa848b8d38187ce6b24a57cfadf1ea180209711/depends/toolchain.cmake.in#L86

    I commented on this previously in #30940#pullrequestreview-2322355196


    EDIT: Just noticed suggested fix 437a4da93f437f9588ff32d19ac59fea3802c676. That is probably better than either of two workarounds I suggested above.

    EDIT 2: I guess my PATH hack above worked because we are only turning off the CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH option but not the CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH option

  4. hebasto commented at 4:23 pm on May 6, 2025: member
  5. hebasto commented at 4:30 pm on May 6, 2025: member

    The problem is caused by set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) in the toolchain file:

    https://github.com/bitcoin/bitcoin/blob/baa848b8d38187ce6b24a57cfadf1ea180209711/depends/toolchain.cmake.in#L86

    and I believe it goes away if you remove that line. I commented on this previously in #30940 (review)

    Here is some additional context on how this code was introduced: https://github.com/hebasto/bitcoin/pull/88#discussion_r1471043621.

  6. hebasto referenced this in commit 546adfdfc6 on May 6, 2025
  7. ryanofsky commented at 5:58 pm on May 6, 2025: contributor

    I can confirm Will’s commit in 437a4da93f437f9588ff32d19ac59fea3802c676 fixes the problem for me and seems like a good solution. But I think it can be simplified to only just list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}") and the if() guard should be unnecessary.

    I also confirmed the other fix appending -DCMAKE_PREFIX_PATH=/ to the command line from https://github.com/hebasto/bitcoin/issues/121#issuecomment-2015274066 works. I guess this works because cmake appends CMAKE_FIND_ROOT_PATH to CMAKE_PREFIX_PATH when searching.

    I also confirmed adding -DCMAKE_PREFIX_PATH=$PWD/depends/x86_64-pc-linux-gnu to the command line works.

    And I confirmed adding list(APPEND CMAKE_PREFIX_PATH "/") to the toolchain file works as well.

    I also tried my PATH workaround again and it works for sqlite but then it fails to find zmq and libevent packages unless also adding -DCMAKE_PREFIX_PATH=$PWD/depends/x86_64-pc-linux-gnu/lib/cmake with unnecessary lib/cmake suffix (which I guess was my original approach which led finding that workaround).

    In any case, it seems like a good fix could just be to add list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_LIST_DIR}") to the toolchain file and be done.

    The thing I don’t understand is why setting CMAKE_PREFIX_PATH as well as CMAKE_FIND_ROOT_PATH seems to be necessary on nix while setting CMAKE_FIND_ROOT_PATH alone seems to work on other platforms.

  8. ryanofsky commented at 7:08 pm on May 6, 2025: contributor

    The thing I don’t understand is why setting CMAKE_PREFIX_PATH as well as CMAKE_FIND_ROOT_PATH seems to be necessary on nix while setting CMAKE_FIND_ROOT_PATH alone seems to work on other platforms.

    Reason for this is that nix is patching cmake to remove the root path / from CMAKE_SYSTEM_PREFIX_PATH in https://github.com/NixOS/nixpkgs/blob/df545660856d8252b4856bede70d424ef4b47c64/pkgs/by-name/cm/cmake/001-search-path.diff

    Because of this CMAKE_FIND_ROOT_PATH is not searched directly for dependencies and setting CMAKE_PREFIX_PATH just compensates by telling it where else too look.

    (Found answer to this question by asking chatgpt O3 which was able to point directly at the patch. Otherwise I would have no idea.)

    So I think the following might be the most direct fix.

     0--- a/depends/toolchain.cmake.in
     1+++ b/depends/toolchain.cmake.in
     2@@ -92,6 +92,14 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
     3 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
     4 set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations")
     5 
     6+# Following is only necessary when using cmake from Nix or NixOS, because Nix
     7+# patches cmake to remove the root directory `/` from CMAKE_SYSTEM_PREFIX_PATH.
     8+# Adding it back is harmless on other platforms and necessary on Nix because
     9+# without it cmake find_path, find_package, etc functions do not know where to
    10+# look in CMAKE_FIND_ROOT_PATH for dependencies
    11+# (https://github.com/bitcoin/bitcoin/issues/32428).
    12+list(APPEND CMAKE_SYSTEM_PREFIX_PATH "/")
    13+
    14 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
    15   # The find_package(Qt ...) function internally uses find_library()
    16   # calls for all dependencies to ensure their availability.
    
  9. willcl-ark commented at 7:11 pm on May 6, 2025: member

    Yes I agree @ryanofsky, thanks for double-checking!

    I added the if() guard because I heard [from @hebasto](https://gnusha.org/bitcoin-builds/2025-04-22.log) that we call the toolchain multiple times, and the if guard therefore avoids adding the path repeatedly.

  10. ryanofsky commented at 7:23 pm on May 6, 2025: contributor

    I added the if() guard because I heard from @hebasto that we call the toolchain multiple times, and the if guard therefore avoids adding the path repeatedly.

    I think this is half-true. I noticed by adding prints to the cmake file that it was called multiple times, but each time CMAKE_PREFIX_PATH was always set back to the original value, so I don’t think the if guard did anything.

    Also just to be sure another difference isn’t glossed over: I think it probably is better to set CMAKE_SYSTEM_PREFIX_PATH instead of CMAKE_PREFIX_PATH since former seems to fix the original problem, while latter is more of a workaround.

    Also really appreciate you reporting this issue and finding a good workaround. This has been causing me headaches for a long time, and I’ve only had crappy workarounds and couldn’t figure out how this was working at all on other systems.

  11. willcl-ark commented at 7:46 pm on May 6, 2025: member

    Also just to be sure another difference isn’t glossed over: I think it probably is better to set CMAKE_SYSTEM_PREFIX_PATH instead of CMAKE_PREFIX_PATH since former seems to fix the original problem, while latter is more of a workaround.

    That sounds reasonable.

    Also really appreciate you reporting this issue and finding a good workaround. This has been causing me headaches for a long time, and I’ve only had crappy workarounds and couldn’t figure out how this was working at all on other systems.

    I’m glad I did! I only recently switched to NixOS and was about to go around start bugging other known Nix users about “how they got depends working” as it’s been driving me a bit mad too :D

    I’ve got another half-baked patch which I also appear to need to actually make a depends-built bitcoin-qt work under NixOS: https://github.com/bitcoin/bitcoin/commit/3700c49e57faf2e0eb9bdae0526004ebf4ee343e I’d like to investigate if I can fix it up using LDPRELOAD rather than requiring a custom RPATH toggle (just for NixOS!), but I think I’m gunna leave that for another day… 😄

  12. willcl-ark referenced this in commit 12966ca13a on May 6, 2025
  13. willcl-ark referenced this in commit fa4b7f4cd5 on May 6, 2025
  14. hebasto referenced this in commit ea799dece3 on May 6, 2025
  15. hebasto commented at 9:22 pm on May 6, 2025: member

    I added the if() guard because I heard from @hebasto that we call the toolchain multiple times, and the if guard therefore avoids adding the path repeatedly.

    I think this is half-true. I noticed by adding prints to the cmake file that it was called multiple times, but each time CMAKE_PREFIX_PATH was always set back to the original value, so I don’t think the if guard did anything.

    I’d avoid making assumptions about undocumented CMAKE_PREFIX_PATH-related behaviour. Let’s preserve the idempotence of the toolchain file.

  16. hebasto commented at 6:44 am on May 7, 2025: member

    The problem is caused by set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) in the toolchain file:

    bitcoin/depends/toolchain.cmake.in](https://github.com/bitcoin/bitcoin/blob/baa848b8d38187ce6b24a57cfadf1ea180209711/depends/toolchain.cmake.in#L86

    and I believe it goes away if you remove that line. I commented on this previously in #30940 (review)

    Here is some additional context on how this code was introduced: hebasto#88 (comment).

    I’ve re-verified this on the current master branch: set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) is no longer necessary for Guix builds following the migration to Qt 6.

    UPD. I’m not suggesting removing this command. See #32428 (comment).

  17. hebasto commented at 6:57 am on May 7, 2025: member
  18. willcl-ark commented at 9:01 am on May 7, 2025: member

    I have just re-tested and do not find that removing CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH sees the depends toolchain working correctly on a default NixOS install, using the repro steps in OP.

    I’d avoid making assumptions about undocumented CMAKE_PREFIX_PATH-related behaviour. Let’s preserve the idempotence of the toolchain file.

    Am I correctly understanding therefore that you are suggesting for the following changes as a fix for this?:

    1. Remove CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH
    2. Explicitly set CMAKE_PREFIX_PATH using an if-guard, as per: https://github.com/bitcoin/bitcoin/commit/437a4da93f437f9588ff32d19ac59fea3802c676
  19. hebasto commented at 9:13 am on May 7, 2025: member

    Am I correctly understanding therefore that you are suggesting for the following changes as a fix for this?:

    1. Remove CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH

    Building our own depends implies that we fully rely on them, ideally skipping all other search paths used by CMake’s package, library, and header search mechanisms. Therefore, I believe we should retain as many restrictions as possible.

    1. Explicitly set CMAKE_PREFIX_PATH using an if-guard, as per: 437a4da

    Any list appending we agree on should be if-guarded.

  20. purpleKarrot commented at 9:45 pm on May 7, 2025: contributor

    Building our own depends implies that we fully rely on them, ideally skipping all other search paths used by CMake’s package, library, and header search mechanisms. Therefore, I believe we should retain as many restrictions as possible.

    We may do that with a dependency provider. This will put find_package() completely under our control, so restricting CMake’s builtin find logic becomes unnecessary.

  21. hebasto commented at 9:32 am on May 8, 2025: member

    Building our own depends implies that we fully rely on them, ideally skipping all other search paths used by CMake’s package, library, and header search mechanisms. Therefore, I believe we should retain as many restrictions as possible.

    We may do that with a dependency provider. This will put find_package() completely under our control, so restricting CMake’s builtin find logic becomes unnecessary.

    Does this require a minimum CMake version of 3.24?

  22. purpleKarrot commented at 10:54 am on May 8, 2025: contributor

    We may do that with a dependency provider. This will put find_package() completely under our control, so restricting CMake’s builtin find logic becomes unnecessary.

    Does this require a minimum CMake version of 3.24?

    Yes, but it does not require updating the minimum required version of the project. That means building with system packages would be possible with version 3.22, while building with depends would require 3.24.


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-05-11 15:12 UTC

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