macOS Catalina #16387

issue Sjors opened this issue on July 14, 2019
  1. Sjors commented at 12:04 PM on July 14, 2019: member

    New macOS releases have historically led to unpleasant surprises, so I decided to run the beta on an older machine. I installed both the beta of macOS and Xcode, and made the latter default using sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer.

    Note that Apple switched the default shell to zsh: https://support.apple.com/kb/HT208050

    Beta 3

    TL&DR: binaries still work, but building QT from source doesn't and depends seems broken

    The existing binary on my system kept working fine. I was also able to download and install v0.18 from bitcoincore.org.

    Compling master (536590f358dc3d3e5821eba7f1009452ea93b205) from source source fails, see (log).

    Using Homebrew with boost 1.70.0 and qt 5.13.0.

    The tests produce a bunch of warnings:

    test/util_threadnames_tests.cpp:64:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::tt_detail::equal_impl_frwd, unsigned long, int>' requested here
        BOOST_CHECK_EQUAL(names.size(), 100);
        ^
    /usr/local/include/boost/test/tools/old/interface.hpp:154:45: note: expanded from macro 'BOOST_CHECK_EQUAL'
    #define BOOST_CHECK_EQUAL( L, R )           BOOST_TEST_TOOL_IMPL( 0, \
                                                ^
    /usr/local/include/boost/test/tools/old/interface.hpp:67:47: note: expanded from macro 'BOOST_TEST_TOOL_IMPL'
        BOOST_PP_IF( frwd_type, report_assertion, check_frwd ) (                    \
    

    These warnings also occur in the Solaris problem in #15708.

    QT produces warnings:

      CXX      qt/libbitcoinqt_a-bitcoinunits.o
    qt/bitcoinamountfield.cpp:124:24: warning: 'width' is deprecated: Use QFontMetrics::horizontalAdvance [-Wdeprecated-declarations]
                int w = fm.width(BitcoinUnits::format(BitcoinUnits::BTC, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));
                           ^
    /usr/local/Cellar/qt/5.13.0/lib/QtGui.framework/Headers/qfontmetrics.h:107:5: note: 'width' has been explicitly marked deprecated here
        QT_DEPRECATED_X("Use QFontMetrics::horizontalAdvance")
        ^
    /usr/local/Cellar/qt/5.13.0/lib/QtCore.framework/Headers/qglobal.h:294:33: note: expanded from macro 'QT_DEPRECATED_X'
    #  define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
                                    ^
    /usr/local/Cellar/qt/5.13.0/lib/QtCore.framework/Headers/qcompilerdetection.h:649:55: note: expanded from macro 'Q_DECL_DEPRECATED_X'
    #    define Q_DECL_DEPRECATED_X(text) __attribute__ ((__deprecated__(text)))
                                                          ^
    

    And finally QT throws an error:

      CXX      qt/libbitcoinqt_a-networkstyle.o
    qt/guiutil.cpp:365:14: error: no matching function for call to 'objc_msgSend'
        id app = objc_msgSend((id) objc_getClass("NSApplication"), sel_registerName("sharedApplication"));
                 ^~~~~~~~~~~~
    /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/message.h:63:1: note: candidate function not viable: requires 0 arguments, but 2 were provided
    objc_msgSend(void /* id self, SEL op, ... */ )
    ^
    qt/guiutil.cpp:366:5: error: no matching function for call to 'objc_msgSend'
        objc_msgSend(app, sel_registerName("activateIgnoringOtherApps:"), YES);
        ^~~~~~~~~~~~
    /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/message.h:63:1: note: candidate function not viable: requires 0 arguments, but 3 were provided
    objc_msgSend(void /* id self, SEL op, ... */ )
    ^
    2 errors generated.
    make[2]: *** [qt/libbitcoinqt_a-guiutil.o] Error 1
    

    I can ./configure --without-gui and run the test suite.

    I reinstalled all of homebrew, but still get the above warnings and errors.

    Using depends instead, I'm unable to build protobuf (see log). When I strip out protobuf, Boost fails in the same way as #13601 (log). However in this case xcode-select --install doesn't make the issue go away, and the other workaround /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists. See also this dicussion.

  2. fanquake added the label macOS on Jul 14, 2019
  3. promag commented at 11:20 PM on July 16, 2019: member

    Regarding the Qt fix, it's only available in 5.11 https://doc.qt.io/qt-5/qfontmetrics.html#horizontalAdvance so nothing can be done now unless we add conditional directive for Qt 5.11 - which wouldn't be tested.

    Regarding objc_msgSend, a similar issue can be found at https://stackoverflow.com/a/25853741, apparently some compiler flag changed so either fix that or cast the function pointer accordingly to ...objc/message.h:

     56  * These functions must be cast to an appropriate function pointer type
     57  * before being called.
    
  4. Sjors cross-referenced this on Aug 1, 2019 from issue build: macOS toolchain update by fanquake
  5. hebasto cross-referenced this on Aug 25, 2019 from issue qt: Replace objc_msgSend() function calls with the native Objective-C syntax by hebasto
  6. hebasto commented at 10:37 AM on August 25, 2019: member

    @promag

    Regarding objc_msgSend, ... apparently some compiler flag changed...

    Correct. See #16720.

  7. Sjors commented at 2:13 PM on August 25, 2019: member

    @hebasto thanks, that worked! I was able to compile and sync the chain.

  8. hebasto cross-referenced this on Aug 25, 2019 from issue build: Disable warnings for leveldb subtree by default by hebasto
  9. fanquake referenced this in commit 7d6f63cc2c on Sep 1, 2019
  10. Sjors commented at 4:20 PM on October 9, 2019: member

    I just compiled and ran Bitcoin QT master (1c11e53bb604835afd838f4520d3fdba25521c5b) on the macOS Catalina release. Other than the annoying build warnings shown above, it seems to work.

  11. Sjors closed this on Oct 9, 2019

  12. Sjors commented at 11:53 AM on October 11, 2019: member

    make check is broken for me. Could be something specific to my machine, but making an issue anyway: https://github.com/bitcoin-core/secp256k1/issues/674

  13. Sjors reopened this on Oct 11, 2019

  14. Sjors commented at 2:11 PM on October 12, 2019: member

    When I strip out protobuf, Boost fails in the same way as #13601 (log). However in this case xcode-select --install doesn't make the issue go away, and the other workaround /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg no longer exists. See also this dicussion.

    This should be fixed with #17118.

  15. meeDamian commented at 3:14 PM on October 12, 2019: contributor

    I'm also still getting an error on Catalina (on 561a7d304).

    Running test/util/bitcoin-util-test.py...
    /usr/local/bin/python3.7 ../test/util/bitcoin-util-test.py
    Running test/util/rpcauth-test.py...
    /usr/local/bin/python3.7 ../test/util/rpcauth-test.py
    ...
    ----------------------------------------------------------------------
    Ran 3 tests in 0.018s
    
    OK
    Running bench/bench_bitcoin -evals=1 -scaling=0...
    bench/bench_bitcoin -evals=1 -scaling=0 > /dev/null
      CC       src/tests-tests.o
      CCLD     tests
      CC       src/exhaustive_tests-tests_exhaustive.o
      CCLD     exhaustive_tests
    /Library/Developer/CommandLineTools/usr/bin/make  check-TESTS
    ./build-aux/test-driver: line 107: 33356 Segmentation fault: 11  "$@" > $log_file 2>&1
    FAIL: tests
    PASS: exhaustive_tests
    ============================================================================
    Testsuite summary for libsecp256k1 0.1
    ============================================================================
    # TOTAL: 2
    # PASS:  1
    # SKIP:  0
    # XFAIL: 0
    # FAIL:  1
    # XPASS: 0
    # ERROR: 0
    ============================================================================
    See ./test-suite.log
    ============================================================================
    make[6]: *** [test-suite.log] Error 1
    make[5]: *** [check-TESTS] Error 2
    make[4]: *** [check-am] Error 2
    make[3]: *** [check-local] Error 2
    make[2]: *** [check-am] Error 2
    make[1]: *** [check-recursive] Error 1
    make: *** [check-recursive] Error 1
    
  16. MarcoFalke added this to the milestone 0.19.0 on Oct 12, 2019
  17. MarcoFalke added the label Bug on Oct 12, 2019
  18. MarcoFalke added the label Upstream on Oct 12, 2019
  19. Sjors commented at 3:29 PM on October 12, 2019: member

    @meeDamian that's the same issue I found. You can work around it with ./configure CFLAGS="-fno-stack-check" though I have no idea if that's safe. See https://github.com/bitcoin-core/secp256k1/issues/674

  20. meeDamian commented at 4:12 PM on October 12, 2019: contributor

    @meeDamian that's the same issue I found. You can work around it with ./configure CFLAGS="-fno-stack-check" though I have no idea if that's safe. See bitcoin-core/secp256k1#674

    Can confirm it worked, and I was finally able to successfully build Bitcoind 😊. Thank you Sjors!

  21. mmortal03 commented at 3:52 AM on November 7, 2019: none

    @Sjors , can this be closed? I noticed it was still on the 0.19.0 milestone.

  22. laanwj commented at 9:20 AM on November 7, 2019: member

    ./configure CFLAGS="-fno-stack-check" though I have no idea if that's safe

    I might be wrong, but from what I understand it's not: that disables all stack checks. So also stack protector cookies. If someone were to find a buffer overflow in bitcoin core, that'd make it trivial to exploit and gain RCE. There haven't been many historically; some in UPNP, one in the SOCKS5 handling, but never in P2P network code. Still, we would never consider disabling that for a release.

  23. Sjors commented at 3:06 PM on November 7, 2019: member

    Milestone can be removed, because we compile the release against an older SDK.

    The safest workaround is probably to use the 10.14 SDK:

    ./configure CFLAGS=-mmacosx-version-min=10.14
    
  24. fanquake removed this from the milestone 0.19.0 on Nov 7, 2019
  25. Sjors commented at 10:10 AM on November 14, 2019: member

    This problem magically solved itself with Xcode 11.2 (as discovered by @fanquake in bitcoin-core/secp256k1#674.

  26. Sjors closed this on Nov 14, 2019

  27. Sjors cross-referenced this on Feb 2, 2020 from issue macOS Catalina: probably needs bitcoin rebase by Sjors
  28. riordant cross-referenced this on Mar 4, 2020 from issue Fix compilation on MacOS Catalina by riordant
  29. furszy referenced this in commit 24bc866346 on Apr 13, 2020
  30. 10xcryptodev referenced this in commit 148c2ddcc1 on May 14, 2020
  31. kr1z1s cross-referenced this on May 15, 2020 from issue MacOS compile error by kr1z1s
  32. Sjors cross-referenced this on Jun 29, 2020 from issue macOS Big Sur by Sjors
  33. michelvankessel referenced this in commit 532482c35b on Oct 25, 2020
  34. michelvankessel referenced this in commit 110367de6a on Oct 25, 2020
  35. diogoalmiro cross-referenced this on Apr 22, 2021 from issue This package was not tested on any MacOS yet. by diogoalmiro
  36. JaredTate cross-referenced this on Jul 14, 2021 from issue v7.17.3 / develop branch won't compile GUI natively on macOS Big Sur v11.4 & Xcode 12.5.1 by JaredTate
  37. bitcoin locked this on Dec 16, 2021

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: 2026-05-19 06:54 UTC