On 2025-03-04 13:34, Gleb Popov wrote:
On Tue, Mar 4, 2025 at 1:56 PM Harry Schmalzbauer <[email protected]> wrote:

Today I noticed, that lang/gcc13 gets post hoc registered as dependency
for completely unrelated packages!

This is the provides/requires mechanism of pkg, which started to have
a broader effect recently. It is still somewhat WIP, see
https://reviews.freebsd.org/D49136

Thanks for your help, highly appreciated!


Why/how does that happen?  (note that nothing changed between 'pkg
install gcc13' and 'pkg delete gcc13' - but gcc13 wants to doom 222
unrelated packages!)

Can you please provide an output of following commands?

pkg query %b gcc13


Please note that due to math/openblas buidlfailure, I switched to GCC_DEFAULT=14 (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=285140), and interestingly, this pkg(1) issue affects gcc14 the same way.

pkg query %b gcc14
libubsan.so.1:32
libubsan.so.1
libstdc++.so.6:32
libstdc++.so.6
libquadmath.so.0:32
libquadmath.so.0
liblto_plugin.so
libitm.so.1:32
libitm.so.1
libgomp.so.1:32
libgomp.so.1
libgfortran.so.5:32
libgfortran.so.5
libgccjit.so.0
libgcc_s.so.1:32
libgcc_s.so.1
libcp1plugin.so.0
libcc1plugin.so.0
libcc1.so.0
libatomic.so.1:32
libatomic.so.1
libasan.so.8:32
libasan.so.8

and

pkg query %B <any packages that gets removed when gcc13 is removed>

To be deleted: findutils
 'pkg query %B findutils':
                libm.so.5
                libintl.so.8
                libc.so.7
  Matching $gcc_provided_shlibs:
                NONE

The result above is just one arbitrary example out of 300 packages which
would be removed by 'pkg delete gcc14'.

0 out of 300 packages share any gcc14 provided shared library.
I hope I correctly understood what the requested query results are about.


This is the corresponding q'n'd script:

#!/usr/bin/env sh

IFS=$'\n'

GCC_PKG_NAME=gcc14

gcc_provided_shlibs="$(command pkg query %b $GCC_PKG_NAME)"

for unrelated_pkg in $(command pkg delete -n $GCC_PKG_NAME | sed -n -E 's/^[[:blank:]]+([[:graph:]]+):[[:blank:]][[:digit:]].*/\1/p'); do
    echo "To be deleted: $unrelated_pkg "
    echo " 'pkg query %B $unrelated_pkg':"
    for _utilized_shlib in $(command pkg query %B $unrelated_pkg); do
        echo "          $_utilized_shlib"
match="$(echo -n "${gcc_provided_shlibs}" | command grep -F $_utilized_shlib)"
    done
    echo "  Matching \$gcc_provided_shlibs:"
    line=''
    for line in $match; do
        echo "          $line"
    done
    [ -z "$line" ] && echo "            NONE" || read void
done


Reply via email to