Gentoo Archives: gentoo-dev

From: Johannes Huber <johu@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o, kde@g.o
Subject: [gentoo-dev] Re: RFC: using Ninja in more CMake-based packages
Date: Sun, 07 Jun 2015 20:14:29
Message-Id: 2477185.dHgbnfH0IA@elia
In Reply to: [gentoo-dev] RFC: using Ninja in more CMake-based packages by "Michał Górny"
1 Am Sonntag 07 Juni 2015, 17:08:57 schrieb Michał Górny:
2 > Hello, developers.
3
4 Hello Michal,
5
6 > As you probably know already, CMake sucks a lot. One of its more sucky
7 > features is that it generates Makefiles that fail a lot. In particular,
8 > they fail at verbose build logs that are cluttered with useless CMake
9 > intermediate commands and hard to read. But also they sometimes
10 > deadloop hard in faulty dependency scanning [1].
11 >
12 > Those two issues can be solved by switching CMake to use Ninja instead
13 > of make. As you may know, Ninja is the fancy building tool that is
14 > faster and much harder to use than make. However, it integrates with
15 > CMake much better and with less hackery. In particular, the verbose
16 > build log is free of useless CMake percentage printing output and other
17 > non-sense, and contains only real build commands. It also gets
18 > dependency scanning right.
19 >
20 > Sadly, there are two problems with using Ninja:
21 >
22 > 1) it will not work with some packages,
23 >
24 > 2) it introduces an extra dep (on Ninja).
25 >
26 > The first issue is a bit complex. Sometimes the problem lies in CMake
27 > itself (not all CMake magic works in Ninja for some reason), sometimes
28 > in the project (relying on Makefile stuff), sometimes in the ebuild.
29 > For example, with Ninja you can't do '-C subdirectory' to run targets
30 > from a specific subdirectory. So, we can't force Ninja everywhere.
31 >
32 > The second issue is a bit easier. GNU make is part of @system, ninja
33 > would be considered an extra package being installed. Do we consider it
34 > fine to require it randomly? Or do we need to justify the extra dep by
35 > benefits of building a particular package with Ninja? Is sane verbose
36 > build log a good enough benefit?
37 >
38 > So, what do you think? Should I start switching random packages to
39 > Ninja whenever it works?
40 >
41 > Oh, and this would be done via something like:
42 > : ${CMAKE_MAKEFILE_GENERATOR:=Ninja}
43 >
44 > before inherit line. To respect user forcing another generator, and to
45 > get deps right.
46 >
47 > [1]:https://bugs.gentoo.org/show_bug.cgi?id=546336
48
49 KDE herd maintains ~1000 packages and the majority relies on CMake. I am not
50 aware of any reports about GNU make related build files. So i would vote for
51 the reliable GNU make generator.
52
53 Greetings,
54
55 --
56 Johannes Huber (johu)
57 Gentoo Linux Developer / KDE Team
58 GPG Key ID F3CFD2BD

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] Re: RFC: using Ninja in more CMake-based packages "Justin Lecher (jlec)" <jlec@g.o>