Package: dose-distcheck
Version: 7.0.0-8
Severity: normal
Tags: upstream

Hello,

Take a Multi-Arch: same package b that provides and conflicts with the
virtual package v. Package a has one version that provides v and one
that does not. dose-distcheck makes b conflict with every version of a,
so the version of a that depends on b is reported broken. dpkg installs
it. Without Multi-Arch: same on b, dose gives the right answer.

Seen with 7.0.0-8+b2 (sid). 7.0.0-1+b2 (bookworm) gives the same output.

Reproducer
----------

multiarch_same_provider.Packages:

Package: a
Version: 1
Architecture: amd64
Provides: v

Package: a
Version: 2
Architecture: amd64
Depends: b

Package: b
Version: 1
Architecture: amd64
Multi-Arch: same
Provides: v
Conflicts: v

$ dose-distcheck --deb-native-arch=amd64 --deb-ignore-essential -f -e -s 
deb:///r/multiarch_same_provider.Packages

Expected: a 2 is installable as {a 2, b 1}. a 2 does not provide v.
Actual (output trimmed to the report for a 2; exit status 1). Note the
unversioned unsat-conflict: a:amd64:

package: a
version: 2
architecture: amd64
status: broken
reasons:
-
conflict:
pkg1:
package: b
version: 1
architecture: amd64
unsat-conflict: a:amd64
pkg2:
package: a
version: 2
architecture: amd64
...
total-packages: 3
broken-packages: 1

Confirmation with dpkg
----------------------

I built a 2 and b 1 with dpkg-deb -b and ran dpkg -i b.deb a.deb.
Both install and are ii. dpkg also installs the control case, in which b
has no Multi-Arch: same.

Real-world impact
-----------------

In Ubuntu 22.04 and 24.04, Linux Mint 22.3 and Pop!_OS 24.04, 120 NVIDIA
transitional packages are reported broken. Example from noble:

libnvidia-gl-550 550.163.01-0ubuntu0.24.04.2 (updates, transitional): Depends: 
libnvidia-gl-580; Multi-Arch: same
libnvidia-gl-580 580.178.04-0ubuntu0.24.04.1 (updates): Provides/Conflicts: 
libnvidia-gl; Multi-Arch: same
libnvidia-gl-550 550.67-0ubuntu3 (release): Provides/Conflicts: libnvidia-gl

dose reports the same pattern for the other libnvidia packages. For example,
for libnvidia-cfg1-535 it gives unsat-conflict: libnvidia-cfg1-535:amd64,
raised by libnvidia-cfg1-580.

Possible cause (hypothesis, not verified)
-----------------------------------------

Commit d7b7d07 ("Handle M-A:same conflicts with virtual packages", in 6.0
and later; requested in #961232) replaces a self-conflicting virtual
Conflicts with conflicts against the other providers of the virtual. In
src/deb/debcudf.ml (upstream 7.0.0, which the Debian patches don't touch),
l. 586-600 emit those conflicts as Some (encname, None), with no version.
The providers come from tables.virtual_table (l. 149-152), which does not
record the provider's version. The result conflicts with every version of
the provider's name, including versions that do not provide the virtual. The
comment at l. 534 already notes that this branch "does not correctly handle
versioned provides, nor versioned constraints".

Thanks,
José A. Galindo

Reply via email to