On 9/2/23 09:46, Klemens Nanni wrote:
> Porters updating shared libraries ought to check for changes and base's
> check_sym script does that, but we have no tooling or integration for that.
>
> Here's a bare bones target we can extend in many ways, but for now:
> - expect /usr/src/lib/check_sym to exist
> - expect the port to be installed
> - expect SHARED_LIBS to remain unmodified
>
>       $ make check-lib-symbols
>       /usr/src/lib/check_sym 
> {,/usr/ports/pobj/yaml-cpp-0.8.0/fake-amd64}/usr/local/lib/libyaml-cpp.so.4.0
>       /usr/local/lib/libyaml-cpp.so.4.0 --> 
> /usr/ports/pobj/yaml-cpp-0.8.0/fake-amd64/usr/local/lib/libyaml-cpp.so.4.0
>       No dynamic export changes
>
>
> That fits well into my workflow of cranking a port's version, building and
> comparing the identically named .so files, then potentially cranking
> SHARED_LIBS and rebuilding the port.
>
> Like show-size and other helper targets, nothing uses it automatically,
> so we ought to be safe improving something like this as we go rather than
> bikeshedding/polishing it to death before commit (or so I hope...)
>
> Future changes could be
> - handle absence of check_sym script and/or installed/built libraries
> - replace raw command with pretty printed
>   "===> checking symbols for 'awesome' library..."
> - even parsing output and suggesting major/minor cranks
>
> I don't care much about the output or details, I just want to provide a
> unified way that we can document/point at, which is hopefully more
> convenient than individual ports scripting their way around the framework.
>
> Feedback? OK?
>
> Index: bsd.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1600
> diff -u -p -r1.1600 bsd.port.mk
> --- bsd.port.mk       22 Aug 2023 17:02:29 -0000      1.1600
> +++ bsd.port.mk       2 Sep 2023 13:32:00 -0000
> @@ -3759,6 +3759,12 @@ verbose-show:
>  . endif
>  .endfor
>  
> +_CHECK_SYM = /usr/src/lib/check_sym
> +check-lib-symbols:


Yes, this is really awesome to have.

small change, maybe add what port-lib-depends-check does with making
sure libraries are there?

check-lib-symbols: ${WRKINST}/.saved_libs

other than that this is good for getting started.

OK aisha

> +.for _n _v in ${SHARED_LIBS}
> +     ${_PBUILD} ${_CHECK_SYM} {,${WRKINST}}${PREFIX}/lib/lib${_n}.so.${_v}
> +.endfor
> +
>  _all_phony = ${_recursive_depends_targets} \
>       ${_recursive_targets} ${_dangerous_recursive_targets} \
>       _build-dir-depends _hook-post-install \
>

Reply via email to