[Reproducible-builds] Bug#833162: qemu-doc: backslashes eaten at build time; please make the build reproducible (shell)

Daniel Shahaf danielsh at apache.org
Mon Aug 1 15:00:06 UTC 2016


Source: qemu
Version: 1:2.6+dfsg-3
Severity: minor
Tags: upstream patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: environment

Dear Maintainer,

While working on the “reproducible builds” effort, we have noticed that
qemu could not be built reproducibly; the diff between two builds is:

    https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/qemu.html
    [excerpt]
    │   │   │   │   │ -<- { "return": "kvm support: enabled
    │   │   │   │   │ -" }
    │   │   │   │   │ +<- { "return": "kvm support: enabled\r\n" }

This difference is due to scripts/hxtool invoking echo(1) with arguments
that contains literal backslashs.  The behaviour of echo(1) in that case
is implementation-defined, both according to POSIX and in practice:

    % LC_ALL=C dash -c 'echo "\t"' | xxd 
    0000000: 090a                                     ..
    % LC_ALL=C bash -c 'echo "\t"' | xxd 
    0000000: 5c74 0a                                  \t.

Consequently, qemu's build output is different when /bin/sh is dash
compared to when /bin/sh is bash:

    % ARGV0=sh /bin/dash scripts/hxtool -q < qmp-commands.hx | grep 'kvm support: enabled'
    <- { "return": "kvm support: enabled
    % ARGV0=sh /bin/bash scripts/hxtool -q < qmp-commands.hx | grep 'kvm support: enabled'
    <- { "return": "kvm support: enabled\r\n" }

With the attached patch, the output becomes:

    % ARGV0=sh /bin/dash scripts/hxtool -q < qmp-commands.hx | grep 'kvm support: enabled'
    <- { "return": "kvm support: enabled\r\n" }
    % ARGV0=sh /bin/bash scripts/hxtool -q < qmp-commands.hx | grep 'kvm support: enabled'
    <- { "return": "kvm support: enabled\r\n" }

The patch is attached.

Cheers,

Daniel

P.S. When testing this patch, I noticed a copy-paste error in the
documentation: in qemu-options.hx,
..
  177	@findex -set
  178	Set parameter @var{arg} for item @var{id} of type @var{group}\n"
..
The trailing «\n"» on line 178 should be removed.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qemu-hxtool-echo-v1.diff
Type: text/x-diff
Size: 3866 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-builds/attachments/20160801/88d91dad/attachment.diff>


More information about the Reproducible-builds mailing list