Build error on macOS, tag v26.0 builds fine #29289

issue mjdietzx openend this issue on January 21, 2024
  1. mjdietzx commented at 8:19 pm on January 21, 2024: contributor

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    I can’t build master on macOS

    Expected behaviour

    Builds fine when I checkout tag v26.0. I don’t remember getting this error in the past

    Steps to reproduce

    The build commands I’ve tried result in this error:

    0./autogen.sh &&./configure --with-gui=yes && make clean && make -j 4
    
    0./autogen.sh && ./configure CC=clang CXX=clang++ --without-bdb --with-gui=yes && make clean && make -j 4
    
    0./autogen.sh && ./configure CC=clang CXX=clang++ --with-incompatible-bdb --enable-suppress-external-warnings --with-gui=yes && make clean && make -j 4
    

    Relevant log output

     0wallet/interfaces.cpp:611:20: error: call to implicitly-deleted copy constructor of 'util::Result<std::unique_ptr<interfaces::Wallet>>::T' (aka 'std::unique_ptr<interfaces::Wallet>')
     1            return wallet;
     2                   ^~~~~~
     3/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:1584:3: note: copy constructor is implicitly deleted because 'unique_ptr<interfaces::Wallet>' has a user-declared move constructor
     4  unique_ptr(unique_ptr&& __u) _NOEXCEPT
     5  ^
     6./util/result.h:47:14: note: passing argument to parameter 'obj' here
     7    Result(T obj) : m_variant{std::in_place_index_t<1>{}, std::move(obj)} {}
     8             ^
     9wallet/interfaces.cpp:625:20: error: call to implicitly-deleted copy constructor of 'util::Result<std::unique_ptr<interfaces::Wallet>>::T' (aka 'std::unique_ptr<interfaces::Wallet>')
    10            return wallet;
    11                   ^~~~~~
    12/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:1584:3: note: copy constructor is implicitly deleted because 'unique_ptr<interfaces::Wallet>' has a user-declared move constructor
    13  unique_ptr(unique_ptr&& __u) _NOEXCEPT
    14  ^
    15./util/result.h:47:14: note: passing argument to parameter 'obj' here
    16    Result(T obj) : m_variant{std::in_place_index_t<1>{}, std::move(obj)} {}
    17             ^
    18wallet/interfaces.cpp:636:20: error: call to implicitly-deleted copy constructor of 'util::Result<std::unique_ptr<interfaces::Wallet>>::T' (aka 'std::unique_ptr<interfaces::Wallet>')
    19            return wallet;
    20                   ^~~~~~
    21/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:1584:3: note: copy constructor is implicitly deleted because 'unique_ptr<interfaces::Wallet>' has a user-declared move constructor
    22  unique_ptr(unique_ptr&& __u) _NOEXCEPT
    23  ^
    24./util/result.h:47:14: note: passing argument to parameter 'obj' here
    25    Result(T obj) : m_variant{std::in_place_index_t<1>{}, std::move(obj)} {}
    26             ^
    27wallet/interfaces.cpp:651:16: error: call to implicitly-deleted copy constructor of 'util::Result<interfaces::WalletMigrationResult>::T' (aka 'interfaces::WalletMigrationResult')
    28        return out;
    29               ^~~
    30./interfaces/wallet.h:435:29: note: copy constructor of 'WalletMigrationResult' is implicitly deleted because field 'wallet' has a deleted copy constructor
    31    std::unique_ptr<Wallet> wallet;
    32                            ^
    33/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:1584:3: note: copy constructor is implicitly deleted because 'unique_ptr<interfaces::Wallet>' has a user-declared move constructor
    34  unique_ptr(unique_ptr&& __u) _NOEXCEPT
    35  ^
    36./util/result.h:47:14: note: passing argument to parameter 'obj' here
    37    Result(T obj) : m_variant{std::in_place_index_t<1>{}, std::move(obj)} {}
    38             ^
    394 errors generated.
    40make[2]: *** [wallet/libbitcoin_wallet_a-interfaces.o] Error 1
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    master@03752444cd

    Operating system and version

    macOS Monterey 12.0.1

    Machine specifications

    No response

  2. maflcko commented at 7:24 am on January 22, 2024: member

    Which version of clang are you using?

    You’ll have to use at least version 13 or 14, depending on your build settings, but an even later version would be better.

  3. maflcko added the label Build system on Jan 22, 2024
  4. maflcko added the label Questions and Help on Jan 22, 2024
  5. edilmedeiros commented at 1:27 am on January 23, 2024: none

    How are you getting the dependencies?

    I just compiled it in a box with Brew following the official instructions, and I could build it. When using a box with Macports, the build breaks too (still not sure why…)

    Both have Apple clang version 15.0.0 (clang-1500.1.0.2.5) in Sonoma 14.2.

  6. jarolrod commented at 3:43 am on January 23, 2024: member

    I would check the clang version on your system, in any case the dependencies doc now states that the minimum required clang is 14.

    Cannot replicate on a fresh install of macOS 12.0.1 which has Apple Clang version 13.1.6 and the command line developers tools script installed Xcode 13.4. Note that, according to this, It does seem that depending on when you had installed macOS 12.0.1 and when you had setup the environment, that it would have came with clang 12.0.0.

  7. maflcko added the label macOS on Jan 23, 2024
  8. mjdietzx commented at 7:00 pm on January 23, 2024: contributor

    Which version of clang are you using?

    0Apple clang version 13.0.0 (clang-1300.0.29.30)
    1Target: x86_64-apple-darwin21.1.0
    2Thread model: posix
    3InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    

    I tried building master @ f1ab078ed7742c3350438f0315846948cf317e67 on my newer MacBook Pro. Builds properly with no errors. Where clang version is:

    0Apple clang version 14.0.0 (clang-1400.0.29.202)
    1Target: arm64-apple-darwin22.1.0
    2Thread model: posix
    3InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    

    in any case the dependencies doc now states that the minimum required clang is 14.

    I did not realize this. That explains it.

    How are you getting the dependencies?

    In both cases I install/update dependencies with brew, eg: brew install automake boost ccache git libevent libnatpmp libtool llvm miniupnpc pkg-config python qrencode qt@5 sqlite zeromq. The PITA is clang (because it is installed by Xcode)

    I think the conclusion is that I’m on clang 13 and need to upgrade. I’ll close this issue (I don’t have the will power to upgrade Xcode/clang on that machine right now and verify, but if it doesn’t resolve the issue when I get to this I’ll report back)

  9. mjdietzx closed this on Jan 23, 2024

  10. maflcko commented at 8:13 am on January 24, 2024: member

    I think the conclusion is that I’m on clang 13 and need to upgrade. I’ll close this issue (I don’t have the will power to upgrade Xcode/clang on that machine right now and verify, but if it doesn’t resolve the issue when I get to this I’ll report back)

    I think you are on clang 12 (for some reason apple calls clang 12 clang1300), according to https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_%28since_SwiftUI_framework%29

    But yeah, let us know if this is still an issue after upgrading clang.


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-07-01 07:12 UTC

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