[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1023852: apt: pinning src:foo doesn't affect foreign architectures



Package: apt
Version: 2.5.4
Severity: normal

Applying apt pinning to "src:foo" (as a shorthand for all binary packages
built by source package foo) only seems to pin binary packages on the
primary architecture, and not binary packages from the same source
package on foreign architectures.

The reproducer below is a very much simplified version of the development
branch of Valve's Steam Runtime, which tracks Debian testing with
selected packages from unstable, so that we won't get nasty surprises
when we want a new production runtime based on the latest Debian stable.

Steps to reproduce
==================

On an amd64 system:

$ podman run --pull=always --rm -it debian:bookworm-slim
# dpkg --add-architecture i386
# cat > /etc/apt/sources.list <<EOF
deb http://snapshot.debian.org/archive/debian/20221111T000000Z bookworm main
EOF
# apt update
# apt upgrade
# apt install --no-install-recommends libvulkan1 libvulkan1:i386
# cat > /etc/apt/sources.list <<EOF
deb http://snapshot.debian.org/archive/debian/20221111T000000Z bookworm main
deb http://snapshot.debian.org/archive/debian/20221111T000000Z sid main
EOF
# cat > /etc/apt/preferences <<EOF
Package: src:vulkan-loader
Pin: version 1.3.231.1-1
Pin-Priority: 700

Package: *
Pin: release o=Debian,n=sid
Pin-Priority: 90
EOF
# apt update
# apt upgrade

(Or use your favourite container or chroot technology, if not podman.)

Expected result
===============

I expected that the first pin stanza would apply to libvulkan1:amd64 and
libvulkan1:i386, because they were both built from src:vulkan-loader;
and I expected that the result would be that I would get a Debian bookworm
system, but with libvulkan1 upgraded to the version from sid.

Actual result
=============

> The following packages have been kept back:
>   libvulkan1
> 
> # apt-cache policy libvulkan1:amd64 libvulkan1:i386
> libvulkan1:
>   Installed: 1.3.224.0-1
>   Candidate: 1.3.231.1-1        <-- AS EXPECTED
>   Version table:
>      1.3.231.1-1 700            <-- AS EXPECTED
>          90 http://snapshot.debian.org/archive/debian/20221111T000000Z sid/main amd64 Packages
>  *** 1.3.224.0-1 500
>         500 http://snapshot.debian.org/archive/debian/20221111T000000Z bookworm/main amd64 Packages
>         100 /var/lib/dpkg/status
> libvulkan1:i386:
>   Installed: 1.3.224.0-1
>   Candidate: 1.3.224.0-1        <-- NOT AS EXPECTED
>   Version table:
>      1.3.231.1-1 90             <-- NOT AS EXPECTED
>          90 http://snapshot.debian.org/archive/debian/20221111T000000Z sid/main i386 Packages
>  *** 1.3.224.0-1 500
>         500 http://snapshot.debian.org/archive/debian/20221111T000000Z bookworm/main i386 Packages
>         100 /var/lib/dpkg/status

Workaround
==========

Changing the pinning to mention specific i386 binary package names:

cat > /etc/apt/preferences <<EOF
Package: src:vulkan-loader libvulkan1:i386 libvulkan-dev:i386
Pin: version 1.3.231.1-1
Pin-Priority: 700

Package: *
Pin: release o=Debian,n=sid
Pin-Priority: 90
EOF

makes version 1.3.231.1-1 the candidate for both amd64 and i386, allowing
the desired upgrade to go ahead.


Reply to: