depends: capnp build ignores config_opts #32068

issue Sjors openend this issue on March 14, 2025
  1. Sjors commented at 1:22 pm on March 14, 2025: member

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    It seems that when building capnp via depends the config_opts in capnp.mk are ignored, i.e. -DBUILD_TESTING=OFF, -DWITH_OPENSSL=OFF and -DWITH_ZLIB=OFF.

    This can be seen in the depends build log by e.g. Built target capnp-heavy-tests, a target that should be skipped entirely. It becomes a problem during the cmake -B build --toolchain ... step, because it will complain about not finding OpenSSL and zlib, both of which it shouldn’t need.

    Expected behaviour

    Don’t build test target and, more importantly, don’t look for OpenSSL.

    Steps to reproduce

    0git clean -dfx
    1make -C depends NO_QT=1 NO_USDT=1 NO_ZMQ=1 NO_BDB=1 MULTIPROCESS=1
    2cmake -B build --toolchain /Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/toolchain.cmake
    3...
    4  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
    

    Relevant log output

    Depends build with V=1: https://gist.github.com/Sjors/4e851f2455c67372ad40a8382432acf5

    It looks like it does set -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF for the native build:

    0{ cd /Users/sjors/dev/bitcoin/depends/work/build/aarch64-apple-darwin24.3.0/native_capnp/1.1.0-c8c5a5f0b88/.; export     PKG_CONFIG_LIBDIR=/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/lib/pkgconfig PKG_CONFIG_PATH=/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/share/pkgconfig PKG_CONFIG_SYSROOT_DIR=/ CMAKE_MODULE_PATH=/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/lib/cmake PATH="/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/bin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/Users/sjors/.nvm/versions/node/v16.20.2/bin:/Users/sjors/.local/bin:/Users/sjors/.pyenv/shims:/Users/sjors/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/sjors/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/opt/podman/bin:/Users/sjors/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities";   env CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CFLAGS="  -I/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/include          " CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CXXFLAGS="  -I/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/include          " LDFLAGS="  -L/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/lib    " cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH="/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native" -DCMAKE_AR=`which /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar` -DCMAKE_NM=`which /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm` -DCMAKE_RANLIB=`which /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib` -DCMAKE_INSTALL_LIBDIR=lib/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=1 -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF        -DCMAKE_INSTALL_RPATH:PATH="/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/lib" .; }
    

    But not for the non-native(?) one:

    0{ cd /Users/sjors/dev/bitcoin/depends/work/build/aarch64-apple-darwin24.3.0/capnp/1.1.0-31298932310/.; export     PKG_CONFIG_LIBDIR=/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/lib/pkgconfig PKG_CONFIG_PATH=/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/share/pkgconfig PKG_CONFIG_SYSROOT_DIR=/ CMAKE_MODULE_PATH=/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/lib/cmake PATH="/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/native/bin:/opt/homebrew/opt/gnu-sed/libexec/gnubin:/opt/homebrew/opt/grep/libexec/gnubin:/Users/sjors/.nvm/versions/node/v16.20.2/bin:/Users/sjors/.local/bin:/Users/sjors/.pyenv/shims:/Users/sjors/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/sjors/.rbenv/shims:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/opt/podman/bin:/Users/sjors/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities";   env CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CFLAGS="  -I/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/include     -pipe -std=c11 -mmacos-version-min=13.0 -arch arm64 -O2    " CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -isysroot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CXXFLAGS="  -I/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/include     -pipe -std=c++20 -mmacos-version-min=13.0 -arch arm64 -O2    " LDFLAGS="-Wl,-platform_version,macos,13.0,14.0  -L/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0/lib    " cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH="/Users/sjors/dev/bitcoin/depends/aarch64-apple-darwin24.3.0" -DCMAKE_AR=`which /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar` -DCMAKE_NM=`which /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm` -DCMAKE_RANLIB=`which /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib` -DCMAKE_INSTALL_LIBDIR=lib/ -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=1        .; }
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@698f86964c68041d938aaf54fdd39466266c371c

    Operating system and version

    macOS 15.3.2

    Machine specifications

    M4 Mac

    XCode 16.2 cmake version 3.31.4

    0xcode-select -p
    1/Applications/Xcode.app/Contents/Developer
    
  2. Sjors commented at 1:44 pm on March 14, 2025: member

    The macOS native builds don’t use depends, so #30975 would not pick this is up.

    cc @ryanofsky

  3. Sjors commented at 2:02 pm on March 14, 2025: member
    I can also reproduce this on Intel macOS 13.7.4 with Xcode 15.2.
  4. ryanofsky commented at 2:05 pm on March 14, 2025: contributor

    Not sure if I can reproduce this locally. At least if I run make -C depends NO_QT=1 NO_USDT=1 NO_ZMQ=1 NO_BDB=1 MULTIPROCESS=1 capnp V=1 I do see cmake being called with -DBUILD_TESTING=OFF -DWITH_OPENSSL=OFF -DWITH_ZLIB=OFF.

    Diffing the native and non-native packages though, I wonder if there’s a chance this could caused by syntax affecting older version of make, because the non-native package seems to have an extra := following the define. Could try:

     0--- a/depends/packages/capnp.mk
     1+++ b/depends/packages/capnp.mk
     2@@ -5,7 +5,7 @@ $(package)_download_file=$(native_$(package)_download_file)
     3 $(package)_file_name=$(native_$(package)_file_name)
     4 $(package)_sha256_hash=$(native_$(package)_sha256_hash)
     5 
     6-define $(package)_set_vars :=
     7+define $(package)_set_vars
     8   $(package)_config_opts := -DBUILD_TESTING=OFF
     9   $(package)_config_opts += -DWITH_OPENSSL=OFF
    10   $(package)_config_opts += -DWITH_ZLIB=OFF
    11diff --git a/depends/packages/libmultiprocess.mk b/depends/packages/libmultiprocess.mk
    12index a181e05100bb..bf705ddb9e7e 100644
    13@@ -8,7 +8,7 @@ ifneq ($(host),$(build))
    14 $(package)_dependencies += native_capnp
    15 endif
    16 
    17-define $(package)_set_vars :=
    18+define $(package)_set_vars
    19 ifneq ($(host),$(build))
    20 $(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
    21 $(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"
    
  5. Sjors commented at 2:35 pm on March 14, 2025: member

    Both macs have GNU Make 3.81

    Trying your modification. If it works, it’s yet another reason to migrate depends to cmake…?

  6. Sjors commented at 2:58 pm on March 14, 2025: member
    That did the trick.
  7. Sjors referenced this in commit db06626d68 on Mar 14, 2025
  8. Sjors commented at 3:16 pm on March 14, 2025: member
    Opened #32070 to fix it.
  9. Sjors referenced this in commit 9157d9e449 on Mar 14, 2025
  10. fanquake closed this on Mar 16, 2025

  11. fanquake referenced this in commit 83a9e55ae1 on Mar 16, 2025
  12. glozow referenced this in commit 4e438d326e on Mar 17, 2025
  13. Salarja commented at 4:53 pm on March 23, 2025: none

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-03-28 15:12 UTC

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