Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2012 19:43:14 +0000
From:      scher@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r237563 - soc2012/scher/par_ports/head/Mk
Message-ID:  <20120612194314.5AD47106566B@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: scher
Date: Tue Jun 12 19:43:13 2012
New Revision: 237563
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=237563

Log:
  [fixed] more detailed debugging output for parallel dependency builds.
  	dependencies' build output is splitted into separate files.
  

Modified:
  soc2012/scher/par_ports/head/Mk/bsd.port.mk

Modified: soc2012/scher/par_ports/head/Mk/bsd.port.mk
==============================================================================
--- soc2012/scher/par_ports/head/Mk/bsd.port.mk	Tue Jun 12 18:19:46 2012	(r237562)
+++ soc2012/scher/par_ports/head/Mk/bsd.port.mk	Tue Jun 12 19:43:13 2012	(r237563)
@@ -5053,18 +5053,20 @@
 					${PKG_ADD} $${subpkgfile}; \
 				fi; \
 			else \
-			  (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) & spawned=$$!; \
+			  log_file="/tmp/ports_logs/dep-$${dir\#\#*/}-parent-${PORTNAME}.log"; \
+			  (cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args 2>> $${log_file} >> $${log_file} ) & spawned=$$!; \
 			fi; \
 		else \
-			(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args) & spawned=$$!; \
+		    log_file="/tmp/ports_logs/dep-$${dir\#\#*/}-parent-$${PORTNAME}.log"; \
+			(cd $$dir; ${MAKE} -DINSTALLS_DEPENDS $$target $$depends_args 2>> $${log_file} >> $${log_file} ) & spawned=$$!; \
 		fi; \
 
 _PROCESS_ACTIVE_BUILDS= \
