Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] Run distcc-pump server throughout src_configure() to src_install()
Date: Sun, 07 Sep 2014 10:16:36
Message-Id: 1410084979-10429-1-git-send-email-mgorny@gentoo.org
1 Start distcc-pump server in all phases throughout src_configure() to
2 src_install() rather than in src_compile() alone. Since each of those
3 phases may involve some compilations, we should try to take full
4 advantage of distcc in all of them. Moreover, this silences distcc
5 warnings about being unable to connect to the server when compiling.
6
7 Fixes: https://bugs.gentoo.org/show_bug.cgi?id=507482
8 ---
9 bin/phase-functions.sh | 26 +++++++++++++++++++-------
10 1 file changed, 19 insertions(+), 7 deletions(-)
11
12 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
13 index f39a024..e80f16e 100644
14 --- a/bin/phase-functions.sh
15 +++ b/bin/phase-functions.sh
16 @@ -382,6 +382,19 @@ __dyn_prepare() {
17 trap - SIGINT SIGQUIT
18 }
19
20 +# @FUNCTION: __start_distcc
21 +# @DESCRIPTION:
22 +# Start distcc-pump if necessary.
23 +__start_distcc() {
24 + if has distcc $FEATURES && has distcc-pump $FEATURES ; then
25 + if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
26 + # adding distcc to PATH repeatedly results in fatal distcc recursion :)
27 + eval $(pump --startup | grep -v PATH)
28 + trap "pump --shutdown >/dev/null" EXIT
29 + fi
30 + fi
31 +}
32 +
33 __dyn_configure() {
34
35 if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
36 @@ -401,6 +414,7 @@ __dyn_configure() {
37 fi
38
39 trap __abort_configure SIGINT SIGQUIT
40 + __start_distcc
41
42 __ebuild_phase pre_src_configure
43
44 @@ -434,13 +448,7 @@ __dyn_compile() {
45 fi
46
47 trap __abort_compile SIGINT SIGQUIT
48 -
49 - if has distcc $FEATURES && has distcc-pump $FEATURES ; then
50 - if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
51 - eval $(pump --startup)
52 - trap "pump --shutdown" EXIT
53 - fi
54 - fi
55 + __start_distcc
56
57 __ebuild_phase pre_src_compile
58
59 @@ -464,6 +472,8 @@ __dyn_test() {
60 fi
61
62 trap "__abort_test" SIGINT SIGQUIT
63 + __start_distcc
64 +
65 if [ -d "${S}" ]; then
66 cd "${S}"
67 else
68 @@ -509,6 +519,8 @@ __dyn_install() {
69 return 0
70 fi
71 trap "__abort_install" SIGINT SIGQUIT
72 + __start_distcc
73 +
74 __ebuild_phase pre_src_install
75
76 if ___eapi_has_prefix_variables; then
77 --
78 2.1.0

Replies