Failure to build with Boost 1.77 #22482

issue brad0 opened this issue on July 18, 2021
  1. brad0 commented at 2:09 AM on July 18, 2021: none

    Build testing the OpenBSD ports tree with Boost 1.77 beta1. bitcoin 0.21.1 fails to build as shown..

    wallet/test/init_test_fixture.cpp:34:52: error: no member named 'BOOST_FILESYSTEM_C_STR' in 'boost::filesystem::path'
        std::ofstream f(m_walletdir_path_cases["file"].BOOST_FILESYSTEM_C_STR);
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
    1 error generated.
    
  2. brad0 added the label Bug on Jul 18, 2021
  3. fanquake commented at 3:26 AM on July 18, 2021: member

    Looks like there have been a large number of changes in the Filesystem library with the (beta) release of 1.77.0.

  4. MarcoFalke added the label Tests on Jul 18, 2021
  5. pjsnps commented at 5:19 AM on July 21, 2021: none

    Complete noob here, sorry, but is this related?:

    On Centos 7, with Package boost-1.53.0-28.el7.x86_64 already installed and latest version Package boost-devel-1.53.0-28.el7.x86_64 already installed and latest version

    In file included from /usr/include/boost/optional.hpp:15:0,
                     from ./optional.h:10,
                     from ./util/system.h:22,
                     from ./addrman.h:17,
                     from ./net.h:10,
                     from net.cpp:10:
    /usr/include/boost/optional/optional.hpp: In instantiation of ‘void boost::optional_detail::optional_base<T>::construct(const Expr&, const void*) [with Expr = CDataStream; T = CNetMessage]’:
    /usr/include/boost/optional/optional.hpp:262:25:   required from ‘boost::optional_detail::optional_base<T>::optional_base(const Expr&, const Expr*) [with Expr = CDataStream; T = CNetMessage]’
    /usr/include/boost/optional/optional.hpp:559:78:   required from ‘boost::optional<T>::optional(const Expr&) [with Expr = CDataStream; T = CNetMessage]’
    net.cpp:761:47:   required from here
    /usr/include/boost/optional/optional.hpp:392:8: error: no matching function for call to ‘CNetMessage::CNetMessage(const CDataStream&)’
            new (m_storage.address()) internal_type(expr) ;
            ^
    /usr/include/boost/optional/optional.hpp:392:8: note: candidates are:
    In file included from net.cpp:10:0:
    ./net.h:742:5: note: CNetMessage::CNetMessage(CDataStream&&)
         CNetMessage(CDataStream&& recv_in) : m_recv(std::move(recv_in)) {}
         ^
    ./net.h:742:5: note:   no known conversion for argument 1 from ‘const CDataStream’ to ‘CDataStream&&’
    ./net.h:734:7: note: CNetMessage::CNetMessage(const CNetMessage&)
     class CNetMessage {
           ^
    ./net.h:734:7: note:   no known conversion for argument 1 from ‘const CDataStream’ to ‘const CNetMessage&’
    ./net.h:734:7: note: CNetMessage::CNetMessage(CNetMessage&&)
    ./net.h:734:7: note:   no known conversion for argument 1 from ‘const CDataStream’ to ‘CNetMessage&&’
    make[2]: *** [libbitcoin_server_a-net.o] Error 1
    make[2]: Leaving directory `/home/pjalajas/Documents/dev/hub/test/projects/bitcoincore/bitcoin-0.21.1/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/pjalajas/Documents/dev/hub/test/projects/bitcoincore/bitcoin-0.21.1/src'
    make: *** [all-recursive] Error 1
    
  6. fanquake commented at 5:26 AM on July 21, 2021: member

    Package boost-1.53.0

    That version of Boost is too old to build the 0.21 branch, Boost 1.58.0 or later is required. I'd suggest using depends if you'd like to compile Bitcoin Core on a system where it only packages very old versions of our dependencies.

  7. MarcoFalke added the label Upstream on Jul 21, 2021
  8. MarcoFalke commented at 7:58 AM on July 21, 2021: member

    @brad0 Did you try reporting this upstream? Reading the release notes, it appears they didn't intend to include braking changes in boost::fs 1.77 yet, unless I am missing something.

  9. pjsnps commented at 1:04 PM on July 21, 2021: none

    @fanquake worked like a charm, thanks!

     1786  2021-07-21 07:53:46 EDT Wed :: cd depends/
     1788  2021-07-21 07:54:04 EDT Wed :: make
     1789  2021-07-21 08:25:35 EDT Wed :: cd ..
     1793  2021-07-21 08:32:12 EDT Wed :: ./configure --prefix=/home/pjalajas/dev/hub/test/projects/bitcoincore/bitcoin-0.21.1/depends/x86_64-pc-linux-gnu && make test
     1794  2021-07-21 08:32:51 EDT Wed :: make
     1795  2021-07-21 09:01:06 EDT Wed :: history | tail -n 40
    
  10. hebasto commented at 9:12 AM on August 20, 2021: member

    With the following diff

    --- a/depends/packages/boost.mk
    +++ b/depends/packages/boost.mk
    @@ -1,8 +1,8 @@
     package=boost
    -$(package)_version=1_71_0
    +$(package)_version=1_77_0
     $(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(subst _,.,$($(package)_version))/source/
     $(package)_file_name=boost_$($(package)_version).tar.bz2
    -$(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee
    +$(package)_sha256_hash=fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854
     $(package)_dependencies=native_b2
     
     define $(package)_set_vars
    

    I can confirm the issue:

    wallet/test/init_test_fixture.cpp: In constructor ‘InitWalletDirTestingSetup::InitWalletDirTestingSetup(const string&)’:
    wallet/test/init_test_fixture.cpp:35:52: error: ‘std::map<std::__cxx11::basic_string<char>, boost::filesystem::path>::mapped_type’ {aka ‘class boost::filesystem::path’} has no member named ‘BOOST_FILESYSTEM_C_STR’
       35 |     std::ofstream f(m_walletdir_path_cases["file"].BOOST_FILESYSTEM_C_STR);
          |                                                    ^~~~~~~~~~~~~~~~~~~~~~
    make[2]: *** [Makefile:14782: wallet/test/test_test_bitcoin-init_test_fixture.o] Error 1
    
  11. hebasto commented at 9:35 AM on August 20, 2021: member

    @brad0 Did you try reporting this upstream? Reading the release notes, it appears they didn't intend to include braking changes in boost::fs 1.77 yet, unless I am missing something.

    FWIW, the change commit: https://github.com/boostorg/filesystem/commit/29ef7d683daeff81713eebb3dc17cb10e2dfc233

  12. fanquake closed this on Aug 26, 2021

  13. DrahtBot locked this on Aug 26, 2022

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-04-22 12:14 UTC

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