build: work around issue with Boost <= 1.80 and Clang >= 18 #30821

pull fanquake wants to merge 1 commits into bitcoin:master from fanquake:boost_174_clang_18 changing 1 files +10 −0
  1. fanquake commented at 1:24 PM on September 5, 2024: member

    Our current minimum supported Boost is 1.73.0. However, when compiling with Boost 1.74.0 (Debian Stable), using Clang 18, compilation fails with:

    In file included from /usr/include/boost/mpl/integral_c.hpp:32:
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
       73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
          |                               ^
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    In file included from ../../../src/test/validation_chainstatemanager_tests.cpp:8:
    In file included from ../../../src/node/chainstatemanager_args.h:9:
    In file included from ../../../src/validation.h:28:
    In file included from ../../../src/txmempool.h:26:
    In file included from /usr/include/boost/multi_index/hashed_index.hpp:38:
    In file included from /usr/include/boost/multi_index/detail/node_handle.hpp:22:
    In file included from /usr/include/boost/multi_index_container_fwd.hpp:18:
    In file included from /usr/include/boost/multi_index/indexed_by.hpp:17:
    In file included from /usr/include/boost/mpl/vector.hpp:36:
    In file included from /usr/include/boost/mpl/vector/vector20.hpp:18:
    In file included from /usr/include/boost/mpl/vector/vector10.hpp:18:
    In file included from /usr/include/boost/mpl/vector/vector0.hpp:24:
    In file included from /usr/include/boost/mpl/vector/aux_/clear.hpp:18:
    In file included from /usr/include/boost/mpl/vector/aux_/vector0.hpp:22:
    In file included from /usr/include/boost/mpl/vector/aux_/iterator.hpp:19:
    In file included from /usr/include/boost/mpl/plus.hpp:19:
    In file included from /usr/include/boost/mpl/aux_/arithmetic_op.hpp:17:
    In file included from /usr/include/boost/mpl/integral_c.hpp:32:
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'int_float_mixture_enum' [-Wenum-constexpr-conversion]
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    2 errors generated.
    

    Work around this issue by ignoring this diagnostic for this include. I did attempt to just downgrade the error into a warning, but that did not seem to work. Not a huge fan of inline warning/issue suppression, but this seems like the cleanest thing to do here (and easy to backport to 28.x).

    Can be tested with something like:

    docker pull debian:bookworm
    docker run -it debian:bookworm /bin/bash
    
    apt update &&  apt install ccache cmake git pkg-config libboost-dev libevent-dev python3 libsqlite3-dev lsb-release wget software-properties-common gnupg
    git clone https://github.com/bitcoin/bitcoin
    
    wget https://apt.llvm.org/llvm.sh
    chmod +x llvm.sh
    ./llvm.sh 18
    
    cd bitcoin
    cmake -B build -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18
    cmake --build build -j17
    <snip>
    In file included from /usr/include/boost/mpl/integral_c.hpp:32:
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'int_float_mixture_enum' [-Wenum-constexpr-conversion]
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    2 errors generated.
    
    Apply the patch
    
    cmake --build build -j17
    ctest --test-dir build -j17
    

    Fixes #30751.

  2. DrahtBot commented at 1:24 PM on September 5, 2024: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK hebasto, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Build system on Sep 5, 2024
  4. fanquake added the label Needs backport (28.x) on Sep 5, 2024
  5. fanquake added this to the milestone 28.0 on Sep 5, 2024
  6. build: work around issue with Boost <= 1.80 and Clang >= 18
    Our current minimum supported Boost is `1.73.0`. However, when compiling
    with Boost `1.74.0` (Debian Stable), using Clang `18`, compilation fails
    with:
    ```bash
    In file included from /usr/include/boost/mpl/integral_c.hpp:32:
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum' [-Wenum-constexpr-conversion]
       73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
          |                               ^
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    In file included from ../../../src/test/validation_chainstatemanager_tests.cpp:8:
    In file included from ../../../src/node/chainstatemanager_args.h:9:
    In file included from ../../../src/validation.h:28:
    In file included from ../../../src/txmempool.h:26:
    In file included from /usr/include/boost/multi_index/hashed_index.hpp:38:
    In file included from /usr/include/boost/multi_index/detail/node_handle.hpp:22:
    In file included from /usr/include/boost/multi_index_container_fwd.hpp:18:
    In file included from /usr/include/boost/multi_index/indexed_by.hpp:17:
    In file included from /usr/include/boost/mpl/vector.hpp:36:
    In file included from /usr/include/boost/mpl/vector/vector20.hpp:18:
    In file included from /usr/include/boost/mpl/vector/vector10.hpp:18:
    In file included from /usr/include/boost/mpl/vector/vector0.hpp:24:
    In file included from /usr/include/boost/mpl/vector/aux_/clear.hpp:18:
    In file included from /usr/include/boost/mpl/vector/aux_/vector0.hpp:22:
    In file included from /usr/include/boost/mpl/vector/aux_/iterator.hpp:19:
    In file included from /usr/include/boost/mpl/plus.hpp:19:
    In file included from /usr/include/boost/mpl/aux_/arithmetic_op.hpp:17:
    In file included from /usr/include/boost/mpl/integral_c.hpp:32:
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'int_float_mixture_enum' [-Wenum-constexpr-conversion]
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    2 errors generated.
    ```
    
    Work around this issue by ignoring this diagnostic for this include.
    I did attempt to just downgrade the error into a warning, but that did
    not seem to work.
    
    See https://github.com/bitcoin/bitcoin/issues/30751 for further
    discussion.
    cd062d6684
  7. in src/txmempool.h:29 in 3f6092a671 outdated
      22 | @@ -23,7 +23,13 @@
      23 |  #include <util/result.h>
      24 |  #include <util/feefrac.h>
      25 |  
      26 | +// This works around a bug in Boost <= 1.80.0 when using Clang >=18.
      27 | +// See https://github.com/bitcoin/bitcoin/issues/30751.
      28 | +#pragma clang diagnostic push
    


    TheCharlatan commented at 1:43 PM on September 5, 2024:

    Should this be in a #if defined(__clang__) block?


    fanquake commented at 1:44 PM on September 5, 2024:

    A bit annoying, but yea, looks like we'll need something like that to work around the windows compiler in any case.


    fanquake commented at 1:48 PM on September 5, 2024:

    (depending on what GCC does, over the lifetime of the 28.x branch, at some point, it may turn in an #ifndef MSVC etc)

  8. fanquake force-pushed on Sep 5, 2024
  9. hebasto approved
  10. hebasto commented at 3:15 PM on September 5, 2024: member

    ACK cd062d6684908d526be7423f8f1057b891254a3c, tested on Fedora 40 using the downloaded Boost 1.74 and commands as follows:

    $ cmake -B build -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DBoost_INCLUDE_DIR=/home/hebasto/boost_1_74_0
    $ cmake --build build -t test_bitcoin
    
  11. achow101 commented at 7:30 PM on September 5, 2024: member

    ACK cd062d6684908d526be7423f8f1057b891254a3c

    Tested against Boost 1.73 and Clang 18.1.8 and the error was no longer present.

  12. achow101 merged this on Sep 5, 2024
  13. achow101 closed this on Sep 5, 2024

  14. achow101 referenced this in commit 9fc044e9a6 on Sep 5, 2024
  15. maflcko commented at 7:38 AM on September 6, 2024: member

    Can you explain this change a bit better?

    The warning will be turned into a hard error in a follow-up release to clang 18.

    Testing with clang-20 shows a new warning, according to the release notes https://github.com/llvm/llvm-project/pull/102364/files#diff-ec770381d76c859f5f572db789175fe44410a72608f58ad5dbb14335ba56eb97R138

    In file included from /b-c/src/rest.cpp:22:
    In file included from /b-c/src/rpc/blockchain.h:13:
    In file included from /b-c/src/validation.h:28:
    /b-c/src/txmempool.h:30:34: warning: unknown warning group '-Wenum-constexpr-conversion', ignored [-Wunknown-warning-option]
       30 | #pragma clang diagnostic ignored "-Wenum-constexpr-conversion"
          |                                  ^
    1 warning generated.
    

    The same change also seems to imply that this specific instance is a bug in clang, not in boost. (My understanding is that -1 is a valid value of type int, assuming this is the underlying enum type, even though -1 isn't explicitly named in the enum list)

    It may be better if the patch only worked around the clang versions that have the warning enabled (and at the same time are buggy). Otherwise, people will just complain about another warning that pops up instead when using a different version of clang.

    An alternative may be to just revert this patch and instead document that this specific combination is unsupported.

    Anyone really wanting to use those previous versions of boost may do so in combination with GCC, or a non-buggy version of Clang.

    If they really want to use an affected Clang, they can use a more recent boost from ./depends or any other source.

  16. fanquake deleted the branch on Sep 6, 2024
  17. fanquake commented at 11:08 AM on September 6, 2024: member

    I had hoped we'd be able to land this workaround for 28.x (to atleast avoid compile failures, without any other changes to other dependency or compiler requirements), and then remove it in master fairly soon, by following up with either a wholesale bump to our minimum required Boost, to 1.81.0+, or I guess a clang-18+ restriction to using Boost 1.81.0+.

    I re-tested master (including this change) using Boost 1.74.0:

    • clang-18 builds with no output
    • clang-19 builds with no output (unrelated to this change, there is deprecated decleration output from libstdc++)
    • clang 20 produces warning output for the pragma, and then fails to compile

    So I'm not sure if there is some range of Clang versions we can restrict any workaround too, as, once using clang-20 or later, with Boost <= 1.81.0, this will become a hard failure, with no easy workaround. I'm also not sure if we can continue to rely on GCC going forward (maybe until 15.x ?), although that's not clear from the upstream issue.

  18. maflcko commented at 12:55 PM on September 6, 2024: member

    clang 20 produces warning output for the pragma, and then fails to compile

    Are you sure? Compilation did pass for me this morning. Do you still happen to have the compile failure or steps to reproduce?

  19. fanquake commented at 1:17 PM on September 6, 2024: member

    Do you still happen to have the compile failure or steps to reproduce?

    Using this Clang:

    clang++-20 --version
    Debian clang version 20.0.0 (++20240903115437+0748f4227cd6-1~exp1~20240903115620.935)
    Target: x86_64-pc-linux-gnu
    Thread model: posix
    InstalledDir: /usr/lib/llvm-20/bin
    

    and master (bbf95c0cc57147827b9f4577c641b12dd4170e78). I see:

    cmake -B build -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20
    cmake --build build --verbose
    <snip>
    [ 72%] Building CXX object src/test/CMakeFiles/test_bitcoin.dir/validation_chainstatemanager_tests.cpp.o
    cd /bitcoin/build/src/test && /usr/bin/ccache /usr/bin/clang++-20 -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_NO_CXX98_FUNCTION_BASE -I/bitcoin/build/src -I/bitcoin/src -I/bitcoin/src/univalue/include -I/bitcoin/src/minisketch/include -I/bitcoin/src/secp256k1/include -O2 -g -fPIE -fdebug-prefix-map=/bitcoin=. -fmacro-prefix-map=/bitcoin=. -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wimplicit-fallthrough -Wunreachable-code -Wdocumentation -Wself-assign -Wundef -Wno-unused-parameter -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -Wstack-protector -fstack-protector-all -fcf-protection=full -fstack-clash-protection -std=c++20 -MD -MT src/test/CMakeFiles/test_bitcoin.dir/validation_chainstatemanager_tests.cpp.o -MF CMakeFiles/test_bitcoin.dir/validation_chainstatemanager_tests.cpp.o.d -o CMakeFiles/test_bitcoin.dir/validation_chainstatemanager_tests.cpp.o -c /bitcoin/src/test/validation_chainstatemanager_tests.cpp  
    In file included from /bitcoin/src/test/validation_chainstatemanager_tests.cpp:8:
    In file included from /bitcoin/src/node/chainstatemanager_args.h:9:
    In file included from /bitcoin/src/validation.h:28:
    /bitcoin/src/txmempool.h:30:34: warning: unknown warning group '-Wenum-constexpr-conversion', ignored [-Wunknown-warning-option]
       30 | #pragma clang diagnostic ignored "-Wenum-constexpr-conversion"
          |                                  ^
    In file included from /bitcoin/src/test/validation_chainstatemanager_tests.cpp:8:
    In file included from /bitcoin/src/node/chainstatemanager_args.h:9:
    In file included from /bitcoin/src/validation.h:28:
    In file included from /bitcoin/src/txmempool.h:32:
    In file included from /usr/include/boost/multi_index/hashed_index.hpp:38:
    In file included from /usr/include/boost/multi_index/detail/node_handle.hpp:22:
    In file included from /usr/include/boost/multi_index_container_fwd.hpp:18:
    In file included from /usr/include/boost/multi_index/indexed_by.hpp:17:
    In file included from /usr/include/boost/mpl/vector.hpp:36:
    In file included from /usr/include/boost/mpl/vector/vector20.hpp:18:
    In file included from /usr/include/boost/mpl/vector/vector10.hpp:18:
    In file included from /usr/include/boost/mpl/vector/vector0.hpp:24:
    In file included from /usr/include/boost/mpl/vector/aux_/clear.hpp:18:
    In file included from /usr/include/boost/mpl/vector/aux_/vector0.hpp:22:
    In file included from /usr/include/boost/mpl/vector/aux_/iterator.hpp:19:
    In file included from /usr/include/boost/mpl/plus.hpp:19:
    In file included from /usr/include/boost/mpl/aux_/arithmetic_op.hpp:17:
    In file included from /usr/include/boost/mpl/integral_c.hpp:32:
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: error: non-type template argument is not a constant expression
       73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
          |             ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    /usr/include/boost/mpl/integral_c.hpp:31:54: note: expanded from macro 'AUX_WRAPPER_INST'
       31 | #define AUX_WRAPPER_INST(value) AUX_WRAPPER_NAME< T, value >
          |                                                      ^~~~~
    /usr/include/boost/numeric/conversion/detail/meta.hpp:30:46: note: in instantiation of template class 'mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>' requested here
       30 |        enum { x = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value == BOOST_MPL_AUX_VALUE_WKND(T2)::value ) };
          |                                              ^
    /usr/include/boost/mpl/if.hpp:63:68: note: in instantiation of template class 'boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>>' requested here
       63 |           BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(T1)::value)
          |                                                                    ^
    /usr/include/boost/mpl/eval_if.hpp:37:22: note: in instantiation of template class 'boost::mpl::if_<boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>>, boost::mpl::identity<boost::numeric::convdetail::get_subranged_BuiltIn2BuiltIn<unsigned long, double>>, boost::mpl::eval_if<boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_udt>>, boost::mpl::identity<boost::mpl::identity<boost::numeric::convdetail::subranged_BuiltIn2Udt<unsigned long, double>>>, boost::mpl::if_<boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::udt_to_builtin>>, boost::mpl::identity<boost::numeric::convdetail::subranged_Udt2BuiltIn<unsigned long, double>>, boost::mpl::identity<boost::numeric::convdetail::subranged_Udt2Udt<unsigned long, double>>>>>' requested here
       37 |     typedef typename if_<C,F1,F2>::type f_;
          |                      ^
    /usr/include/boost/numeric/conversion/detail/meta.hpp:81:12: note: in instantiation of template class 'boost::mpl::eval_if<boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>>, boost::mpl::identity<boost::numeric::convdetail::get_subranged_BuiltIn2BuiltIn<unsigned long, double>>, boost::mpl::eval_if<boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_udt>>, boost::mpl::identity<boost::mpl::identity<boost::numeric::convdetail::subranged_BuiltIn2Udt<unsigned long, double>>>, boost::mpl::if_<boost::numeric::convdetail::equal_to<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::udt_to_builtin>>, boost::mpl::identity<boost::numeric::convdetail::subranged_Udt2BuiltIn<unsigned long, double>>, boost::mpl::identity<boost::numeric::convdetail::subranged_Udt2Udt<unsigned long, double>>>>>' requested here
       81 |       mpl::eval_if<is_case0,Case0TypeQ,choose_1_2_3Q>::type
          |            ^
    /usr/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp:41:7: note: in instantiation of template class 'boost::numeric::convdetail::ct_switch4<mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_builtin>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::builtin_to_udt>, mpl_::integral_c<boost::numeric::udt_builtin_mixture_enum, boost::numeric::udt_to_builtin>, boost::numeric::convdetail::get_subranged_BuiltIn2BuiltIn<unsigned long, double>, boost::mpl::identity<boost::numeric::convdetail::subranged_BuiltIn2Udt<unsigned long, double>>, boost::mpl::identity<boost::numeric::convdetail::subranged_Udt2BuiltIn<unsigned long, double>>, boost::mpl::identity<boost::numeric::convdetail::subranged_Udt2Udt<unsigned long, double>>>' requested here
       41 |       ct_switch4<UdtMixture
          |       ^
    /usr/include/boost/numeric/conversion/detail/is_subranged.hpp:205:9: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
      205 |         for_udt_builtin_mixture<udt_builtin_mixture, BuiltIn2BuiltInQ, BuiltIn2UdtQ, Udt2BuiltInQ, Udt2UdtQ>::type
          |         ^
    /usr/include/boost/numeric/conversion/conversion_traits.hpp:22:7: note: in instantiation of template class 'boost::numeric::convdetail::non_trivial_traits_impl<unsigned long, double>' requested here
       22 |     : convdetail::get_conversion_traits<T,S>::type 
          |       ^
    /usr/include/boost/test/tools/old/impl.hpp:284:31: note: in instantiation of template class 'boost::numeric::conversion_traits<unsigned long, double>' requested here
      284 |     typedef typename numeric::conversion_traits<FPT1,FPT2>::supertype type;
          |                               ^
    /usr/include/boost/test/tools/old/impl.hpp:304:53: note: in instantiation of template class 'boost::test_tools::tt_detail::comp_supertype<unsigned long, double>' requested here
      304 |         fpc::close_at_tolerance<typename tt_detail::comp_supertype<FPT1,FPT2>::type> pred( tolerance, fpc::FPC_STRONG );
          |                                                     ^
    /usr/include/boost/test/tools/old/impl.hpp:92:50: note: in instantiation of function template specialization 'boost::test_tools::check_is_close_t::operator()<unsigned long, double, boost::math::fpc::percent_tolerance_t<int>>' requested here
       92 | BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
          |                                                  ^
    /usr/include/boost/preprocessor/repetition/repeat.hpp:29:26: note: expanded from macro 'BOOST_PP_REPEAT'
       29 | # define BOOST_PP_REPEAT BOOST_PP_CAT(BOOST_PP_REPEAT_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
          |                          ^
    /usr/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
       22 | #    define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
          |                                ^
    /usr/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
       29 | #    define BOOST_PP_CAT_I(a, b) a ## b
          |                                  ^
    <scratch space>:160:1: note: expanded from here
      160 | BOOST_PP_REPEAT_1
          | ^
    /bitcoin/src/test/validation_chainstatemanager_tests.cpp:158:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::check_is_close_t, unsigned long, double, boost::math::fpc::percent_tolerance_t<int>>' requested here
      158 |     BOOST_CHECK_CLOSE(c1.m_coinstip_cache_size_bytes, max_cache * 0.05, 1);
          |     ^
    /usr/include/boost/test/tools/old/interface.hpp:208:45: note: expanded from macro 'BOOST_CHECK_CLOSE'
      208 | #define BOOST_CHECK_CLOSE( L, R, T )        BOOST_TEST_TOOL_IMPL( 0, \
          |                                             ^
    /usr/include/boost/test/tools/old/interface.hpp:67:47: note: expanded from macro 'BOOST_TEST_TOOL_IMPL'
       67 |     BOOST_PP_IF( frwd_type, report_assertion, check_frwd ) (                    \
          |                                               ^
    /usr/include/boost/mpl/aux_/integral_wrapper.hpp:73:31: note: integer value -1 is outside the valid range of values [0, 3] for the enumeration type 'udt_builtin_mixture_enum'
       73 |     typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
          |                               ^
    /usr/include/boost/mpl/aux_/static_cast.hpp:24:47: note: expanded from macro 'BOOST_MPL_AUX_STATIC_CAST'
       24 | #   define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
          |                                               ^
    In file included from /bitcoin/src/test/validation_chainstatemanager_tests.cpp:29:
    In file included from /usr/include/boost/test/unit_test.hpp:18:
    In file included from /usr/include/boost/test/test_tools.hpp:46:
    /usr/include/boost/test/tools/old/impl.hpp:285:30: error: static assertion failed due to requirement '!is_integral<unsigned long>::value': Only floating-point types can be compared!
      285 |     BOOST_STATIC_ASSERT_MSG( !is_integral<type>::value, "Only floating-point types can be compared!");
          |                              ^~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/boost/static_assert.hpp:31:59: note: expanded from macro 'BOOST_STATIC_ASSERT_MSG'
       31 | #     define BOOST_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__)
          |                                                           ^~~~~~~~~~~
    /usr/include/boost/test/tools/old/impl.hpp:304:53: note: in instantiation of template class 'boost::test_tools::tt_detail::comp_supertype<unsigned long, double>' requested here
      304 |         fpc::close_at_tolerance<typename tt_detail::comp_supertype<FPT1,FPT2>::type> pred( tolerance, fpc::FPC_STRONG );
          |                                                     ^
    /usr/include/boost/test/tools/old/impl.hpp:92:50: note: in instantiation of function template specialization 'boost::test_tools::check_is_close_t::operator()<unsigned long, double, boost::math::fpc::percent_tolerance_t<int>>' requested here
       92 | BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
          |                                                  ^
    /usr/include/boost/preprocessor/repetition/repeat.hpp:29:26: note: expanded from macro 'BOOST_PP_REPEAT'
       29 | # define BOOST_PP_REPEAT BOOST_PP_CAT(BOOST_PP_REPEAT_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
          |                          ^
    /usr/include/boost/preprocessor/cat.hpp:22:32: note: expanded from macro 'BOOST_PP_CAT'
       22 | #    define BOOST_PP_CAT(a, b) BOOST_PP_CAT_I(a, b)
          |                                ^
    /usr/include/boost/preprocessor/cat.hpp:29:34: note: expanded from macro 'BOOST_PP_CAT_I'
       29 | #    define BOOST_PP_CAT_I(a, b) a ## b
          |                                  ^
    <scratch space>:160:1: note: expanded from here
      160 | BOOST_PP_REPEAT_1
          | ^
    /bitcoin/src/test/validation_chainstatemanager_tests.cpp:158:5: note: in instantiation of function template specialization 'boost::test_tools::tt_detail::check_frwd<boost::test_tools::check_is_close_t, unsigned long, double, boost::math::fpc::percent_tolerance_t<int>>' requested here
      158 |     BOOST_CHECK_CLOSE(c1.m_coinstip_cache_size_bytes, max_cache * 0.05, 1);
          |     ^
    /usr/include/boost/test/tools/old/interface.hpp:208:45: note: expanded from macro 'BOOST_CHECK_CLOSE'
      208 | #define BOOST_CHECK_CLOSE( L, R, T )        BOOST_TEST_TOOL_IMPL( 0, \
          |                                             ^
    /usr/include/boost/test/tools/old/interface.hpp:67:47: note: expanded from macro 'BOOST_TEST_TOOL_IMPL'
       67 |     BOOST_PP_IF( frwd_type, report_assertion, check_frwd ) (                    \
          |                                               ^
    1 warning and 2 errors generated.
    gmake[2]: *** [src/test/CMakeFiles/test_bitcoin.dir/build.make:1638: src/test/CMakeFiles/test_bitcoin.dir/validation_chainstatemanager_tests.cpp.o] Error 1
    gmake[2]: Leaving directory '/bitcoin/build'
    gmake[1]: *** [CMakeFiles/Makefile2:2143: src/test/CMakeFiles/test_bitcoin.dir/all] Error 2
    gmake[1]: Leaving directory '/bitcoin/build'
    gmake: *** [Makefile:146: all] Error 2
    
  20. maflcko commented at 1:22 PM on September 6, 2024: member

    Ok, I may have only compiled bitcoind. If the error is only in the tests, I wonder if the tests can simply be rewritten. I'll take another look later.

  21. maflcko commented at 1:59 PM on September 6, 2024: member

    I still haven't tested this, but the draft at #30834 may or may not work around the test compilation error.

  22. maflcko removed the label Needs backport (28.x) on Sep 9, 2024
  23. TheCharlatan referenced this in commit 69282950aa on Sep 16, 2024
  24. TheCharlatan referenced this in commit dfe0cd4ec5 on Sep 16, 2024
  25. bitcoin locked this on Sep 9, 2025

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-01 15:13 UTC

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