-	echo "debugging_out_here: --- ENTER _PROCESS_ACTIVE_BUILDS SECTION " > ${PORTSDIR}/tmp/log; \
+	echo "----   dependency output  ----- : --- ENTER _PROCESS_ACTIVE_BUILDS SECTION "; \
 	while true; do \
 		builds_num=$$( ${ECHO_CMD} $${active_builds} | wc -w ); \
 		if [ $${builds_num} -lt ${_parv_PARALLEL_BUILDS_NUMBER} ] && [ $${\#depends} -ne 0 ]; then \
-			echo "debugging_out_here: WE CAN START ANOTHER PAR BUILD " > ${PORTSDIR}/tmp/log; \
+			echo "----   dependency output  ----- : WE CAN START ANOTHER PAR BUILD "; \
 			break; \
 		fi; \
 		if [ $${builds_num} -eq 0 ] && [ $${\#depends} -eq 0 ]; then \
@@ -5077,12 +5079,12 @@
 			ps -p $${pid} > /dev/null || { \
 				wait $${pid} && status=$$? || status=$$?; \
 				if [ $${status} -eq 0 ]; then \
-					echo "debugging_out_here: SOME DEP IS INSTALLED ($${dep}) " > ${PORTSDIR}/tmp/log; \
-					echo "debugging_out_here: WAS _$${active_builds}_ " > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : SOME DEP IS INSTALLED ($${dep}) "; \
+					echo "----   dependency output  ----- : ACTIVE BUILDS WAS _$${active_builds}_ "; \
 					active_builds="$${active_builds%%$${build}*} $${active_builds\#\#*$${build}}"; \
 					active_builds=$$( echo "$${active_builds}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
 					builds_num=$$(( $${builds_num} - 1 )); \
-					echo "debugging_out_here: NOW _$${active_builds}_ " > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : ACTIVE BUILDS NOW _$${active_builds}_ "; \
 					if [ ${.TARGET} = "lib-depends" ]; then \
 						lib=$${dep%%:*}; \
 						pattern="`${ECHO_CMD} $$lib | ${SED} -E -e 's/\./\\\\./g' -e 's/(\\\\)?\+/\\\\+/g'`"; \
@@ -5092,19 +5094,20 @@
 						fi; \
 					fi; \
 				elif [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \
-					echo "debugging_out_here: SOME DEP IS LOCKED ($${dep}) " > ${PORTSDIR}/tmp/log; \
-					echo "debugging_out_here: WAS _$${active_builds}_ " > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : SOME DEP IS LOCKED ($${dep}) "; \
+					echo "----   dependency output  ----- : ACTIVE BUILDS WAS _$${active_builds}_ "; \
 					active_builds="$${active_builds%%$${build}*} $${active_builds\#\#*$${build}}"; \
 					active_builds=$$( echo "$${active_builds}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
 					builds_num=$$(( $${builds_num} - 1 )); \
-					echo "debugging_out_here: NOW _$${active_builds}_ " > ${PORTSDIR}/tmp/log; \
-					echo "debugging_out_here: ADD IT BACK DO DEPENDS LIST " > ${PORTSDIR}/tmp/log; \
-					echo "debugging_out_here: WAS _$${depends}_ " > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : ACTIVE BUILDS NOW _$${active_builds}_ "; \
+					echo "----   dependency output  ----- : ADD IT BACK DO DEPENDS LIST "; \
+					echo "----   dependency output  ----- : DEPENDS WAS _$${depends}_ "; \
 					depends="$${depends} $${dep}"; \
 					depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
-					echo "debugging_out_here: NOW _$${depends}_ " > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : DEPENDS NOW _$${depends}_ "; \
 				else \
-					${ECHO_CMD} "Errors occured while building a dependency."; \
+					${ECHO_CMD} "Errors occured while building a dependency (PID - $${pid}): $${dep}"; \
+					${ECHO_CMD} "Checkout it's log"; \
 					${ECHO_CMD} "Terminating..."; \
 					exit 1; \
 				fi; \
@@ -5112,11 +5115,11 @@
 		done; \
 		if { [ $${builds_num} -eq ${_parv_PARALLEL_BUILDS_NUMBER} ] || \
 			( [ $${builds_num} -gt 0 ] && [ $${\#depends} -eq 0 ] ); }; then \
-			echo "debugging_out_here: CAN'T SPAWN MORE DEPS! SLEEP... " > ${PORTSDIR}/tmp/log; \
+			echo "----   dependency output  ----- : CAN'T SPAWN MORE DEPS! SLEEP... "; \
 			sleep 2; \
 		fi; \
 	done; \
-	echo "debugging_out_here: --- LEAVE _PROCESS_ACTIVE_BUILDS SECTION " > ${PORTSDIR}/tmp/log
+	echo "----   dependency output  ----- : --- LEAVE _PROCESS_ACTIVE_BUILDS SECTION "
 
 _TERMINATE_PROCESS_TREE= \
 	${_dparv_START_OUTPUT}; \
@@ -5152,12 +5155,14 @@
 	depends=`${ECHO_CMD} "${${deptype}_DEPENDS}"`; \
 	depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
 	active_builds=""; \
-	echo "debugging_out_here: ------------------------- " > ${PORTSDIR}/tmp/log; \
-	echo "debugging_out_here: ALL DEPS - $${depends}" > ${PORTSDIR}/tmp/log; \
+	echo "----   dependency output  ----- : ----------START BUILDING DEPS---------- "; \
+	echo "----   dependency output  ----- : ALL DEPS - $${depends}"; \
 	while [ $${#depends} -ne 0 ]; do \
 		i=$${depends%% *}; \
-		echo "debugging_out_here: ----- NEW STEP -----" >> ${PORTSDIR}/tmp/log; \
-		echo "debugging_out_here CURRENT DEP $${i}" >> ${PORTSDIR}/tmp/log; \
+		echo "----   dependency output  ----- : ----- NEW STEP -----" ; \
+		echo "----   dependency output  -----  DEPS TO BUILD _$${depends}_" ; \
+		echo "----   dependency output  -----  ACTIVE BUILDS _$${active_builds}_" ; \
+		echo "----   dependency output  -----  CURRENT DEP $${i}" ; \
 		prog=$${i%%:*}; \
 		if [ -z "$$prog" ]; then \
 			${ECHO_MSG} "Error: there is an empty port dependency in ${deptype}_DEPENDS."; \
@@ -5245,7 +5250,7 @@
 			( cd $${dir}; ${MAKE} check-lock ) || { \
 			status=$$?; \
 			if [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \
-				echo "debugging_out_here:  LOCKED $${i}" >> ${PORTSDIR}/tmp/log; \
+				echo "----   dependency output  ----- :  LOCKED $${i}" ; \
 				${ECHO_CMD} $${prog} may be installing now.; \
 				notfound=${_parv_ON_LOCK_EXIT_STATUS}; \
 			else \
@@ -5263,26 +5268,30 @@
 			else \
 				${_INSTALL_DEPENDS} \
 				if [ $${spawned} ]; then \
-					echo "debugging_out_here: SPAWNED PID $${spawned}" > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : SPAWNED PID $${spawned}"; \
 					active_builds="$${active_builds} $${spawned}:$${i}"; \
 					depends="$${depends%%$${i}*} $${depends##*$${i}}"; \
 					depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
 					spawned=""; \
-					echo "debugging_out_here: AFTER TRANSFER TO ACTIVE BUILDS _$${depends}_" >> ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : ADD TO ACTIVE BUILDS _$${active_builds}_" ; \
+					echo "----   dependency output  ----- : AFTER TRANSFER TO ACTIVE BUILDS _$${depends}_" ; \
 				fi; \
 			fi; \
 		elif [ $${notfound} -eq 0 ]; then \
 			depends="$${depends%%$${i}*} $${depends##*$${i}}"; \
 			depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
-			echo "debugging_out_here: AFTER DELETE _$${depends}_" >> ${PORTSDIR}/tmp/log; \
+			echo "----   dependency output  ----- : AFTER FROM DEPS DELETE _$${depends}_" ; \
 		elif [ $${notfound} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \
 			if [ $$( ${ECHO_CMD} $${depends} | wc -w ) -gt 1 ]; then \
 				depends="$${depends#* } $${depends%% *}"; \
 				depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
-				echo "debugging_out_here: AFTER CHANGE $${depends}" >> ${PORTSDIR}/tmp/log; \
+				echo "----   dependency output  ----- : AFTER  ROUND CHANGE $${depends}" ; \
 			fi; \
 		fi; \
 		${_PROCESS_ACTIVE_BUILDS}; \
+		echo "----   dependency output  ----- : ----- END OF STEP -----" ; \
+		echo "----   dependency output  -----  DEPS TO BUILD _$${depends}_" ; \
+		echo "----   dependency output  -----  ACTIVE BUILDS _$${active_builds}_" ; \
 	done
 .endif
 .else
@@ -5298,12 +5307,14 @@
 	depends=`${ECHO_CMD} "${LIB_DEPENDS}"`; \
 	depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
 	active_builds=""; \
-	echo "debugging_out_here: ------------------------- " > ${PORTSDIR}/tmp/log; \
-	echo "debugging_out_here: ALL DEPS - $${depends}" > ${PORTSDIR}/tmp/log; \
+	echo "----   dependency output  ----- : ----------START BUILDING LIB DEPS---------- "; \
+	echo "----   dependency output  ----- : ALL DEPS - $${depends}"; \
 	while [ $${#depends} -ne 0 ]; do \
 		i=$${depends%% *}; \
-		echo "debugging_out_here: ----- NEW STEP -----" >> ${PORTSDIR}/tmp/log; \
-		echo "debugging_out_here CURRENT DEP $${i}" >> ${PORTSDIR}/tmp/log; \
+		echo "----   dependency output  ----- : ----- NEW STEP -----" ; \
+		echo "----   dependency output  -----  DEPS TO BUILD _$${depends}_" ; \
+		echo "----   dependency output  -----  ACTIVE BUILDS _$${active_builds}_" ; \
+		echo "----   dependency output  -----  CURRENT DEP $${i}" ; \
 		lib=$${i%%:*}; \
 		pattern="`${ECHO_CMD} $$lib | ${SED} -E -e 's/\./\\\\./g' -e 's/(\\\\)?\+/\\\\+/g'`"\
 		dir=$${i#*:}; \
@@ -5334,7 +5345,7 @@
 			( cd $${dir}; ${MAKE} check-lock ) || { \
 			status=$$?; \
 			if [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \
-				echo "debugging_out_here:  LOCKED $${i}" >> ${PORTSDIR}/tmp/log; \
+				echo "----   dependency output  ----- :  LOCKED $${i}" ; \
 				${ECHO_CMD} $${lib} may be installing now.; \
 				notfound=${_parv_ON_LOCK_EXIT_STATUS}; \
 			else \
@@ -5352,26 +5363,30 @@
 			else \
 				${_INSTALL_DEPENDS} \
 				if [ $${spawned} ]; then \
-					echo "debugging_out_here: SPAWNED PID $${spawned}" > ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : SPAWNED PID $${spawned}"; \
 					active_builds="$${active_builds} $${spawned}:$${i}"; \
 					depends="$${depends%%$${i}*} $${depends##*$${i}}"; \
 					depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
 					spawned=""; \
-					echo "debugging_out_here: AFTER TRANSFER TO ACTIVE BUILDS _$${depends}_" >> ${PORTSDIR}/tmp/log; \
+					echo "----   dependency output  ----- : ADD TO ACTIVE BUILDS _$${active_builds}_" ; \
+					echo "----   dependency output  ----- : AFTER TRANSFER TO ACTIVE BUILDS _$${depends}_" ; \
 				fi; \
 			fi; \
 		elif [ $${notfound} -eq 0 ]; then \
 			depends="$${depends%%$${i}*} $${depends##*$${i}}"; \
 			depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
-			echo "debugging_out_here: AFTER DELETE _$${depends}_" >> ${PORTSDIR}/tmp/log; \
+			echo "----   dependency output  ----- : AFTER FROM DEPS DELETE _$${depends}_" ; \
 		elif [ $${notfound} -eq ${_parv_ON_LOCK_EXIT_STATUS} ]; then \
 			if [ $$( ${ECHO_CMD} $${depends} | wc -w ) -gt 1 ]; then \
 				depends="$${depends#* } $${depends%% *}"; \
 				depends=$$( echo "$${depends}" | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$$//' ); \
-				echo "debugging_out_here: AFTER CHANGE $${depends}" >> ${PORTSDIR}/tmp/log; \
+				echo "----   dependency output  ----- : AFTER  ROUND CHANGE $${depends}" ; \
  			fi; \
  		fi; \
  		${_PROCESS_ACTIVE_BUILDS}; \
+		echo "----   dependency output  ----- : ----- END OF STEP -----" ; \
+		echo "----   dependency output  -----  DEPS TO BUILD _$${depends}_" ; \
+		echo "----   dependency output  -----  ACTIVE BUILDS _$${active_builds}_" ; \
 	done
 .endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120612194314.5AD47106566B>