Opened 3 months ago

Last modified 2 months ago

#70336 new defect

wangle @2024.06.03.00: error: no matching constructor for initialization of 'std::function<LocalRefCount ()>'

Reported by: cooljeanius (Eric Gallager) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: barracuda156
Port: wangle

Description

Looks like a version incompatibility with folly:

[11/35] /usr/bin/clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_SHARED -DGFLAGS_IS_A_DLL=0 -DWANGLE_HAVE_SSL_SESSION_DUP -Dwangle_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_wangle/wangle/work/wangle-v2024.06.03.00/wangle/.. -isystem /opt/local/include -isystem /opt/local/libexec/boost/1.81/include -isystem /opt/local/libexec/openssl3/include -isystem /opt/local/include/libfmt10 -pipe -I/opt/local/libexec/openssl3/include -I/opt/local/libexec/boost/1.81/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -I/opt/local/libexec/boost/1.81/include -isystem/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -std=c++17 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -mmacosx-version-min=11.0 -fPIC -MD -MT CMakeFiles/wangle.dir/channel/FileRegion.cpp.o -MF CMakeFiles/wangle.dir/channel/FileRegion.cpp.o.d -o CMakeFiles/wangle.dir/channel/FileRegion.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_wangle/wangle/work/wangle-v2024.06.03.00/wangle/channel/FileRegion.cpp
FAILED: CMakeFiles/wangle.dir/channel/FileRegion.cpp.o 
/usr/bin/clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_SHARED -DGFLAGS_IS_A_DLL=0 -DWANGLE_HAVE_SSL_SESSION_DUP -Dwangle_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_wangle/wangle/work/wangle-v2024.06.03.00/wangle/.. -isystem /opt/local/include -isystem /opt/local/libexec/boost/1.81/include -isystem /opt/local/libexec/openssl3/include -isystem /opt/local/include/libfmt10 -pipe -I/opt/local/libexec/openssl3/include -I/opt/local/libexec/boost/1.81/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -I/opt/local/libexec/boost/1.81/include -isystem/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -std=c++17 -arch x86_64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -mmacosx-version-min=11.0 -fPIC -MD -MT CMakeFiles/wangle.dir/channel/FileRegion.cpp.o -MF CMakeFiles/wangle.dir/channel/FileRegion.cpp.o.d -o CMakeFiles/wangle.dir/channel/FileRegion.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_wangle/wangle/work/wangle-v2024.06.03.00/wangle/channel/FileRegion.cpp
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_wangle/wangle/work/wangle-v2024.06.03.00/wangle/channel/FileRegion.cpp:17:
In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_wangle/wangle/work/wangle-v2024.06.03.00/wangle/../wangle/channel/FileRegion.h:19:
In file included from /opt/local/include/folly/Singleton.h:134:
In file included from /opt/local/include/folly/concurrency/CoreCachedSharedPtr.h:27:
In file included from /opt/local/include/folly/synchronization/Hazptr.h:20:
In file included from /opt/local/include/folly/synchronization/HazptrDomain.h:29:
In file included from /opt/local/include/folly/synchronization/HazptrThrLocal.h:27:
In file included from /opt/local/include/folly/SingletonThreadLocal.h:25:
/opt/local/include/folly/ThreadLocal.h:64:9: error: no matching constructor for initialization of 'std::function<LocalRefCount ()>'
      : constructor_(std::forward<F>(constructor)) {}
        ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/folly/experimental/TLRefCount.h:30:9: note: in instantiation of function template specialization 'folly::ThreadLocal<folly::TLRefCount::LocalRefCount, folly::TLRefCount>::ThreadLocal<(lambda at /opt/local/include/folly/experimental/TLRefCount.h:30:21), 0>' requested here
      : localCount_([&]() { return LocalRefCount(*this); }),
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/functional:2365:5: note: candidate constructor not viable: no known conversion from '(lambda at /opt/local/include/folly/experimental/TLRefCount.h:30:21)' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument
    function(nullptr_t) _NOEXCEPT {}
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/functional:2366:5: note: candidate constructor not viable: no known conversion from '(lambda at /opt/local/include/folly/experimental/TLRefCount.h:30:21)' to 'const std::function<folly::TLRefCount::LocalRefCount ()>' for 1st argument
    function(const function&);
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/functional:2367:5: note: candidate constructor not viable: no known conversion from '(lambda at /opt/local/include/folly/experimental/TLRefCount.h:30:21)' to 'std::function<folly::TLRefCount::LocalRefCount ()>' for 1st argument
    function(function&&) _NOEXCEPT;
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/functional:2369:5: note: candidate template ignored: requirement '__callable<(lambda at /opt/local/include/folly/experimental/TLRefCount.h:30:21) &, true>::value' was not satisfied [with _Fp = (lambda at /opt/local/include/folly/experimental/TLRefCount.h:30:21)]
    function(_Fp);
    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/c++/v1/functional:2363:5: note: candidate constructor not viable: requires 0 arguments, but 1 was provided
    function() _NOEXCEPT { }
    ^
1 error generated.

I'm on x86_64 Big Sur (11.7.10) with Xcode 13.2.1; build fails both with trace mode and without.

Attachments (1)

main.log (234.1 KB) - added by cooljeanius (Eric Gallager) 3 months ago.
main.log for wangle

Download all attachments as: .zip

Change History (5)

Changed 3 months ago by cooljeanius (Eric Gallager)

Attachment: main.log added

main.log for wangle

comment:1 Changed 3 months ago by cooljeanius (Eric Gallager)

btw, my folly version info is:

$ port installed folly
The following ports are currently installed:
  folly @2024.06.03.00_0 (active)

comment:2 Changed 2 months ago by cooljeanius (Eric Gallager)

Note that this blocks upgrading of edencommon, fb303, fbthrift, and watchman for me.

comment:3 in reply to:  2 ; Changed 2 months ago by barracuda156

Replying to cooljeanius:

Note that this blocks upgrading of edencommon, fb303, fbthrift, and watchman for me.

Thank you for reporting. Could you check if it builds with LLVM clang? You could change {clang < 1200} in the portfile to {clang}, that should switch it away from Xcode clang to LLVM. (I cannot check locally, and there is no CI for Big Sur.)

This is likely an upstream bug, but they do not seem to bother fixing anything.

comment:4 in reply to:  3 Changed 2 months ago by cooljeanius (Eric Gallager)

Replying to barracuda156:

Replying to cooljeanius:

Note that this blocks upgrading of edencommon, fb303, fbthrift, and watchman for me.

Thank you for reporting. Could you check if it builds with LLVM clang? You could change {clang < 1200} in the portfile to {clang}, that should switch it away from Xcode clang to LLVM.

This seems to work; would you like to submit a PR with this change, or should I?

Note: See TracTickets for help on using tickets.