Bug 229661 - [cmake] net/ceph and cad/kicad: fails to build with boost 1.68
Summary: [cmake] net/ceph and cad/kicad: fails to build with boost 1.68
Status: Closed DUPLICATE of bug 229854
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL: https://gitlab.kitware.com/cmake/cmak...
Keywords: needs-qa
Depends on: 226191
Blocks: 229569
  Show dependency treegraph
 
Reported: 2018-07-10 00:01 UTC by Jan Beich
Modified: 2018-07-20 01:07 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (wjw)
tcberner: maintainer-feedback+
jbeich: maintainer-feedback? (thierry)


Attachments
v0 (2.11 KB, patch)
2018-07-11 11:44 UTC, Jan Beich
no flags Details | Diff
v1 (1.88 KB, patch)
2018-07-13 02:51 UTC, Jan Beich
tcberner: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2018-07-10 00:01:47 UTC
$ fetch -qo- 'https://reviews.freebsd.org/D16165?download=true' | patch -Efsp0 -d /usr/ports
$ make all deinstall install clean -C/usr/ports/devel/boost-jam
$ make all deinstall install clean -C/usr/ports/devel/boost-libs
$ make -C /usr/ports/net/ceph
[...]
CMake Warning at /usr/local/share/cmake/Modules/FindBoost.cmake:840 (message):
  New Boost version may have incorrect or missing dependencies and imported
  targets
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FindBoost.cmake:951 (_Boost_COMPONENT_DEPENDENCIES)
  /usr/local/share/cmake/Modules/FindBoost.cmake:1619 (_Boost_MISSING_DEPENDENCIES)
  CMakeLists.txt:567 (find_package)
[...]
CMake Error at /usr/local/share/cmake/Modules/FindBoost.cmake:2045 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.68.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_context

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:567 (find_package)

[...]
-- Configuring incomplete, errors occurred!
See also "/wrkdirs/usr/ports/net/ceph/work/.build/CMakeFiles/CMakeOutput.log".
See also "/wrkdirs/usr/ports/net/ceph/work/.build/CMakeFiles/CMakeError.log".
*** Error code 1

$ pkg which /usr/local/lib/libboost_context.so
/usr/local/lib/libboost_context.so was installed by package boost-libs-1.68.0
$ echo 'int main() {}' >a.c
$ cc a.c /usr/local/lib/libboost_context.so
$ ./a.out

Full build log: https://ptpb.pw/dBFj
Comment 1 Jan Beich freebsd_committer 2018-07-10 00:03:11 UTC
For some reason CMake fails to detect libboost_context. Any clues?

$ echo "find_package(Boost COMPONENTS context REQUIRED)" >>CMakeLists.txt
$ cmake -Wno-dev .
[...]
CMake Error at /usr/local/share/cmake/Modules/FindBoost.cmake:2045 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.68.0

  Boost include path: /usr/local/include

  Could not find the following Boost libraries:

          boost_context

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:1 (find_package)
Comment 2 Walter Schwarzenfeld freebsd_triage 2018-07-10 01:33:37 UTC
Maybe, this:
work/ceph-12.2.4/CMakeLists.txt
567   find_package(Boost 1.66 COMPONENTS ${BOOST_COMPONENTS} REQUIRED)
                                          ^^^
Comment 3 Jan Beich freebsd_committer 2018-07-10 03:15:56 UTC
cad/kicad (but not -devel) also cannot find libboost_context. See https://ptpb.pw/-m48
Comment 4 Willem Jan Withagen 2018-07-10 07:43:51 UTC
Hi Jan,

I guess that this is the same issue when moving from 1.66 to 1.67.
It needs to be supported by Cmake for it to work.

In Ceph I have not seen any attempts to move to 1.68, so that might take "some" time..
Is there an ETA on moving to 1.68 in ports?
Comment 5 Jan Beich freebsd_committer 2018-07-10 11:15:38 UTC
(In reply to Willem Jan Withagen from comment #4)
> Is there an ETA on moving to 1.68 in ports?

Probably in a month when 1.68 is actually released.
Comment 6 Willem Jan Withagen 2018-07-10 11:34:24 UTC
I'm not sure how big the change with 1.67 are?
But going from 1.66 to 1.67 changes were enough to mess up compilation.

And I do not forsee Ceph going to 1.68 real soon.

So would it be possible to keep a versioned 1.67?
Comment 7 Tobias C. Berner freebsd_committer 2018-07-10 18:39:22 UTC
Hi there

I could not yet find any upstream commit to support 1.68 in cmake.

mfg Tobias
Comment 8 Willem Jan Withagen 2018-07-10 19:01:19 UTC
(In reply to Tobias C. Berner from comment #7)

Yeah, that was the problem with the previous upgrade as well.
Going to be the same party over again I think.
Comment 9 Jan Beich freebsd_committer 2018-07-11 03:43:21 UTC
(In reply to Willem Jan Withagen from comment #6)
> So would it be possible to keep a versioned 1.67?

If you can submit a patch to use bundled Boost. Another option is to help me investigate the cause e.g., by extracting the real error.

I don't plan to fork devel/boost-libs, resolve conflicts, symbol collisions if different boost versions are loaded at runtime and maintain that for indefinite amount of time for very little value. On Linux it's possible as packages are rarely rebuilt and split to provide runtime and development parts. On FreeBSD subpackaging is yet to arrive.
Comment 10 Jan Beich freebsd_committer 2018-07-11 03:54:50 UTC
(In reply to Tobias C. Berner from comment #7)
Thanks for forwarding upstream. I'll test the proposed fix later (after sleep).
Comment 11 Jan Beich freebsd_committer 2018-07-11 11:44:42 UTC
Created attachment 195049 [details]
v0

https://gitlab.kitware.com/cmake/cmake/commit/6cd0d4b69d0c3dbe62e1a44dd8b9ea79afaa0a72 doesn't help. See error logs:

  cad/kicad - https://ptpb.pw/rFxK
  net/ceph  - https://ptpb.pw/KwN_

After digging a bit myself here's the culprit is https://github.com/boostorg/context/commit/2e3759946191
Comment 12 Roger Leigh 2018-07-11 16:41:51 UTC
The issue with Boost.Context and CMake is due to the 1.68 beta missing boost/context/all.hpp.  I've asked on the Boost list to clarify if it's a regression or deliberate.  If the latter, I can work around this in FindBoost.  If the former, should hopefully be fixed for the 1.68 final release.
Comment 13 Jan Beich freebsd_committer 2018-07-13 02:51:05 UTC
Created attachment 195099 [details]
v1
Comment 14 Tobias C. Berner freebsd_committer 2018-07-13 20:58:56 UTC
Comment on attachment 195099 [details]
v1

Looks good to me. 

Thanks.
Comment 15 Thierry Thomas freebsd_committer 2018-07-16 20:43:09 UTC
Kicad 5.0 has just been released, and I'm going to upgrade the port ASAP. It should support boost 1.68 without trouble.
Comment 16 Jan Beich freebsd_committer 2018-07-16 21:02:12 UTC
@thierry, Kicad 5.0 probably needs ports r474255 instead.
Comment 17 Thierry Thomas freebsd_committer 2018-07-17 18:20:33 UTC
Kicad 5.0.0 needs the shared libraries of cad/ngspice_rework.
See PR 226191.
Comment 18 Jan Beich freebsd_committer 2018-07-20 01:07:31 UTC
Upstream fixes are part of CMake 3.12.0.

*** This bug has been marked as a duplicate of bug 229854 ***