openbmc / phosphor-objmgr

Phosphor Object Manager
Apache License 2.0
6 stars 8 forks source link

Upgrade to boost 1.72.0 fails #19

Open geissonator opened 4 years ago

geissonator commented 4 years ago

Was trying an upgrade to boost 1.72.0 so we could use sourceforge to download and avoid the issue documented in https://github.com/boostorg/boost/issues/299 but something with the new boost library causes objmgr to fail to compile.

make[2]: Entering directory '/phosphor-objmgr-c52be0d21755e23d67128fbcaec17e5952f4af9e'
  CC       libmapper/mapper-app.o
  CC       libmapper/la-mapper.lo
  CXX      src/mapperx-main.o
  CXX      src/mapperx-argument.o
  CXX      src/mapperx-processing.o
  CXX      src/mapperx-associations.o
  CCLD     libmapper.la
  CCLD     mapper
In file included from /usr/local/include/boost/coroutine/coroutine.hpp:10,
                 from /usr/local/include/boost/coroutine/all.hpp:11,
                 from /usr/local/include/boost/asio/spawn.hpp:19,
                 from /usr/local/include/sdbusplus/asio/object_server.hpp:10,
                 from src/types.hpp:6,
                 from src/associations.hpp:3,
                 from src/associations.cpp:1:
/usr/local/include/boost/coroutine/asymmetric_coroutine.hpp: In function 'typename boost::coroutines::pull_coroutine<R>::iterator boost::coroutines::begin(boost::coroutines::pull_coroutine<Arg>&)':
/usr/local/include/boost/coroutine/asymmetric_coroutine.hpp:2364:17: error: 'begin' is not a member of 'boost'
 2364 | { return boost::begin( c); }
      |                 ^~~~~
/usr/local/include/boost/coroutine/asymmetric_coroutine.hpp:2364:17: note: suggested alternatives:
In file included from /usr/include/c++/9/string:54,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/local/include/boost/container/throw_exception.hpp:26,
                 from /usr/local/include/boost/container/new_allocator.hpp:24,
                 from /usr/local/include/boost/container/flat_map.hpp:26,
                 from src/types.hpp:3,
                 from src/associations.hpp:3,
                 from src/associations.cpp:1:
/usr/include/c++/9/bits/range_access.h:105:37: note:   'std::begin'
  105 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&);
      |                                     ^~~~~
In file included from /usr/local/include/boost/coroutine/coroutine.hpp:10,
                 from /usr/local/include/boost/coroutine/all.hpp:11,
                 from /usr/local/include/boost/asio/spawn.hpp:19,
                 from /usr/local/include/sdbusplus/asio/object_server.hpp:10,
                 from src/types.hpp:6,
                 from src/associations.hpp:3,
                 from src/associations.cpp:1:
/usr/local/include/boost/coroutine/asymmetric_coroutine.hpp:2363:1: note:   'boost::coroutines::begin'
 2363 | begin( pull_coroutine< R > & c)
      | ^~~~~
/usr/local/include/boost/coroutine/asymmetric_coroutine.hpp: In function 'typename boost::coroutines::pull_coroutine<R>::const_iterator boost::coroutines::begin(const boost::coroutines::pull_coroutine<Arg>&)':
/usr/local/include/boost/coroutine/asymmetric_coroutine.hpp:2369:17: error: 'begin' is not a member of 'boost'
 2369 | { return boost::begin( c); }
      |                 ^~~~~
geissonator commented 4 years ago

https://lists.boost.org/boost-users/2019/12/90188.php discusses this same issue

geissonator commented 4 years ago

Ahh, and https://github.com/boostorg/coroutine/pull/45 is the issue and there is a patch against 1.72.0 in the release note we can pick up: https://www.boost.org/patches/1_72_0/0001-revert-cease-dependence-on-range.patch

geissonator commented 4 years ago

Here's a quick fix that uses latest boost release and applies the patch they released in the release note:

openbmc-build-scripts $git diff build-unit-test-docker.sh
diff --git a/build-unit-test-docker.sh b/build-unit-test-docker.sh
index 65708f4..0ec008f 100755
--- a/build-unit-test-docker.sh
+++ b/build-unit-test-docker.sh
@@ -332,8 +332,9 @@ make -j$(nproc) defconfig && \
 make INSTALL_HDR_PATH=/usr/local headers_install

 FROM openbmc-base as openbmc-boost
-RUN curl -L https://dl.bintray.com/boostorg/release/${PKG_REV['boost']}/source/boost_$(echo "${PKG_REV['boost']}" | tr '.' '_').tar.bz2 | tar -xj && \
+RUN curl -L https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2 | tar -xj && \
 cd boost_*/ && \
+curl -L https://www.boost.org/patches/1_72_0/0001-revert-cease-dependence-on-range.patch | patch -p1 && \
 ./bootstrap.sh --prefix=${PREFIX} --with-libraries=context,coroutine && \
 ./b2 && ./b2 install --prefix=${PREFIX}
mdmillerii commented 4 years ago

also see https://github.com/boostorg/coroutine/issues/46 that includes the revert commit.

mine260309 commented 4 years ago

A drive-by comment: why not use GitHub to download the boost library? I assume GitHub should be stable for most times. E.g. https://github.com/boostorg/boost/archive/boost-1.72.0.tar.gz

geissonator commented 4 years ago

A drive-by comment: why not use GitHub to download the boost library? I assume GitHub should be stable for most times. E.g. https://github.com/boostorg/boost/archive/boost-1.72.0.tar.gz

I liked this idea but unfortunately the github release doesn't package in the needed tools/build/ scripts. Looks like they are git sub modules and not a part of the package :(