#1088928 piuparts: fails to convert UNRELEASED to unstable for apt

#1088928#5
Date:
2024-12-03 02:27:32 UTC
From:
To:
In attempting to run piuparts with the instructions at:

https://wiki.debian.org/sbuild#Setup

I noticed that if the changelog targets UNRELEASED and no distribution is specified
in either .sbuildrc or via the command line, piuparts fails to resolve apt
because it is looking for UNRELEASED instead of unstable.

0m0.0s DEBUG: Starting command: ['mmdebstrap', '--skip=check/empty', '--variant=minbase', '--aptopt=Acquire::http { Proxy "http://127.0.0.1:3142"; }', '--keyring=/usr/share/keyrings/debian-archive-keyring.gpg', '--merged-usr', '--components=main,contrib,non-free,non-free-firmware', 'UNRELEASED', '/tmp/tmpuibo1lsq', 'http://deb.debian.org/debian/']
0m0.7s DUMP:
  I: the option --merged-usr is a no-op. It only exists for compatibility with some debootstrap wrappers.
  I: automatically chosen mode: root
  I: chroot architecture amd64 is equal to the host's architecture
  I: automatically chosen format: directory
  I: skipping check/empty as requested
  I: running apt-get update...
  Ign:1 http://deb.debian.org/debian UNRELEASED InRelease
  Err:2 http://deb.debian.org/debian UNRELEASED Release
    404  Not Found [IP: 127.0.0.1 3142]
  Reading package lists...
  E: The repository 'http://deb.debian.org/debian UNRELEASED Release' does not have a Release file.
  E: apt-get update --error-on=any -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed
  W: hooklistener errored out: E: received eof on socket

  I: main() received signal PIPE: waiting for setup...
  E: mmdebstrap failed to run
0m0.7s ERROR: Command failed (status=25): ['mmdebstrap', '--skip=check/empty', '--variant=minbase', '--aptopt=Acquire::http { Proxy "http://127.0.0.1:3142"; }', '--keyring=/usr/share/keyrings/debian-archive-keyring.gpg', '--merged-usr', '--components=main,contrib,non-free,non-free-firmware', 'UNRELEASED', '/tmp/tmpuibo1lsq', 'http://deb.debian.org/debian/']
  I: the option --merged-usr is a no-op. It only exists for compatibility with some debootstrap wrappers.
  I: automatically chosen mode: root
  I: chroot architecture amd64 is equal to the host's architecture
  I: automatically chosen format: directory
  I: skipping check/empty as requested
  I: running apt-get update...
  Ign:1 http://deb.debian.org/debian UNRELEASED InRelease
  Err:2 http://deb.debian.org/debian UNRELEASED Release
    404  Not Found [IP: 127.0.0.1 3142]
  Reading package lists...
  E: The repository 'http://deb.debian.org/debian UNRELEASED Release' does not have a Release file.
  E: apt-get update --error-on=any -oAPT::Status-Fd=<$fd> -oDpkg::Use-Pty=false failed
  W: hooklistener errored out: E: received eof on socket

  I: main() received signal PIPE: waiting for setup...
  E: mmdebstrap failed to run


Both the build and autopkgtest convert UNRELASED to unstable for the purposes of apt.

#1088928#10
Date:
2024-12-03 23:55:28 UTC
From:
To:
I think the core of the reason why this works for the build and for
autopkgtest is that they are using the chroot that has been pre-generated,
which points to unstable.  Because piuparts creates a temporary chroot, it
behaves differently.

It seems the solution is one of the following:

1.  Add code to piuparts to rewrite UNRELEASED to unstable unless a
distribution is specified.

2.  Uncomment the $distribution section of the example .sbuildrc on the wiki,
so that it works by default.