Homebrew Boost 1.78 breaks external signer configure #24413

issue Sjors opened this issue on February 22, 2022
  1. Sjors commented at 9:46 AM on February 22, 2022: member

    Test on macOS 12.2.1 against the master branch. #24397 doesn't fix it.

    brew info boost
    boost: stable 1.78.0 (bottled), HEAD
    ...
    ./configure --enable-external-signer
    ...
    checking for boostlib >= 1.64.0 (106400)... yes
    checking whether Boost.Process can be used... no
    configure: error: External signing is not supported for this Boost version
    

    It does work with boost 1.76 (there was no 1.77 release in home-brew):

    brew install boost@1.76
    ...
    LDFLAGS="-L/usr/local/opt/boost@1.76/lib" CPPFLAGS="-I/usr/local/opt/boost@1.76/include" ./configure --enable-external-signer
    ...
    checking for boostlib >= 1.64.0 (106400)... yes
    checking whether Boost.Process can be used... yes
    ...
    Options used to compile and link:
      external signer = yes
    

    There's nothing in the release notes about Boost.Process for either 1.77 or 1.78.

    The Homebrew formula changes are nothing but a trivial version and hash bump.

  2. Sjors added the label Bug on Feb 22, 2022
  3. fanquake commented at 9:49 AM on February 22, 2022: member

    The configure check is failing because of this issue: https://github.com/boostorg/process/issues/235

    configure:32793: checking whether Boost.Process can be used
    configure:32806: g++ -std=c++17 -o conftest -g -O2  -DHAVE_BUILD_INFO -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -DPROVIDE_FUZZ_MAIN_FUNCTION  -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-dead_strip_dylibs conftest.cpp  >&5
    In file included from conftest.cpp:77:
    In file included from /usr/local/include/boost/process.hpp:24:
    In file included from /usr/local/include/boost/process/async_system.hpp:22:
    In file included from /usr/local/include/boost/process/child.hpp:22:
    In file included from /usr/local/include/boost/process/detail/execute_impl.hpp:24:
    /usr/local/include/boost/process/detail/posix/executor.hpp:156:36: error: non-constant-expression cannot be narrowed from type 'unsigned long' to 'int' in initializer list [-Wc++11-narrowing]
            int data[2] = {ec.value(), len + 1};
                                       ^~~~~~~
    /usr/local/include/boost/process/detail/posix/executor.hpp:156:36: note: insert an explicit cast to silence this issue
            int data[2] = {ec.value(), len + 1};
                                       ^~~~~~~
                                       static_cast<int>( )
    1 error generated.
    
  4. fanquake added the label macOS on Feb 22, 2022
  5. Sjors commented at 9:51 AM on February 22, 2022: member

    Ok, we should probably just document the workaround and point to this issue for when the upstream fix is ready and released.

  6. Sjors referenced this in commit a06778db91 on Feb 22, 2022
  7. Sjors referenced this in commit 41070db010 on Feb 22, 2022
  8. hebasto commented at 10:25 AM on February 22, 2022: member

    Fixed in #24415.

  9. hebasto commented at 12:39 PM on February 22, 2022: member

    Interesting that "macOS 12 native" CI task still install boost 1.76.0.

  10. Sjors commented at 12:41 PM on February 22, 2022: member

    Probably because it doesn't run brew update (which is very slow).

  11. Sjors commented at 12:46 PM on February 22, 2022: member

    It might make sense to have the CI run brew update && brew upgrade on the master branch one per month, or something like that. Or manually reset the cache on that schedule. cc @MarcoFalke

  12. hebasto commented at 12:48 PM on February 22, 2022: member

    It might make sense to have the CI run brew update && brew upgrade on the master branch one per month, or something like that. Or manually reset the cache on that schedule. cc @MarcoFalke

    Related: https://github.com/cirruslabs/cirrus-ci-docs/issues/878

  13. luke-jr commented at 1:00 AM on March 10, 2022: member

    [-Wc++11-narrowing]

    Why is this warning being treated as an error in the configure check?

    Did you perhaps set C*FLAGS to include -Werror explicitly?

  14. fanquake commented at 10:09 AM on March 10, 2022: member

    Why is this warning being treated as an error in the configure check?

    It's being treated as an error because Clang treats it as an error:

    int main() {
    	auto a = 10.0;
    	int b = {a + 1};
    	return 0;
    }
    

    If I compile this with LLVM Clang 13.0.1:

    /usr/local/opt/llvm/bin/clang++ --version               
    Homebrew clang version 13.0.1
    ...
    /usr/local/opt/llvm/bin/clang++ -std=c++17 narrowing.cpp                                                                  
    narrowing.cpp:3:11: error: type 'double' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
            int b = {a + 1};
                     ^~~~~
    narrowing.cpp:3:11: note: insert an explicit cast to silence this issue
            int b = {a + 1};
                     ^~~~~
                     static_cast<int>( )
    1 error generated.
    

    or Apple Clang 13:

    clang++ --version               
    Apple clang version 13.0.0 (clang-1300.0.29.30)
    ...
    clang++ -std=c++17 narrowing.cpp
    narrowing.cpp:3:11: error: type 'double' cannot be narrowed to 'int' in initializer list [-Wc++11-narrowing]
            int b = {a + 1};
                     ^~~~~
    narrowing.cpp:3:11: note: insert an explicit cast to silence this issue
            int b = {a + 1};
                     ^~~~~
                     static_cast<int>( )
    1 error generated.
    

    GCC 11 warns but does not error:

    /usr/local/opt/gcc@11/bin/gcc-11 --version               
    gcc-11 (Homebrew GCC 11.2.0_3) 11.2.0
    ...
    /usr/local/opt/gcc@11/bin/gcc-11 -std=c++17 narrowing.cpp
    narrowing.cpp: In function 'int main()':
    narrowing.cpp:3:20: warning: narrowing conversion of '(a + (double)1)' from 'double' to 'int' [-Wnarrowing]
        3 |         int b = {a + 1};
          |                  ~~^~~
    

    There's no user error here, unless it's an error to install a newer compiler.

  15. hebasto commented at 12:20 PM on March 10, 2022: member

    Interesting that there are no issues with upgrading boost from 1.76 to 1.78 on macOS arm64 (assuming ##24521).

  16. laanwj closed this on Mar 29, 2022

  17. sidhujag referenced this in commit dd7ed96fc1 on Apr 3, 2022
  18. DrahtBot locked this on Mar 29, 2023

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:14 UTC

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