snapcraft images contain backports repo by default

Bug #2009871 reported by Justin Cattle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-images
New
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

[ Impact ]

 * buildd images historically pinned backports at 500, thus installing
   available backports. This is undesirable when using a buildd image
   to build non-backport (e.g. snapcraft).

[ Test Plan ]

 * `apt-cache policy` from within a buildd VM should return the default
   low (100) priority for backports suites (where InRelease is set to
   NotAutomatic).

[ Where problems could occur ]

 * Unless there is some unknown build mechanism at play, Lauchpad builds
   should remain unaffected as launchpad takes care of this itself. See [1].

 * Any build using buildd implicitly depending on backports by default
   will see its default change.

[ Other Info ]

 * [1] https://git.launchpad.net/launchpad-buildd/commit?id=c2ebcb6752
   Launchpad buildd handling of backports for reference.

[ Original Description ]

It seems some snapcraft images contain the backports repo by default. Verified for current version of snapcraft:core20 at least.
This causes issues at snapcraft build time, as a new repo config is installed when snapcraft runs which doesn't include backports. [ probably by snapcraft itself ].

There is a bug about it here: https://bugs.launchpad.net/snapcraft/+bug/1982420

I thought I would log an issue here too to discuss, as including backpacks by default seems like a slightly odd decision, and could even be a mistake.

Ideally, /etc/apt/preferences.d/backports would not be included in the image setup process at all by default, so backport packages are never included by default. Or, if it's there to help fix an issue, perhaps the apt pinning config with lower priority and take care the required package installation specifically.

## Test ##

multipass launch -n test-20 -d 10g snapcraft:core20

root@test-20:~# dpkg -l |grep devmapper
ii libdevmapper1.02.1:amd64 2:1.02.175-2ubuntu4~ubuntu20.04.1 amd64 Linux Kernel Device Mapper userspace library

root@test-20:~# apt-get update

root@test-20:~# cat /etc/apt/preferences.d/backports
Package: *
Pin: release a=*-backports
Pin-Priority: 500

root@test-20:~# apt-cache policy libdevmapper1.02.1
libdevmapper1.02.1:
  Installed: 2:1.02.175-2ubuntu4~ubuntu20.04.1
  Candidate: 2:1.02.175-2ubuntu4~ubuntu20.04.1
  Version table:
 *** 2:1.02.175-2ubuntu4~ubuntu20.04.1 500
        500 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages
        100 /var/lib/dpkg/status
     2:1.02.167-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

Cheers,
Just

Related branches

Revision history for this message
Christopher Townsend (townsend) wrote :

FYI, in case it's not clear, the "snapcraft" images are the buildd images at https://cloud-images.ubuntu.com/buildd/.

Revision history for this message
John Chittum (jchittum) wrote :

this will need to be checked with Colin Watson, as this has been in place since the beginning of `buildd`.

Revision history for this message
Justin Cattle (jocado) wrote :

Just in case anyone is questioning why it matters. It really boils down to two primary things IMO:

1 - Backports is not used by default in most situations, as the packages there don't have the same support or release process guarantees as far as I understand it [ https://help.ubuntu.com/community/UbuntuBackports ]

2 - If something manages the apt sources after system bootstrap using the image, and they don't included backports, they can find dependency issues that apt can't resolve automatically [ as the resolution may require a package downgrade ].

The second issue is one I actually hit [ mentioned in the main body above ].

Hope that helps give some context.

Cheers,
Just

Simon Poirier (simpoir)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 24.04.41

---------------
livecd-rootfs (24.04.41) noble; urgency=medium

  [Simon Poirier]
  * live-build/buildd/includes.chroot/etc/apt:
    unpin backports for buildd images (lp: #2009871)

 -- Philip Roche <email address hidden> Thu, 22 Feb 2024 17:39:57 +0000

Changed in livecd-rootfs (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.