Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2023 20:42:05 GMT
From:      "Simon J. Gerraty" <sjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e020aa37b858 - main - jobs.mk report JOB_ARGS log and JOB_LOG_START
Message-ID:  <202304272042.33RKg5Be010992@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=e020aa37b85805eb9937f10a50ed5ec34eab35c4

commit e020aa37b85805eb9937f10a50ed5ec34eab35c4
Author:     Simon J. Gerraty <sjg@FreeBSD.org>
AuthorDate: 2023-04-27 20:40:44 +0000
Commit:     Simon J. Gerraty <sjg@FreeBSD.org>
CommitDate: 2023-04-27 20:40:44 +0000

    jobs.mk report JOB_ARGS log and JOB_LOG_START
    
    At the start of a job include info such as JOB_ARGS the log location
    and anything in JOB_LOG_START (eg TARGET_SPEC=${TARGET_SPEC})
---
 share/mk/jobs.mk | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/share/mk/jobs.mk b/share/mk/jobs.mk
index f465ea06310b..62fe9eeae030 100644
--- a/share/mk/jobs.mk
+++ b/share/mk/jobs.mk
@@ -1,4 +1,4 @@
-# $Id: jobs.mk,v 1.7 2023/04/18 23:32:28 sjg Exp $
+# $Id: jobs.mk,v 1.9 2023/04/27 18:10:27 sjg Exp $
 #
 #	@(#) Copyright (c) 2012-2023, Simon J. Gerraty
 #
@@ -38,21 +38,30 @@ now_utc ?= ${%s:L:gmtime}
 start_utc := ${now_utc}
 .endif
 
-.info ${.newline}${TIME_STAMP} Start ${.TARGETS}
-
 .if make(*-jobs)
+.info ${.newline}${TIME_STAMP} Start ${.TARGETS}
 
 JOB_LOGDIR ?= ${SRCTOP:H}
 JOB_LOG = ${JOB_LOGDIR}/${.TARGET:S,-jobs,,:S,/,_,g}.log
 JOB_LOG_GENS ?= 4
 # we like to rotate logs
 .if empty(NEWLOG_SH)
+.for d in ${.SYSPATH:U${.PARSEDIR}:@x@$x $x/scripts@}
+.if exists($d/newlog.sh)
+NEWLOG_SH := $d/newlog.sh
+.if ${MAKE_VERSION} > 20220924
+.break
+.endif
+.endif
+.endfor
+.if empty(NEWLOG_SH)
 .ifdef M_whence
 NEWLOG_SH := ${newlog.sh:L:${M_whence}}
 .else
 NEWLOG_SH := ${(type newlog.sh) 2> /dev/null:L:sh:M/*}
 .endif
 .endif
+.endif
 .if !empty(NEWLOG_SH) && exists(${NEWLOG_SH})
 NEWLOG := sh ${NEWLOG_SH}
 JOB_NEWLOG_ARGS ?= -S -n ${JOB_LOG_GENS}
@@ -72,7 +81,7 @@ JOB_ARGS+= -j${JOB_MAX}
 # build orchestration works as expected (DIRDEPS_BUILD)
 ${.TARGETS:M*-jobs}:
 	@${NEWLOG} ${JOB_NEWLOG_ARGS} ${JOB_LOG}
-	@echo Logging to ${JOB_LOG}
+	@echo "${TIME_STAMP} Start ${.TARGET:S,-jobs,,} ${JOB_ARGS} ${JOB_LOG_START} log=${JOB_LOG}" | tee ${JOB_LOG}
 	@cd ${.CURDIR} && env MAKELEVEL=0 \
 	${.MAKE} ${JOB_ARGS} _TARGETS=${.TARGET:S,-jobs,,} ${.TARGET:S,-jobs,,} >> ${JOB_LOG} 2>&1
 



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