Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] parallel fun in src_install - going beyond the serial monotony of 'make install'
Date: Thu, 08 Jun 2006 09:04:02
Message-Id: 20060608085807.GF4159@curie-int.vc.shawcable.net
1 In the present devmanual, for src_install, it notes that
2 make install DESTDIR="${D}"
3 is the preferred way to fire off the install, and to not use emake, for
4 fear of parallel issues.
5
6 This has four nasty side effects:
7 - Global assumption that make is GNU Make (Hi flameeyes).
8 - Doesn't pass MAKEOPTS for options other than -jX.
9 - Removes ability to use EXTRA_EMAKE.
10 - Large package installs are make very slow.
11
12 I did a bit of checking of a random selection of packages (looking at
13 the Makefile and internal dependancy trees, as well as a test with -j7
14 on my 4-way box), and found very few problems with the concept of
15 parallel installs.
16
17 For a start, practically all Makefiles generated by a recent version
18 (newer than 2001 for definite) are parallel safe. There are a few minor
19 cases I saw where this wasn't true, but those packages also had other
20 parallel build problems.
21
22 For packages that are definitely aren't parallel-install safe, we should
23 use 'emake -j1', just like the src_compile phase.
24
25 I'm not saying we should change the entire existing tree, but for new
26 packages, please consider emake for your src_install phase.
27
28 A nice use for EXTRA_EMAKE while debugging is being able to pass in
29 --debug=basic to make, and have it tell you why it rebuilt a target in
30 src_install, since src_install should not be compiling things ;-).
31
32 To forestall one question I expect, I'd like to point a basic fact about
33 how Makefiles work:
34 Multiple commands in a single target will always be executed in series,
35 and not parallel - so this target will work fine:
36 install:
37 mkdir -p $(DESTDIR)/bin
38 cp -f bar $(DESTDIR)/bin
39
40 --
41 Robin Hugh Johnson
42 E-Mail : robbat2@g.o
43 GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85

Replies