pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/mk



Module Name:    pkgsrc
Committed By:   joerg
Date:           Sat Dec 17 23:41:52 UTC 2016

Modified Files:
        pkgsrc/mk: pkg-build-options.mk
        pkgsrc/mk/pbulk: pbulk-index.mk

Log Message:
Add optional caching of extracted build options. As the number of users
of this feature has exploded over recent years, this avoids quadratic
complexity for many packages during scan and build phase of a bulk
build. Pbulk logic for exploiting this feature will be committed
separately. Over all, this saves ~66% for wm/xfce4-wm
with initially empty cache and ~90% when the cache is populated. Total
scan time can be cut in half.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 pkgsrc/mk/pkg-build-options.mk
cvs rdiff -u -r1.22 -r1.23 pkgsrc/mk/pbulk/pbulk-index.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/pkg-build-options.mk
diff -u pkgsrc/mk/pkg-build-options.mk:1.10 pkgsrc/mk/pkg-build-options.mk:1.11
--- pkgsrc/mk/pkg-build-options.mk:1.10 Sat Jul  9 09:54:27 2016
+++ pkgsrc/mk/pkg-build-options.mk      Sat Dec 17 23:41:51 2016
@@ -1,4 +1,4 @@
-# $NetBSD: pkg-build-options.mk,v 1.10 2016/07/09 09:54:27 rillig Exp $
+# $NetBSD: pkg-build-options.mk,v 1.11 2016/12/17 23:41:51 joerg Exp $
 #
 # This procedure determines the PKG_OPTIONS that have been in effect
 # when the package ${pkgbase} has been built. When the package is not
@@ -40,13 +40,20 @@ PKG_FAIL_REASON+=   "[pkg-build-options.mk
 .  endfor
 .else
 .  for b in ${pkgbase}
+.    if !defined(PKG_BUILD_OPTIONS.${b}) && defined(PBULK_CACHE_DIRECTORY)
+.sinclude "${PBULK_CACHE_DIRECTORY}/build-options.${b}"
+.    endif
 .    if !defined(PKG_BUILD_OPTIONS.${b})
 PKG_BUILD_OPTIONS.${b}!= \
        echo ""; \
        ${PKG_INFO} -Q PKG_OPTIONS ${b} 2>/dev/null \
        || { cd ${BUILDLINK_PKGSRCDIR.${b}} \
             && ${MAKE} ${MAKEFLAGS} show-var VARNAME=PKG_OPTIONS; }
-
+.        if defined(PBULK_CACHE_DIRECTORY)
+_PKG_BUILD_OPTIONS.${b}!= \
+       echo PKG_BUILD_OPTIONS.${b:Q}=${PKG_BUILD_OPTIONS.${b:Q}} > ${PBULK_CACHE_DIRECTORY:Q}/build-options.${pkgbase}.$$$$; \
+       mv ${PBULK_CACHE_DIRECTORY:Q}/build-options.${pkgbase}.$$$$ ${PBULK_CACHE_DIRECTORY:Q}/build-options.${pkgbase}
+.        endif
 MAKEFLAGS+=    PKG_BUILD_OPTIONS.${b}=${PKG_BUILD_OPTIONS.${b}:Q}
 .    endif
 

Index: pkgsrc/mk/pbulk/pbulk-index.mk
diff -u pkgsrc/mk/pbulk/pbulk-index.mk:1.22 pkgsrc/mk/pbulk/pbulk-index.mk:1.23
--- pkgsrc/mk/pbulk/pbulk-index.mk:1.22 Thu Sep  8 15:19:18 2016
+++ pkgsrc/mk/pbulk/pbulk-index.mk      Sat Dec 17 23:41:52 2016
@@ -1,4 +1,4 @@
-#      $NetBSD: pbulk-index.mk,v 1.22 2016/09/08 15:19:18 joerg Exp $
+#      $NetBSD: pbulk-index.mk,v 1.23 2016/12/17 23:41:52 joerg Exp $
 
 # This Makefile fragment is included by bsd.pkg.mk and provides all
 # variables and targets related to the parallel bulk build
@@ -104,6 +104,12 @@ pbulk-index:
                ${_PBULK_MULTI_NEEDED:@._t.@;done@}
 .endif
 
+.if defined(PBULK_CACHE_DIRECTORY)
+_PBULK_SCAN_DEPENDS=   ${.MAKE.MAKEFILES:N${PBULK_CACHE_DIRECTORY}/*}
+.else
+_PBULK_SCAN_DEPENDS=   ${.MAKE.MAKEFILES}
+.endif
+
 pbulk-index-item:
        @echo "PKGNAME="${PKGNAME:Q}
        @echo "ALL_DEPENDS="${_ALL_DEPENDS:Q}
@@ -116,7 +122,7 @@ pbulk-index-item:
        @echo "USE_DESTDIR="${_USE_DESTDIR:Q}
        @echo "BOOTSTRAP_PKG="${BOOTSTRAP_PKG}
        @echo "USERGROUP_PHASE="${USERGROUP_PHASE:Q}
-       @echo "SCAN_DEPENDS="${.MAKE.MAKEFILES:Q}
+       @echo "SCAN_DEPENDS="${_PBULK_SCAN_DEPENDS:Q}
 .if defined(_PBULK_MULTI_NEEDED)
        @printf "MULTI_VERSION="
 .for _t in ${_PBULK_MULTI_NEEDED}



Home | Main Index | Thread Index | Old Index