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:22:01 UTC 2024

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

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

mktool is an optional external tool, available from pkgtools/mktool or
"cargo install mktool", that provides significant performance improvements
compared to check-shlibs-*.awk, while being 100% compatible.

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

Comparing the time taken to run "bmake _check-shlibs" in a SmartOS VM in
x11/kde-workspace4, check-shlibs-elf.awk takes:

  real  0m20.441s
  user  0m7.540s
  sys   0m11.222s

while mktool takes just:

  real  0m0.607s
  user  0m0.400s
  sys   0m0.242s

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

Tested on SmartOS and NetBSD (comparing against check-shlibs-elf.awk) and
macOS (comparing against check-shlibs-macho.awk).  mktool was helpful in
exposing the recent issue and bugfix in check-shlibs-macho.awk.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 pkgsrc/mk/check/check-shlibs.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-shlibs.mk
diff -u pkgsrc/mk/check/check-shlibs.mk:1.35 pkgsrc/mk/check/check-shlibs.mk:1.36
--- pkgsrc/mk/check/check-shlibs.mk:1.35        Wed Nov 23 11:55:43 2022
+++ pkgsrc/mk/check/check-shlibs.mk     Fri Oct 11 10:22:01 2024
@@ -1,4 +1,4 @@
-# $NetBSD: check-shlibs.mk,v 1.35 2022/11/23 11:55:43 jperkin Exp $
+# $NetBSD: check-shlibs.mk,v 1.36 2024/10/11 10:22:01 jperkin Exp $
 #
 # This file verifies that all libraries used by the package can be found
 # at run-time.
@@ -57,13 +57,17 @@ _CHECK_SHLIBS_FILELIST_CMD?=        ${SED} -e '
     !empty(CHECK_SHLIBS_SUPPORTED:M[Yy][Ee][Ss]) && \
     ${_USE_CHECK_SHLIBS_NATIVE} == "yes"
 CHECK_SHLIBS_NATIVE_ENV=
+.if !empty(TOOLS_PLATFORM.mktool)
+CHECK_SHLIBS_NATIVE?=          ${TOOLS_PLATFORM.mktool} check-shlibs
+CHECK_SHLIBS_NATIVE_ENV+=      PKG_ADMIN_CMD=${PKG_ADMIN:Q}
+.endif
 .  if ${OBJECT_FMT} == "ELF"
 USE_TOOLS+=                    readelf
-CHECK_SHLIBS_NATIVE=           ${PKGSRCDIR}/mk/check/check-shlibs-elf.awk
+CHECK_SHLIBS_NATIVE?=          ${AWK} -f ${PKGSRCDIR}/mk/check/check-shlibs-elf.awk
 CHECK_SHLIBS_NATIVE_ENV+=      PLATFORM_RPATH=${_OPSYS_SYSTEM_RPATH:Q}
 CHECK_SHLIBS_NATIVE_ENV+=      READELF=${TOOLS_PATH.readelf:Q}
 .  elif ${OBJECT_FMT} == "Mach-O"
-CHECK_SHLIBS_NATIVE=           ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk
+CHECK_SHLIBS_NATIVE?=          ${AWK} -f ${PKGSRCDIR}/mk/check/check-shlibs-macho.awk
 .    if defined(DARWIN_NO_SYSTEM_LIBS)
 CHECK_SHLIBS_NATIVE_ENV+=      SKIP_SYSTEM_LIBS=1
 .    endif
@@ -97,5 +101,5 @@ _check-shlibs: error-check .PHONY
                esac;                                                   \
                ${ECHO} $$file;                                         \
        done |                                                          \
-       ${PKGSRC_SETENV} ${CHECK_SHLIBS_NATIVE_ENV} ${AWK} -f ${CHECK_SHLIBS_NATIVE} > ${ERROR_DIR}/${.TARGET}
+       ${PKGSRC_SETENV} ${CHECK_SHLIBS_NATIVE_ENV} ${CHECK_SHLIBS_NATIVE} > ${ERROR_DIR}/${.TARGET}
 .endif



Home | Main Index | Thread Index | Old Index