Re:_git:_e5a0202f9694_-_main_-_Makefile. inc1:_show_time_for__`make_installworld'

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Sun, 14 Jul 2024 19:12:37 UTC
Le 13 juillet 2024 11:39:51 GMT+01:00, Wolfram Schneider <wosch@FreeBSD.org> a écrit :
>The branch main has been updated by wosch:
>
>URL: https://cgit.FreeBSD.org/src/commit/?id=e5a0202f96948a95bf1b879727e155a4f1d1da93
>
>commit e5a0202f96948a95bf1b879727e155a4f1d1da93
>Author:     Wolfram Schneider <wosch@FreeBSD.org>
>AuthorDate: 2024-07-13 10:37:14 +0000
>Commit:     Wolfram Schneider <wosch@FreeBSD.org>
>CommitDate: 2024-07-13 10:37:14 +0000
>
>    Makefile.inc1: show time for  `make installworld'
>    
>    For years we display the time in seconds how long it takes to
>    run `make buildworld' (see PR 224433). Now we will display the
>    time for "installworld" and "installkernel" as well.
>    
>    e.g.:
>    --------------------------------------------------------------
>    >>> Installing everything completed on Sun Jul  7 16:11:37 UTC 2024
>    >>> Install world completed in 110 seconds, ncpu: 2, make -j2
>    --------------------------------------------------------------
>    
>    PR: 280187
>    Approved by: imp
>    Differential Revision: https://reviews.freebsd.org/D45912
>---
> Makefile.inc1 | 22 +++++++++++++++++++---
> 1 file changed, 19 insertions(+), 3 deletions(-)
>
>diff --git a/Makefile.inc1 b/Makefile.inc1
>index 19ed923702b1..7ff961e22e7a 100644
>--- a/Makefile.inc1
>+++ b/Makefile.inc1
>@@ -1241,11 +1241,19 @@ WMAKE_TGTS+=	build${libcompat}
> .endif
> WMAKE_TGTS+=	everything
> 
>-# record buildworld time in seconds
>+# record buildworld / install time in seconds
> .if make(buildworld)
> _BUILDWORLD_START!= date '+%s'
> .export _BUILDWORLD_START
> .endif
>+.if make(installworld)
>+_INSTALLWORLD_START!= date '+%s'
>+.export _INSTALLWORLD_START
>+.endif
>+.if make(installkernel)
>+_INSTALLKERNEL_START!= date '+%s'
>+.export _INSTALLKERNEL_START
>+.endif
> 
> buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue .PHONY
> .ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
>@@ -1313,11 +1321,11 @@ kernel-toolchain: ${KERNEL_TOOLCHAIN_TGTS} .PHONY
> installcheck: _installcheck_world _installcheck_kernel .PHONY
> _installcheck_world: .PHONY
> 	@echo "--------------------------------------------------------------"
>-	@echo ">>> Install check world"
>+	@echo ">>> Install check world started on `LC_ALL=C date`"
> 	@echo "--------------------------------------------------------------"
> _installcheck_kernel: .PHONY
> 	@echo "--------------------------------------------------------------"
>-	@echo ">>> Install check kernel"
>+	@echo ">>> Install check kernel started on `LC_ALL=C date`"
> 	@echo "--------------------------------------------------------------"
> 
> #
>@@ -1641,6 +1649,8 @@ restage reinstall: .MAKE .PHONY
> .endfor
> 	@echo "--------------------------------------------------------------"
> 	@echo ">>> Installing everything completed on `LC_ALL=C date`"
>+	@seconds=$$(($$(date '+%s') - ${_INSTALLWORLD_START})); \
>+	  echo ">>> Install world completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
> 	@echo "--------------------------------------------------------------"
> 
> redistribute: .MAKE .PHONY
>@@ -1873,6 +1883,9 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY
> 	@echo "--------------------------------------------------------------"
> 	@echo ">>> Installing kernel ${INSTALLKERNEL} completed on $$(LC_ALL=C date)"
> 	@echo "--------------------------------------------------------------"
>+	@seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
>+	  echo ">>> Install kernel(s) ${INSTALLKERNEL} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
>+	@echo "--------------------------------------------------------------"
> .endif
> .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes"
> .for _kernel in ${BUILDKERNELS:[2..-1]}
>@@ -1887,6 +1900,9 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel .PHONY
> 	@echo ">>> Installing kernel ${_kernel} completed on $$(LC_ALL=C date)"
> 	@echo "--------------------------------------------------------------"
> .endfor
>+	@seconds=$$(($$(date '+%s') - ${_INSTALLKERNEL_START})); \
>+	  echo ">>> Install kernel(s) ${BUILDKERNELS} completed in $$seconds seconds, ncpu: $$(${_ncpu_cmd})${.MAKE.JOBS:S/^/, make -j/}"
>+	@echo "--------------------------------------------------------------"
> .endif
> 
> distributekernel distributekernel.debug: .PHONY


this breaks pkgbase: package production and distribution is broken since this commit

seconds=$(($(date '+%s') - ));  echo ">>> Install world completed in $seconds seconds, ncpu: $(sysctl -n hw.ncpu 2>/dev/null || nproc 2>/dev/null || echo unknown), make -j64"                                                  sh: arithmetic expression: expecting primary: "1720982146 - "

best regards
bapt