pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/check



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Fri Oct 11 10:13:13 UTC 2024

Modified Files:
        pkgsrc/mk/check: check-portability.mk

Log Message:
mk: Add mktool support to check-portability.

mktool is an optional external tool, available from pkgtools/mktool or
"cargo install mktool", that provides significant performance improvements
compared to check-portability.{awk,sh}.  It is fully compatible, with the
exception of CHECK_PORTABILITY_EXPERIMENTAL (it doesn't appear anyone is
using this and it is of questionable value), nor does it support the /bin/sh
warning when running on Solaris 10 and older.

After installing, set TOOLS_PLATFORM.mktool=/path/to/mktool to enable it.

Comparing the time taken to run "bmake _check-portability" on an M1 MacBook
Pro running macOS in x11/qt5-qtwebengine, check-portability.sh takes:

  real  0m34.481s
  user  0m16.506s
  sys   0m19.300s

while mktool takes just:

  real  0m1.145s
  user  0m0.213s
  sys   0m0.886s

A speedup of 30x, but perhaps more importantly a significant reduction in
system time.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/mk/check/check-portability.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/check/check-portability.mk
diff -u pkgsrc/mk/check/check-portability.mk:1.21 pkgsrc/mk/check/check-portability.mk:1.22
--- pkgsrc/mk/check/check-portability.mk:1.21   Thu Apr 11 11:44:34 2024
+++ pkgsrc/mk/check/check-portability.mk        Fri Oct 11 10:13:13 2024
@@ -1,4 +1,4 @@
-# $NetBSD: check-portability.mk,v 1.21 2024/04/11 11:44:34 joerg Exp $
+# $NetBSD: check-portability.mk,v 1.22 2024/10/11 10:13:13 jperkin Exp $
 #
 # This file checks that the extracted shell programs don't contain
 # bashisms or other constructs that only work on some platforms.
@@ -42,6 +42,13 @@ CHECK_PORTABILITY_SKIP?=     ${REPLACE_BASH}
 .if ${CHECK_PORTABILITY:tl} == yes && ${CHECK_PORTABILITY_SKIP} != "*"
 pre-configure-checks-hook: _check-portability
 .endif
+
+.if !empty(TOOLS_PLATFORM.mktool)
+CHECK_PORTABILITY_PROGRAM=     ${TOOLS_PLATFORM.mktool} check-portability
+.else
+CHECK_PORTABILITY_PROGRAM=     ${SH} ${PKGSRCDIR}/mk/check/check-portability.sh
+.endif
+
 .PHONY: _check-portability
 _check-portability:
        ${RUN}                                                          \
@@ -53,5 +60,6 @@ _check-portability:
                PREFIX=${PREFIX}                                        \
                PATCHDIR=${PATCHDIR}                                    \
                CHECK_PORTABILITY_EXPERIMENTAL=${CHECK_PORTABILITY_EXPERIMENTAL:Uno} \
+               CHECK_PORTABILITY_SKIP=${CHECK_PORTABILITY_SKIP:Q}      \
                LC_ALL=C \
-               ${SH} ${PKGSRCDIR}/mk/check/check-portability.sh
+               ${CHECK_PORTABILITY_PROGRAM}



Home | Main Index | Thread Index | Old Index