public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] Run distcc-pump server throughout src_configure() to src_install()
Date: Sun,  7 Sep 2014 12:16:19 +0200	[thread overview]
Message-ID: <1410084979-10429-1-git-send-email-mgorny@gentoo.org> (raw)

Start distcc-pump server in all phases throughout src_configure() to
src_install() rather than in src_compile() alone. Since each of those
phases may involve some compilations, we should try to take full
advantage of distcc in all of them. Moreover, this silences distcc
warnings about being unable to connect to the server when compiling.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=507482
---
 bin/phase-functions.sh | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index f39a024..e80f16e 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -382,6 +382,19 @@ __dyn_prepare() {
 	trap - SIGINT SIGQUIT
 }
 
+# @FUNCTION: __start_distcc
+# @DESCRIPTION:
+# Start distcc-pump if necessary.
+__start_distcc() {
+	if has distcc $FEATURES && has distcc-pump $FEATURES ; then
+		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
+			# adding distcc to PATH repeatedly results in fatal distcc recursion :)
+			eval $(pump --startup | grep -v PATH)
+			trap "pump --shutdown >/dev/null" EXIT
+		fi
+	fi
+}
+
 __dyn_configure() {
 
 	if [[ -e $PORTAGE_BUILDDIR/.configured ]] ; then
@@ -401,6 +414,7 @@ __dyn_configure() {
 	fi
 
 	trap __abort_configure SIGINT SIGQUIT
+	__start_distcc
 
 	__ebuild_phase pre_src_configure
 
@@ -434,13 +448,7 @@ __dyn_compile() {
 	fi
 
 	trap __abort_compile SIGINT SIGQUIT
-
-	if has distcc $FEATURES && has distcc-pump $FEATURES ; then
-		if [[ -z $INCLUDE_SERVER_PORT ]] || [[ ! -w $INCLUDE_SERVER_PORT ]] ; then
-			eval $(pump --startup)
-			trap "pump --shutdown" EXIT
-		fi
-	fi
+	__start_distcc
 
 	__ebuild_phase pre_src_compile
 
@@ -464,6 +472,8 @@ __dyn_test() {
 	fi
 
 	trap "__abort_test" SIGINT SIGQUIT
+	__start_distcc
+
 	if [ -d "${S}" ]; then
 		cd "${S}"
 	else
@@ -509,6 +519,8 @@ __dyn_install() {
 		return 0
 	fi
 	trap "__abort_install" SIGINT SIGQUIT
+	__start_distcc
+
 	__ebuild_phase pre_src_install
 
 	if ___eapi_has_prefix_variables; then
-- 
2.1.0



             reply	other threads:[~2014-09-07 10:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 10:16 Michał Górny [this message]
2014-09-08  7:56 ` [gentoo-portage-dev] [PATCH] Run distcc-pump server throughout src_configure() to src_install() Alexander Berntsen
2014-09-10  0:29   ` Brian Dolbec
2014-09-10  6:56 ` Michał Górny
2014-09-12  7:17 ` Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410084979-10429-1-git-send-email-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox