On 2026/05/17 22:28, Kirill A. Korinsky wrote:
> ports@,
>
> I'd like to add check-shlib-syms which runs check_sym for port's .so against
> system isntalled .so.
>
> Quite useful to determin does SHARED_LIBS need to be updated.
>
> I'm using it for a bit longer than a week, and it quite usefull.
>
> Feedback? Tests? Ok?
ok.
I wonder if it would be worth adding a mode to check_sym that skips
printing external reference / PLT changes and using that? I don't
think they're very useful for ports and (looking at bumps in some
ports@ submissions) they confuse people sometimes.
> Index: /usr/src/share/man/man5/bsd.port.mk.5
> ===================================================================
> RCS file: /home/cvs/src/share/man/man5/bsd.port.mk.5,v
> diff -u -p -r1.654 bsd.port.mk.5
> --- /usr/src/share/man/man5/bsd.port.mk.5 4 Nov 2025 12:52:28 -0000
> 1.654
> +++ /usr/src/share/man/man5/bsd.port.mk.5 8 May 2026 15:26:52 -0000
> @@ -172,6 +172,13 @@ Apply
> to all subpackages of the current port.
> .It Cm checkpatch
> Check that patches would apply cleanly, but do not modify anything.
> +.It Cm check-shlib-syms
> +Compare exported dynamic symbols for
> +.Ev PLIST
> +shared libraries after
> +.Cm fake ,
> +against matching installed libraries.
> +Libraries with no installed counterpart are reported and skipped.
> .It Cm checksum
> Compute a
> .Xr sha256 1
> Index: /usr/ports/infrastructure/mk/bsd.port.mk
> ===================================================================
> RCS file: /home/cvs/ports/infrastructure/mk/bsd.port.mk,v
> diff -u -p -r1.1649 bsd.port.mk
> --- /usr/ports/infrastructure/mk/bsd.port.mk 1 Apr 2026 15:14:57 -0000
> 1.1649
> +++ /usr/ports/infrastructure/mk/bsd.port.mk 8 May 2026 15:28:07 -0000
> @@ -2026,6 +2026,7 @@ CHECK_LIB_DEPENDS_ARGS += -F pthread
>
> _CHECK_LIB_DEPENDS = PORTSDIR=${PORTSDIR} ${_PERLSCRIPT}/check-lib-depends
> _CHECK_LIB_DEPENDS += -d ${_PKG_REPO} -B ${WRKINST} ${CHECK_LIB_DEPENDS_ARGS}
> +_CHECK_SYM = ${BSDSRCDIR}/lib/check_sym
>
> .for _s in ${MULTI_PACKAGES}
> . if ${STATIC_PLIST${_s}:L} == "no"
> @@ -2536,7 +2537,7 @@ _internal-all _internal-build _internal-
> _internal-subpackage _internal-subupdate _internal-uninstall \
> _internal-update _internal-update-or-install _internal-generate-readmes
> \
> _internal-update-or-install-all _internal-update-plist \
> - lib-depends-check port-lib-depends-check update-patches:
> + lib-depends-check port-lib-depends-check check-shlib-syms
> update-patches:
> . if !defined(IGNORE_SILENT)
> @${ECHO_MSG} "===> ${FULLPKGNAME${SUBPACKAGE}}${_MASTER}
> ${IGNORE${SUBPACKAGE}} ${_EXTRA_IGNORE}."
> . endif
> @@ -2560,6 +2561,21 @@ port-lib-depends-check: ${WRKINST}/.save
> ${_CHECK_LIB_DEPENDS} -i -s ${WRKINST}/.saved_libs; \
> done
>
> +check-shlib-syms: ${_FAKE_COOKIE}
> + @[ -x ${_CHECK_SYM} ] || { echo "check-shlib-syms: ${_CHECK_SYM}
> doesn't exist"; exit 1; }; \
> + for s in ${BUILD_PACKAGES}; do \
> + cd ${.CURDIR} && SUBPACKAGE=$$s ${MAKE} print-plist-libs |
> while read _l; do \
> + case $$_l in */lib*.so.*|lib*.so.*) ;; *) continue;;
> esac; \
> + case $$_l in \
> + /*) oldpat=$${_l%.so.*}.so.*; new=${WRKINST}$$_l;; \
> + *) oldpat=${PREFIX}/$${_l%.so.*}.so.*;
> new=${WRKINST}${PREFIX}/$$_l;; \
> + esac; \
> + old=$$(ls -rt $$oldpat 2>/dev/null | tail -1); \
> + [ -n "$$old" ] || { echo "check-shlib-syms: no
> installed library for $$_l"; continue; }; \
> + ${_CHECK_SYM} "$$old" "$$new"; \
> + done; \
> + done
> +
> # Most standard port targets create a cookie to avoid being re-run.
> #
> # fetch is an exception, as it uses the files it fetches as `cookies',
> @@ -3853,7 +3869,7 @@ _all_phony = ${_recursive_depends_target
> print-package-args _print-package-signature-lib \
> _print-package-signature-run _print-packagename
> _recurse-all-dir-depends \
> _recurse-test-dir-depends _recurse-run-dir-depends \
> - build-depends-list checkpatch clean clean-depends \
> + build-depends-list checkpatch check-shlib-syms clean clean-depends \
> delete-package distpatch do-build do-configure do-distpatch \
> do-gen do-extract do-install do-test fetch-all \
> install-all lib-depends lib-depends-list \
>
>
> --
> wbr, Kirill
>