void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.59k stars 2.16k forks source link

Meta-package dependency resolution #32631

Closed DBLouis closed 2 years ago

DBLouis commented 3 years ago

I am having an issue with XBPS, not sure if this is the expected behavior or not.

Here is a minimal reproducible example:

# Template file for 'foobar'
pkgname=foobar
version=1
revision=1
build_style=meta
# cgmanager depends on dbus (could be anything depending on dbus)
# dbus-elogind is placed after, on purpose
depends="cgmanager dbus-elogind"
short_desc="whatever"
license="whatever"
homepage="whatever"

The following will attempt to install both dbus and dbus-elogind and eventually fail.

./xbps-src pkg foobar
xbps-install \
  -R https://alpha.de.repo.voidlinux.org/current \
  -R hostdir/binpkgs/test \
  -r "$(mktemp -d)" -S foobar

Installing directly does not fail and correctly replace dbus with dbus-elogind, no matter the order:

xbps-install \
  -R https://alpha.de.repo.voidlinux.org/current \
  -r "$(mktemp -d)" -S cgmanager dbus-elogind
github-actions[bot] commented 2 years ago

Issues become stale 90 days after last activity and are closed 14 days after that. If this issue is still relevant bump it or assign it.

Chocimier commented 2 years ago

This is expected. Xbps can replace already installed package with another package that has provides on it, but does not backtrack to solve conflict if virtual is added to transaction after real one. Backtracking is hard, if you have a good idea of how to implement, send an RFC to xbps repo.