Package: release.debian.org
Severity: normal
Tags: trixie
X-Debbugs-Cc: [email protected]
Control: affects -1 + src:sbuild
User: [email protected]
Usertags: pu

[ Reason ]
This PU fixes two bugs in the stable version:

- Fix installing cross build dependencies in bookworm (#1119344).
  This was introduced during the trixie cycle but we saw the relevance
  only later. The problem is that apt in bookworm is not smart and needs
  an explicit architecture hint. The apt in trixie works..

- Preserve TMPDIR when running autopkgtest (#1121503).
  This is a convenience patch so users with a small /tmp (tmpfs in
  trixie).

[ Impact ]
Both bugs can be worked around but it means extra work for the users.

[ Tests ]
Manual tested and autopkgtest.

[ Risks ]
Low risk. Both code paths are not used in an normal sbuild run, for
example on the buildds. For the cross build patch it is only an extra
hint to apt. The TMPDIR change is a small behavior change but I think
the intention of a user that has TMPDIR set is to use it.
Both patches have been part of forky for some time and there are no
reported problems with it.

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
For cross build: The code generates the command line for apt to install
the dummy dependency package. The change adds the architecture qualifier
to the package name, according to the apt syntax.

For TMPDIR: The code calls run_command which filters environment
variables by default. The patch excludes TMPDIR from the filter.
This includes an extra patch to add some whitespace for perltidy, as it
is run during the build.
diff --git a/debian/changelog b/debian/changelog
index f4c17a60..16a7938c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+sbuild (0.89.3+deb13u2) trixie; urgency=medium
+
+  [ Jochen Sprickerhof ]
+  * Explicitly select the sbuild-build-depends-main-dummy package arch
+    (Closes: #1119344)
+
+  [ Johannes Schauer Marin Rodrigues ]
+  * lib/Sbuild/Build.pm: preserve TMPDIR when running autopkgtest
+    (Closes: #1121503)
+  * lib/Sbuild/Build.pm: perltidy
+
+ -- Jochen Sprickerhof <[email protected]>  Fri, 28 Nov 2025 09:43:59 +0100
+
 sbuild (0.89.3+deb13u1) trixie; urgency=medium
 
   [ Richard Lewis ]
diff --git a/lib/Sbuild/AptResolver.pm b/lib/Sbuild/AptResolver.pm
index d422014d..90a1e9e1 100644
--- a/lib/Sbuild/AptResolver.pm
+++ b/lib/Sbuild/AptResolver.pm
@@ -57,6 +57,7 @@ sub install_deps {
        my $status         = 0;
        my $session        = $self->get('Session');
        my $dummy_pkg_name = $self->get_sbuild_dummy_pkg_name($name);
+       my $arch           = $self->get('Host Arch');
 
        # Call functions to setup an archive to install dummy package.
        $self->log_subsubsection("Setup apt archive");
@@ -77,7 +78,8 @@ sub install_deps {
        # Install the dummy package
        my (@instd, @rmvd);
        $self->log("Installing build dependencies\n");
-       my @apt_args = ("-yf", \@instd, \@rmvd, 'install', $dummy_pkg_name);
+       my @apt_args
+         = ("-yf", \@instd, \@rmvd, 'install', "$dummy_pkg_name:$arch");
 
        if (!$self->run_apt(@apt_args)) {
                $self->log_error("Package installation failed\n");
diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 30e2ef96..fd8b4d73 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -2214,8 +2214,9 @@ sub run_autopkgtest {
                push @autopkgtest_command, '--', 'null';
        }
        $self->get('Host')->run_command({
-               COMMAND  => \@autopkgtest_command,
-               PRIORITY => 0,
+               COMMAND    => \@autopkgtest_command,
+               ENV_FILTER => ['^TMPDIR$'],
+               PRIORITY   => 0,
        });
        my $status = $? >> 8;
        # if the source package wasn't built and also initially downloaded by

Reply via email to