bpkg cfg-unlink --name host aborts with an internal assertion when a target configuration has a link to a host configuration, but the host configuration has been recreated with the same UUID and is missing the implicit backlink to the target configuration:
work="$(mktemp -d /tmp/bpkg-cfg-unlink-assert.XXXXXX)"
echo "work=$work"
cd "$work"
bdep new -t exe -l c++ hello
cd hello
bdep init -C ../hello-gcc @gcc cc config.cxx=g++ config.c=gcc
bpkg cfg-create -d ../hello-host --type host --name host cc \
config.cxx=g++ config.c=gcc
bpkg cfg-link -d ../hello-gcc ../hello-host
host_uuid="$(bpkg cfg-info -d ../hello-host | sed -n 's/^uuid: //p')"
mv ../hello-host ../hello-host.valid-with-backlink
bpkg cfg-create -d ../hello-host --type host --name host \
--uuid "$host_uuid" cc config.cxx=g++ config.c=gcc
bpkg cfg-info -d ../hello-gcc --link --backlink --dangling || true
bpkg cfg-info -d ../hello-host --link --backlink --dangling || true
bpkg cfg-unlink -d ../hello-gcc --name host
bpkg cfg-unlink --name hostaborts with an internal assertion when a target configuration has a link to a host configuration, but the host configuration has been recreated with the same UUID and is missing the implicit backlink to the target configuration: