public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] RFC: using Ninja in more CMake-based packages
@ 2015-06-07 15:08 Michał Górny
  2015-06-07 20:14 ` [gentoo-dev] " Johannes Huber
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Michał Górny @ 2015-06-07 15:08 UTC (permalink / raw
  To: gentoo-dev; +Cc: kde

[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]

Hello, developers.

As you probably know already, CMake sucks a lot. One of its more sucky
features is that it generates Makefiles that fail a lot. In particular,
they fail at verbose build logs that are cluttered with useless CMake
intermediate commands and hard to read. But also they sometimes
deadloop hard in faulty dependency scanning [1].

Those two issues can be solved by switching CMake to use Ninja instead
of make. As you may know, Ninja is the fancy building tool that is
faster and much harder to use than make. However, it integrates with
CMake much better and with less hackery. In particular, the verbose
build log is free of useless CMake percentage printing output and other
non-sense, and contains only real build commands. It also gets
dependency scanning right.

Sadly, there are two problems with using Ninja:

1) it will not work with some packages,

2) it introduces an extra dep (on Ninja).

The first issue is a bit complex. Sometimes the problem lies in CMake
itself (not all CMake magic works in Ninja for some reason), sometimes
in the project (relying on Makefile stuff), sometimes in the ebuild.
For example, with Ninja you can't do '-C subdirectory' to run targets
from a specific subdirectory. So, we can't force Ninja everywhere.

The second issue is a bit easier. GNU make is part of @system, ninja
would be considered an extra package being installed. Do we consider it
fine to require it randomly? Or do we need to justify the extra dep by
benefits of building a particular package with Ninja? Is sane verbose
build log a good enough benefit?

So, what do you think? Should I start switching random packages to
Ninja whenever it works?

Oh, and this would be done via something like:

  : ${CMAKE_MAKEFILE_GENERATOR:=Ninja}

before inherit line. To respect user forcing another generator, and to
get deps right.

[1]:https://bugs.gentoo.org/show_bug.cgi?id=546336

-- 
Best regards,
Michał Górny

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 949 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-08-19 22:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-07 15:08 [gentoo-dev] RFC: using Ninja in more CMake-based packages Michał Górny
2015-06-07 20:14 ` [gentoo-dev] " Johannes Huber
2015-06-07 20:19   ` Justin Lecher (jlec)
2015-06-08  2:08     ` Christoph Junghans
2015-06-08  7:16       ` Duncan
2015-06-08 10:46 ` [gentoo-dev] " hasufell
2015-06-08 12:01   ` Michał Górny
2015-06-08 12:48     ` Franz Fellner
2015-06-08 13:35       ` [gentoo-dev] " Martin Vaeth
2015-06-08 13:24     ` [gentoo-dev] " hasufell
2015-06-21  6:55 ` Andrew Savchenko
2015-08-19 22:45 ` [gentoo-dev] " Johannes Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox