Homebrew Boost 1.78 breaks external signer configure #24413

issue Sjors openend 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.

    0brew info boost
    1boost: stable 1.78.0 (bottled), HEAD
    2...
    3./configure --enable-external-signer
    4...
    5checking for boostlib >= 1.64.0 (106400)... yes
    6checking whether Boost.Process can be used... no
    7configure: 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):

    0brew install boost@1.76
    1...
    2LDFLAGS="-L/usr/local/opt/boost@1.76/lib" CPPFLAGS="-I/usr/local/opt/boost@1.76/include" ./configure --enable-external-signer
    3...
    4checking for boostlib >= 1.64.0 (106400)... yes
    5checking whether Boost.Process can be used... yes
    6...
    7Options used to compile and link:
    8  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

     0configure:32793: checking whether Boost.Process can be used
     1configure: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
     2In file included from conftest.cpp:77:
     3In file included from /usr/local/include/boost/process.hpp:24:
     4In file included from /usr/local/include/boost/process/async_system.hpp:22:
     5In file included from /usr/local/include/boost/process/child.hpp:22:
     6In file included from /usr/local/include/boost/process/detail/execute_impl.hpp:24:
     7/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]
     8        int data[2] = {ec.value(), len + 1};
     9                                   ^~~~~~~
    10/usr/local/include/boost/process/detail/posix/executor.hpp:156:36: note: insert an explicit cast to silence this issue
    11        int data[2] = {ec.value(), len + 1};
    12                                   ^~~~~~~
    13                                   static_cast<int>( )
    141 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:

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

    If I compile this with LLVM Clang 13.0.1:

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

    or Apple Clang 13:

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

    GCC 11 warns but does not error:

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

    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: 2024-07-08 22:13 UTC

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