On 2025-03-04 16:40, Harry Schmalzbauer wrote:
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


Pleas excuse my error (shouldn't do two things simultaniously...)
The script has a sever bug:  $macht wasn't accumulating.


Here's the correct result:

To be deleted: gperf
 'pkg query %B gperf':
                libm.so.5
                libgcc_s.so.1
                libcxxrt.so.1
                libc.so.7
                libc++.so.1
  Matching $gcc_provided_shlibs:
                libgcc_s.so.1:32 libgcc_s.so.1


To be deleted: graphene
 'pkg query %B graphene':
                libthr.so.3
                libm.so.5
                libgobject-2.0.so.0
                libglib-2.0.so.0
                libc.so.7
  Matching $gcc_provided_shlibs:
                NONE

To be deleted: harfbuzz
 'pkg query %B harfbuzz':
                libthr.so.3
                libm.so.5
                libgraphite2.so.3
                libgobject-2.0.so.0
                libglib-2.0.so.0
                libfreetype.so.6
                libc.so.7
  Matching $gcc_provided_shlibs:
                NONE
To be deleted: icu
 'pkg query %B icu':
                libthr.so.3
                libm.so.5
                libgcc_s.so.1
                libcxxrt.so.1
                libc.so.7
                libc++.so.1
  Matching $gcc_provided_shlibs:
                libgcc_s.so.1:32 libgcc_s.so.1



#!/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
    match=
    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="${match:+$(echo $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