socsvn commit: r238471 - soc2012/scher/par_ports/head/Mk
scher at FreeBSD.org
scher at FreeBSD.org
Thu Jun 28 13:42:36 UTC 2012
Author: scher
Date: Thu Jun 28 13:42:33 2012
New Revision: 238471
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238471
Log:
[user_feedback][new_feature] ${_parv_ON_LOCK_FEEDBACK_TIMEOUT} is
intergated into ${_PROCESS_ACTIVE_BUILDS}. User is able to
configure frequency of feedbacks.
Redesign of user feedback in ${_PROCESS_ACTIVE_BUILDS} script.
Modified:
soc2012/scher/par_ports/head/Mk/bsd.parallel.mk
Modified: soc2012/scher/par_ports/head/Mk/bsd.parallel.mk
==============================================================================
--- soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Thu Jun 28 12:04:18 2012 (r238470)
+++ soc2012/scher/par_ports/head/Mk/bsd.parallel.mk Thu Jun 28 13:42:33 2012 (r238471)
@@ -14,7 +14,7 @@
# matter what value is assigned.
# Example: _parv_WANT_PARALLEL_BUILD=yes
#
-# CHECK_ACTIVE_TIMEOUT - timeout in seconds before next check of active
+# _parv_CHECK_ACTIVE_TIMEOUT - timeout in seconds before next check of active
# builds in case if port is prohibit to spawn
# another background process. Consider that this
# variable is also used in non-parallel build.
@@ -153,9 +153,10 @@
_parv_WAIT_FOR_UNLOCK_TIME?= 15
_parv_LOCK_ATTEMPT_TIMEOUT?= 2
+# TODO: change docs
_parv_ON_LOCK_FEEDBACK_TIMEOUT?= 2
-CHECK_ACTIVE_TIMEOUT?= 2
+_parv_CHECK_ACTIVE_TIMEOUT?= 2
_parv_ON_LOCK_EXIT_STATUS= 2
_parv_LOCKF_EX_TEMPFAIL= 75
@@ -390,17 +391,16 @@
# builds. If $${builds_num} < ${_parv_PARALLEL_BUILDS_NUMBER}
# then another background dependency build will be
# spawned, if there is any dependency to be spawned.
-# Otherwise "sleep ${CHECK_ACTIVE_TIMEOUT}" will be called.
+# Otherwise "sleep ${_parv_CHECK_ACTIVE_TIMEOUT}" will be called.
# $${active_builds} - a list of "pid:path:dir[:target]" or "pid:lib:dir[:target]"
# tuples of all currently being processed ports,
# spawned by this make process.
#
_PROCESS_ACTIVE_BUILDS= \
- echo "---- dependency output ----- : --- ENTER _PROCESS_ACTIVE_BUILDS SECTION "; \
+ enable_feedback=${_parv_ON_LOCK_FEEDBACK_TIMEOUT}; \
while true; do \
builds_num=$$( ${ECHO_CMD} $${active_builds} | wc -w ); \
if [ $${builds_num} -lt ${_parv_PARALLEL_BUILDS_NUMBER} ] && [ $${\#depends} -ne 0 ]; then \
- echo "---- dependency output ----- : WE CAN START ANOTHER PAR BUILD "; \
break; \
fi; \
if [ $${builds_num} -eq 0 ] && [ $${\#depends} -eq 0 ]; then \
@@ -413,12 +413,9 @@
ps -p $${pid} > /dev/null || { \
wait $${pid} && status=$$? || status=$$?; \
if [ $${status} -eq 0 ]; then \
- 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 "---- 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'`"; \
@@ -427,38 +424,43 @@
${FALSE}; \
fi; \
fi; \
+ ${ECHO_CMD} "=====> $$(cd $${build\#\#*:}; ${MAKE} -V PKGNAME) is installed"; \
elif [ $${status} -eq ${_parv_MAKE_LOCK_EXIT_STATUS} ]; then \
- echo "---- dependency output ----- : SOME DEP IS LOCKED ($${dep}) "; \
- echo "---- dependency output ----- : ACTIVE BUILDS WAS _$${active_builds}_ "; \
+ ${ECHO_CMD} "===> $$(cd $${build\#\#*:}; ${MAKE} -V PKGNAME) is locked. Unable to start build."; \
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 "---- 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 "---- dependency output ----- : DEPENDS NOW _$${depends}_ "; \
else \
- ${ECHO_CMD} "Errors occured while building a dependency (PID - $${pid}): $${dep}"; \
- ${ECHO_CMD} "Checkout it's log"; \
+ ${ECHO_CMD} "Errors occured while building a dependency port $$(cd $${build\#\#*:}; ${MAKE} -V PKGNAME)"; \
+ ${ECHO_CMD} "Checkout its log"; \
+ ${ECHO_CMD} " $$(dir=$${build\#\#*:}; ${ECHO_CMD} ${_parv_PORTS_LOGS_DIR}/${_parv_PORT_LOG_FILE})"; \
${ECHO_CMD} "Terminating..."; \
- ${_TERMINATE_PROCESS_TREE}; \
+ exit 1; \
fi; \
}; \
done; \
if { [ $${builds_num} -eq ${_parv_PARALLEL_BUILDS_NUMBER} ] || \
( [ $${builds_num} -gt 0 ] && [ $${\#depends} -eq 0 ] ); }; then \
- echo "---- dependency output ----- : CAN'T SPAWN MORE DEPS! SLEEP... "; \
- if [ $${builds_num} -eq ${_parv_PARALLEL_BUILDS_NUMBER} ]; then \
- echo ${_parv_PARALLEL_BUILDS_NUMBER} is maximum number of parallel build; \
- else \
- echo No dependencies to spawn. All remaining dependencies are building; \
+ if [ $$(( $${enable_feedback} % ${_parv_ON_LOCK_FEEDBACK_TIMEOUT} )) -eq 0 ]; then \
+ ${ECHO_CMD} "===> Unable to start more dependency builds."; \
+ if [ $${builds_num} -eq ${_parv_PARALLEL_BUILDS_NUMBER} ]; then \
+ ${ECHO_CMD} " ${_parv_PARALLEL_BUILDS_NUMBER} is maximum number of parallel builds."; \
+ else \
+ ${ECHO_CMD} " No dependencies to spawn. All remaining dependencies are building now."; \
+ fi; \
+ ${ECHO_CMD} " Currently building dependency ports are"; \
+ for build in $$( ${ECHO_CMD} "$${active_builds}" ); do \
+ dir=$${build\#\#*:}; \
+ ${ECHO_CMD} " $$(cd $${dir}; ${MAKE} -V PKGNAME)"; \
+ done; \
+ enable_feedback=0; \
fi; \
- sleep ${CHECK_ACTIVE_TIMEOUT}; \
+ enable_feedback=$$(( $${enable_feedback} + 1 )); \
+ sleep ${_parv_CHECK_ACTIVE_TIMEOUT}; \
fi; \
- done; \
- echo "---- dependency output ----- : --- LEAVE _PROCESS_ACTIVE_BUILDS SECTION "
+ done
#
# _TERMINATE_PROCESS_TREE - this script contains all magic, related to
More information about the svn-soc-all
mailing list