Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removal of deprecated std::unary_function in libcxx 16 #114

Closed
traversaro opened this issue Mar 29, 2023 · 7 comments
Closed

removal of deprecated std::unary_function in libcxx 16 #114

traversaro opened this issue Mar 29, 2023 · 7 comments
Labels

Comments

@traversaro
Copy link

Comment:

The recently released libcxx 16 causes a regression in boost 1.78 container_hash, result in errors such as:

2023-03-29T13:21:42.8417150Z /Users/runner/miniconda3/envs/test/bin/x86_64-apple-darwin13.4.0-clang++ -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_DATE_TIME_DYN_LINK -DBOOST_DATE_TIME_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_IOSTREAMS_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 -DDART_ACTIVE_LOG_LEVEL=2 -DDART_HAVE_spdlog=1 -DFMT_HEADER_ONLY=1 -DFMT_SHARED -DLIBBULLET_VERSION=3.20 -DLIBBULLET_VERSION_GT_282 -DSPDLOG_FMT_EXTERNAL -Dgazebo_yarp_singleton_EXPORTS -I/Users/runner/work/gazebo-yarp-plugins/gazebo-yarp-plugins/libraries/singleton/include/GazeboYarpPlugins -I/Users/runner/work/gazebo-yarp-plugins/gazebo-yarp-plugins/libraries/singleton/include -isystem /Users/runner/miniconda3/envs/test/include/gazebo-11 -isystem /Users/runner/miniconda3/envs/test/include/bullet -isystem /Users/runner/miniconda3/envs/test/include/simbody -isystem /Users/runner/miniconda3/envs/test/include/sdformat-9.8 -isystem /Users/runner/miniconda3/envs/test/include/ignition/math6 -isystem /Users/runner/miniconda3/envs/test/include/OGRE -isystem /Users/runner/miniconda3/envs/test/include/OGRE/OSX -isystem /Users/runner/miniconda3/envs/test/include/OGRE/Bites -isystem /Users/runner/miniconda3/envs/test/include/SDL2 -isystem /Users/runner/miniconda3/envs/test/include/OGRE/HLMS -isystem /Users/runner/miniconda3/envs/test/include/OGRE/MeshLodGenerator -isystem /Users/runner/miniconda3/envs/test/include/OGRE/Overlay -isystem /Users/runner/miniconda3/envs/test/include/OGRE/Paging -isystem /Users/runner/miniconda3/envs/test/include/OGRE/Property -isystem /Users/runner/miniconda3/envs/test/include/OGRE/RTShaderSystem -isystem /Users/runner/miniconda3/envs/test/include/OGRE/Terrain -isystem /Users/runner/miniconda3/envs/test/include/OGRE/Volume -isystem /Users/runner/miniconda3/envs/test/include/ignition/transport8 -isystem /Users/runner/miniconda3/envs/test/include/ignition/msgs5 -isystem /Users/runner/miniconda3/envs/test/include/ignition/common3 -isystem /Users/runner/miniconda3/envs/test/include/ignition/fuel_tools4 -isystem /Users/runner/miniconda3/envs/test/include/eigen3 -isystem /Users/runner/miniconda3/envs/test/include/sdformat-9.8/sdf/.. -isystem /Users/runner/miniconda3/envs/test/include/ignition/cmake2 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -fmessage-length=0 -isystem /Users/runner/miniconda3/envs/test/include -O3 -DNDEBUG -std=gnu++17 -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -fPIC -mfpmath=sse -msse -msse2 -msse3 -mssse3 -MD -MT libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/Handler.cc.o -MF libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/Handler.cc.o.d -o libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/Handler.cc.o -c /Users/runner/work/gazebo-yarp-plugins/gazebo-yarp-plugins/libraries/singleton/src/Handler.cc
2023-03-29T13:21:42.8523790Z In file included from /Users/runner/work/gazebo-yarp-plugins/gazebo-yarp-plugins/libraries/singleton/src/Handler.cc:7:
2023-03-29T13:21:42.8626500Z In file included from /Users/runner/work/gazebo-yarp-plugins/gazebo-yarp-plugins/libraries/singleton/include/GazeboYarpPlugins/Handler.hh:43:
2023-03-29T13:21:42.8728580Z In file included from /Users/runner/miniconda3/envs/test/include/gazebo-11/gazebo/common/Events.hh:23:
2023-03-29T13:21:42.8829980Z In file included from /Users/runner/miniconda3/envs/test/include/gazebo-11/gazebo/common/Console.hh:27:
2023-03-29T13:21:42.8930570Z In file included from /Users/runner/miniconda3/envs/test/include/boost/thread.hpp:13:
2023-03-29T13:21:42.9031940Z In file included from /Users/runner/miniconda3/envs/test/include/boost/thread/thread.hpp:12:
2023-03-29T13:21:42.9132430Z In file included from /Users/runner/miniconda3/envs/test/include/boost/thread/thread_only.hpp:22:
2023-03-29T13:21:42.9232970Z In file included from /Users/runner/miniconda3/envs/test/include/boost/thread/detail/thread.hpp:41:
2023-03-29T13:21:42.9334200Z In file included from /Users/runner/miniconda3/envs/test/include/boost/functional/hash.hpp:6:
2023-03-29T13:21:42.9435130Z /Users/runner/miniconda3/envs/test/include/boost/container_hash/hash.hpp:132:33: error: no template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
2023-03-29T13:21:42.9540510Z         struct hash_base : std::unary_function<T, std::size_t> {};
2023-03-29T13:21:42.9636350Z                            ~~~~~^
2023-03-29T13:21:42.9737740Z /Users/runner/miniconda3/envs/test/bin/../include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here
2023-03-29T13:21:42.9837660Z using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>;
2023-03-29T13:21:42.9938690Z ^
2023-03-29T13:21:43.0039800Z 1 error generated.
2023-03-29T13:21:44.1771450Z [13/112] Building CXX object libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/ConfHelpers.cc.o
2023-03-29T13:21:44.1873210Z FAILED: libraries/singleton/CMakeFiles/gazebo_yarp_singleton.dir/src/ConfHelpers.cc.o 

In a nutshell, libcxx 16 removed std::unary_function (see https://releases.llvm.org/16.0.0/projects/libcxx/docs/ReleaseNotes.html#deprecations-and-removals). boost's container_hash 1.78.0 does not compile without std::unary_function, as a fix for libcxx 16 was added just in boost 1.81 (boostorg/config#440). I tought of backporting the fix to boost 1.78, but it seems that merging any pr to boost 1.78 feedstock is blocked by https://github.com/conda-forge/boost-cpp-feedstock/pull/130/files, so I am currently out of ideas on how to proceed.

@h-vetinari
Copy link
Member

h-vetinari commented Mar 29, 2023

This is not a regression to my mind. It just means that boost<1.81 depends on libcxx<16.

I tought of backporting the fix to boost 1.78

I think boost should be buildable with newer compilers (not sure what ABI issues there were, but the issue doesn't mention them in detail...), but perhaps it's easier to backport it only to 1.80?

@h-vetinari
Copy link
Member

As an aside, I'm kinda shocked how boost still depended on a C++ feature that's been deprecated in C++17, until basically like 1 version ago.

@traversaro
Copy link
Author

This is not a regression to my mind. It just means that boost<1.81 depends on libcxx<16.

Sure, poor choice of words on my side. I totally agree, I just wanted to document this somewhere given the fact that boost is quite used and the change happened due to an update on libcxx, not an update on boost. But yeah, probably there is not a lot of actions that we can adopt here, and it would be better to discuss on the boost feedstock.

@traversaro traversaro changed the title Regression in boost 1.78 container_hash due to libcxx 16 Incompatibility in boost 1.78 container_hash with libcxx 16 Mar 30, 2023
@h-vetinari
Copy link
Member

h-vetinari commented Mar 30, 2023

Reopening this for reference purposes, since several projects seem to be hitting this.

@h-vetinari h-vetinari reopened this Mar 30, 2023
@h-vetinari h-vetinari changed the title Incompatibility in boost 1.78 container_hash with libcxx 16 removal of deprecated std::unary_function in libcxx 16 Mar 30, 2023
@h-vetinari h-vetinari pinned this issue Mar 30, 2023
@h-vetinari
Copy link
Member

To summarize the options here if some project is still using the now-removed functions:

  • add a run-constraint to libcxx<16
  • use the magic symbol _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY to unblock for the time being (I presume this will stop working eventually, but will be fine for libcxx 16 at least)

@traversaro
Copy link
Author

A possible fix in the boost-cpp recipe is proposed in conda-forge/boost-cpp-feedstock#135 .

@traversaro
Copy link
Author

Fixed by conda-forge/boost-cpp-feedstock#135, I think that we can close, feel free to re-open if necessary.

@h-vetinari h-vetinari unpinned this issue Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants