Control: affects 1069907 subversion

On 2024-04-26, James Addison wrote:
> I'm an occasional volunteer contributor to the Reproducible Builds[1] project,
> and noticed recently that an Apache webserver module, mod-mono, that 
> depends[2]
> on the dh_apache2 debhelper utility from apache2-dev at build-time, failed an
> automated Debian reproducibility test[3].
>
> The problem appears to be related to the substitution of a NAMES variable
> that appears in the templated pre/post scripts evaluated by dh_apache2; the
> templates[4][5][6] are found in the 'apache2' source package.
>
> I don't yet know exactly how the non-deterministic ordering of entries in the
> NAMES variable occurs; however the replacement parameters[7] in the
> dh_apache2.in script seem relevant, and tracing the creation of those may 
> help.

This is also occurring in subversion, which has only two modules, so a
high chance of flipping back and forth between reproducible or not:

https://reproduce.debian.net/arm64/api/v1/builds/547174/artifacts/1423172/diffoscope

--- 
/srv/rebuilderd/tmp/rebuilderd4BrIIh/inputs/libapache2-mod-svn_1.15.0-2_arm64.deb
+++ 
/srv/rebuilderd/tmp/rebuilderd4BrIIh/out/libapache2-mod-svn_1.15.0-2_arm64.deb
├── control.tar.xz
│ ├── control.tar
│ │ ├── ./postinst
│ │ │ @@ -1,12 +1,12 @@
│ │ │  #!/bin/sh
│ │ │  set -e
│ │ │  # Automatically added by dh_apache2/UNDECLARED
│ │ │  if true; then
│ │ │   if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
│ │ │           . /usr/share/apache2/apache2-maintscript-helper
│ │ │ -         for conf in dav_svn authz_svn  ; do
│ │ │ +         for conf in authz_svn dav_svn  ; do
│ │ │                   apache2_invoke enmod $conf  || exit 1
│ │ │           done
│ │ │   fi
│ │ │  fi
│ │ │  # End automatically added section

This seems to match debian/debhelper/postinst-apache2:

if #CONDITIONAL_VARIABLE#; then
    if [ -e /usr/share/apache2/apache2-maintscript-helper ] ; then
        . /usr/share/apache2/apache2-maintscript-helper
        for conf in #NAMES# ; do
            apache2_invoke #HELPER# $conf #ACTION# || #ERROR_HANDLER#
        done
    fi
fi

Which is apparently set in debian/debhelper/dh_apache2.in:

                my %replacements = (
                    HELPER => $ref->[0],
                    NAMES  => $ref->[1],
                    ERROR_HANDLER => $PACKAGE_TYPE{handler},
                    CONDITIONAL_VARIABLE => $PACKAGE_TYPE{conditional},
                    ACTION => $dh{RESTART},
                );

                if ($script_type eq "prerm" || $script_type eq "postrm")
                {
                    $replacements{'HELPER'} =~ s/en/dis/;
                }

                my $sed_command = "";
                foreach my $key (sort keys %replacements)
                {
                    my $val = $replacements{$key};
                    # Use a control char as separator for sed, to
                    # reduce escaping issues. Everything else is
                    # passed verbatim, i.e. it must not contain any
                    # shell or sed special characters.
                    my $sep = "\x17";
                    $sed_command .= "s" . $sep . "#$key#" .

It appears to call sort, but perhaps it is sorting the wrong things, or
at the wrong timing?


live well,
  vagrant

Attachment: signature.asc
Description: PGP signature

Reply via email to