ros / ros-overlay

Gentoo Overlay for ROS packages
33 stars 30 forks source link

ros-melodic/roscpp and ros-kinetic/roscpp stopped building due to bind placeholders in latest Boost (1.73.0) #986

Open awesomebytes opened 4 years ago

awesomebytes commented 4 years ago

The error looks like (full log from my CI here):

020-05-10T18:40:52.8027173Z /tmp/gentoo/usr/bin/x86_64-pc-linux-gnu-g++ -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"roscpp\" -Droscpp_EXPORTS -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7/devel/include -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7/devel/include/ros -I/tmp/gentoo/opt/ros/melodic/include -I/tmp/gentoo/opt/ros/melodic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7   -DNDEBUG -O2 -pipe -O2 -pipe -std=c++11 -std=c++11 -fPIC   -Wall -Wextra -o CMakeFiles/roscpp.dir/src/libros/service_server.cpp.o -c /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/src/libros/service_server.cpp
2020-05-10T18:40:54.3127764Z In file included from /tmp/gentoo/usr/include/boost/bind.hpp:30,
2020-05-10T18:40:54.3129452Z                  from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include/ros/publisher.h:35,
2020-05-10T18:40:54.3130511Z                  from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include/ros/node_handle.h:32,
2020-05-10T18:40:54.3131771Z                  from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/src/libros/service_server.cpp:29:
2020-05-10T18:40:54.3132776Z /tmp/gentoo/usr/include/boost/bind.hpp:36:1: note: #pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
2020-05-10T18:40:54.3133587Z    36 | BOOST_PRAGMA_MESSAGE(
2020-05-10T18:40:54.3133905Z       | ^~~~~~~~~~~~~~~~~~~~
2020-05-10T18:40:55.2171775Z [ 47%] Building CXX object CMakeFiles/roscpp.dir/src/libros/wall_timer.cpp.o
2020-05-10T18:40:55.2179925Z /tmp/gentoo/usr/bin/x86_64-pc-linux-gnu-g++ -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"roscpp\" -Droscpp_EXPORTS -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7/devel/include -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7/devel/include/ros -I/tmp/gentoo/opt/ros/melodic/include -I/tmp/gentoo/opt/ros/melodic/share/xmlrpcpp/cmake/../../../include/xmlrpcpp -I/tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7   -DNDEBUG -O2 -pipe -O2 -pipe -std=c++11 -std=c++11 -fPIC   -Wall -Wextra -o CMakeFiles/roscpp.dir/src/libros/wall_timer.cpp.o -c /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/src/libros/wall_timer.cpp
2020-05-10T18:40:56.8394271Z In file included from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/src/libros/wall_timer.cpp:29:
2020-05-10T18:40:56.8396209Z /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include/ros/timer_manager.h: In member function 'int32_t ros::TimerManager<T, D, E>::add(const D&, const boost::function<void(const E&)>&, ros::CallbackQueueInterface*, const VoidConstPtr&, bool)':
2020-05-10T18:40:56.8397609Z /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include/ros/timer_manager.h:352:70: error: '_1' was not declared in this scope
2020-05-10T18:40:56.8398339Z   352 |       waiting_.sort(boost::bind(&TimerManager::waitingCompare, this, _1, _2));
2020-05-10T18:40:56.8398839Z       |                                                                      ^~
2020-05-10T18:40:56.8399717Z /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include/ros/timer_manager.h:352:70: note: suggested alternatives:
2020-05-10T18:40:56.8400591Z In file included from /tmp/gentoo/usr/include/boost/mpl/aux_/include_preprocessed.hpp:37,
2020-05-10T18:40:56.8431385Z                  from /tmp/gentoo/usr/include/boost/mpl/placeholders.hpp:43,
2020-05-10T18:40:56.8431998Z                  from /tmp/gentoo/usr/include/boost/mpl/apply.hpp:24,
2020-05-10T18:40:56.8432496Z                  from /tmp/gentoo/usr/include/boost/mpl/aux_/iter_apply.hpp:17,
2020-05-10T18:40:56.8433004Z                  from /tmp/gentoo/usr/include/boost/mpl/aux_/find_if_pred.hpp:14,
2020-05-10T18:40:56.8433462Z                  from /tmp/gentoo/usr/include/boost/mpl/find_if.hpp:17,
2020-05-10T18:40:56.8433909Z                  from /tmp/gentoo/usr/include/boost/mpl/find.hpp:17,
2020-05-10T18:40:56.8434377Z                  from /tmp/gentoo/usr/include/boost/mpl/aux_/contains_impl.hpp:20,
2020-05-10T18:40:56.8434829Z                  from /tmp/gentoo/usr/include/boost/mpl/contains.hpp:20,
2020-05-10T18:40:56.8435298Z                  from /tmp/gentoo/usr/include/boost/math/policies/policy.hpp:10,
2020-05-10T18:40:56.8435791Z                  from /tmp/gentoo/usr/include/boost/math/policies/error_handling.hpp:21,
2020-05-10T18:40:56.8436280Z                  from /tmp/gentoo/usr/include/boost/math/special_functions/round.hpp:14,
2020-05-10T18:40:56.8436752Z                  from /tmp/gentoo/opt/ros/melodic/include/ros/time.h:58,
2020-05-10T18:40:56.8437410Z                  from /tmp/gentoo/opt/ros/melodic/include/ros/console.h:39,
2020-05-10T18:40:56.8437917Z                  from /tmp/gentoo/opt/ros/melodic/include/ros/assert.h:35,
2020-05-10T18:40:56.8438887Z                  from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5_build-python2_7/devel/include/ros/common.h:36,
2020-05-10T18:40:56.8439913Z                  from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/include/ros/wall_timer.h:31,
2020-05-10T18:40:56.8440873Z                  from /tmp/gentoo/var/tmp/portage/ros-melodic/roscpp-1.14.5-r1/work/roscpp-1.14.5/src/libros/wall_timer.cpp:28:
2020-05-10T18:40:56.8441785Z /tmp/gentoo/usr/include/boost/mpl/aux_/preprocessed/gcc/placeholders.hpp:29:16: note:   'mpl_::_1'
2020-05-10T18:40:56.8442305Z    29 | typedef arg<1> _1;
2020-05-10T18:40:56.8442611Z       |                ^~

...

And it keeps going. I believe the fix would be do like in this PR (for ros2 message_filters): https://github.com/ros2/message_filters/pull/40/files Which is substituting every instance of _1, _2, etc for std::placeholders::_1, std::placeholders::_2, etc.

I don't have time right now to fix it. But if anyone has time, that's most probably the solution (and I don't think it will be fixed upstream given it has to do with having a newer boost, 1.73.0). Using the still available 1.72.X boost should also avoid this.

negril commented 4 years ago

2020-05-10T18:40:54.3132776Z /tmp/gentoo/usr/include/boost/bind.hpp:36:1: note: #pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.

Maybe just set the variable as it is unlikely that the code will ever get fixed?