public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] Run distcc-pump server throughout src_configure() to src_install()
@ 2014-09-07 10:16 Michał Górny
  2014-09-08  7:56 ` Alexander Berntsen
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michał Górny @ 2014-09-07 10:16 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

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



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

end of thread, other threads:[~2017-02-01  7:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-07 10:16 [gentoo-portage-dev] [PATCH] Run distcc-pump server throughout src_configure() to src_install() Michał Górny
2014-09-08  7:56 ` 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

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