Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603012 - dev-util/cmake: add USE=bootstrap to use included dependencies
Summary: dev-util/cmake: add USE=bootstrap to use included dependencies
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo KDE team
Depends on:
Blocks: 615488
  Show dependency tree
Reported: 2016-12-18 15:16 UTC by Fabian Groffen
Modified: 2017-05-03 13:07 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2016-12-18 15:16:40 UTC
cmake needs libuv, which needs autoconf.  During bootstrap (needing cmake for compiling llvm) autoconf and friends aren't setup completely yet, therefore it would be nice if we could add USE=bootstrap to cmake ebuild which would suppress "-DCMAKE_USE_SYSTEM_LIBRARIES=ON", such that the bundled libuv is used during the bootstrap.  cmake will be recompiled lateron without this USE-flag, so eventually all it would use external libuv.

Are you ok with me adding this to the 3.7.1 ebuild?
Comment 1 Lars Wendler (Polynomial-C) gentoo-dev 2016-12-18 23:30:40 UTC
Why is autoconf not set up completely?
Comment 2 Fabian Groffen gentoo-dev 2016-12-19 06:51:44 UTC
In the early bootstrap we're still trying to pull things up one by one.  Autoconf itself requires perl and many utilities.  Note that this is just the phase where we try to get a sane toolchain.  For now I used <cmake-3.7, and perhaps in the future a libuv will be there without a need for autoreconf.

Because I thought perhaps in the future more dependencies are added to cmake, this flag would allow us to ignore those during the bootstrap where things aren't fully setup yet (we need cmake to actually install a compiler here, as illustration how incomplete the setup is at this point).
Comment 3 Fabian Groffen gentoo-dev 2017-04-14 06:59:22 UTC
ok, cool, 3.6 was removed so our bootstrap process is broken, can we have this in 3.8 then?
Comment 4 Maciej Mrozowski gentoo-dev 2017-04-14 20:44:28 UTC
Shouldn't it be USE="build" instead?

!!internal use only!! DO NOT SET THIS FLAG YOURSELF!, used for creating build images and the first half of bootstrapping [make stage1]

Also, do you have a patch already that we could see?
Comment 5 Maciej Mrozowski gentoo-dev 2017-04-14 20:50:36 UTC
Anyway, I would see it like this:
if USE=build
  install bootstrapped cmake (with bundled deps, if it's not like this already), 
   build bootstrapped cmake (perhaps even using the same bundled deps)
   build target cmake with bootstrapped cmake, this time with system libs

This requires some changes in build phases, build and runtime deps.
Comment 6 Fabian Groffen gentoo-dev 2017-04-15 09:13:34 UTC
You suggest more changes than I actually think are required for this case.

The problem is that we can't use system libs at this stage because we don't have autoconf/etc setup properly yet (we're in the process of doing so).  Currently libuv needs an eautoreconf.  Normally we would avoid any packages with many dependencies (like cmake), but we can't because llvm/clang (our one and only compiler on Darwin) needs it to be built in Gentoo.
For this reason, it would help us if we could use the bundled dependencies during our bootstrap, because cmake patched them all up to work good enough.  As soon as we have a compiler and the rest of our toolchain setup, we will reinstall cmake of course, but this time building all dependant libraries because we can.
Comment 7 Maciej Mrozowski gentoo-dev 2017-04-19 20:42:43 UTC
(In reply to Fabian Groffen from comment #6)
> You suggest more changes than I actually think are required for this case.

Do I? Just look at what CMake ebuild does already:

src_prepare() {
	if ! has_version \>=${CATEGORY}/${PN}-3.4.0_rc1 ; then

This is where bootstrapped cmake is being built, when not suitable CMake is found in system.

Then perhaps somewhat less invasive change would be:

if USE=build
   optionally (no cmake found) build bootstrapped cmake (with bundled deps, if it's not like this already)
   build target cmake (optionally using bootstrapped cmake), also with bundled deps (this is your change)
   optionally (no cmake found) build bootstrapped cmake (perhaps even using the same bundled deps)
   build target cmake (optionally using bootstrapped cmake), this time with system libs
Comment 8 Fabian Groffen gentoo-dev 2017-04-20 05:58:32 UTC
Yeah, that would work for us here, thanks!
Comment 9 Lars Wendler (Polynomial-C) gentoo-dev 2017-04-28 08:05:07 UTC
commit 31c96e6a0a9b9f4eb722878519810c51b1ac4087 (HEAD -> master, origin/master, origin/HEAD)
Author: Lars Wendler <>
Date:   Fri Apr 28 10:03:02 2017

    dev-util/cmake: Put cmake-server behind a USE flag (bug #616810).

    This should also fix the bootstrapping issue reported in bug #603012.

    Package-Manager: Portage-2.3.5, Repoman-2.3.2

Can you please test if =dev-util/cmake-3.8.0-r1[-server] fixes your issue?
Comment 10 Maciej Mrozowski gentoo-dev 2017-05-03 13:07:14 UTC
While USE=server will fix this particular bootstrapping problem indirectly, I think we could still have USE=build, so don't close the bug just yet.