qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Salvatore Bonaccorso" <carnil@debian.org>
Subject: [PATCH v1 03/10] tests/docker: Kludge <linux/swab.h> breakage by pinning linux-libc-dev
Date: Wed, 13 May 2020 18:51:27 +0100	[thread overview]
Message-ID: <20200513175134.19619-4-alex.bennee@linaro.org> (raw)
In-Reply-To: <20200513175134.19619-1-alex.bennee@linaro.org>

From: Philippe Mathieu-Daudé <f4bug@amsat.org>

Linux kernel commit d5767057c9a [1] aimed to fix an issue with the
swab() declaration, but doing so it introduced the BITS_PER_LONG
definition, without using the kernel __ prefix, leading to odd
failures in userland code using kernel uapi headers, such:

      CC      block/file-posix.o
    In file included from include/qemu/timer.h:4,
                     from include/qemu/timed-average.h:29,
                     from include/block/accounting.h:28,
                     from include/block/block_int.h:27,
                     from block/file-posix.c:30:
    /usr/include/linux/swab.h: In function `__swab':
    include/qemu/bitops.h:20:34: error: "sizeof" is not defined, evaluates to 0 [-Werror=undef]
       20 | #define BITS_PER_LONG           (sizeof (unsigned long) * BITS_PER_BYTE)
          |                                  ^~~~~~
    include/qemu/bitops.h:20:41: error: missing binary operator before token "("
       20 | #define BITS_PER_LONG           (sizeof (unsigned long) * BITS_PER_BYTE)
          |                                         ^
    cc1: all warnings being treated as errors
    make: *** [rules.mak:69: block/file-posix.o] Error 1

The issue has been fixed in Linux kernel commit 467d12f5c78 [2].
Some distributions already backported the first commit, but still
lack the second one.

This is the case for Debian Buster.
The linux-libc-dev package contains the Linux kernel headers.
Kernel commit d5767057c9a has been backported in package
commit 1fb0eb7956 "Update to 4.19.116" [3], see debian/changelog:

  +linux (4.19.116-1) UNRELEASED; urgency=medium
  ...
  +    - uapi: rename ext2_swab() to swab() and share globally in swab.h

The previous released update before it is debian/4.19.98-1,
released as debian/4.19.98-1+deb10u1.

We can find this package in the Debian snapshot archives,
luckily archived on 2020-04-28 21:20:54 (see [4]).

QEMU use Debian based Docker images for most of its cross-builds,
which are tested by our Shippable CI jobs. The current broken
package makes most of our CI red. We can kludge this by using the
latest package released before the breakage. Do so by pinning
the package version (apt hold), and using the snapshot archives,
similar to commit b4048a7cd1.
We'll revert once the fix is backported on Debian.

Reference to commits:
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d5767057c9a
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=467d12f5c78
[3] https://salsa.debian.org/kernel-team/linux/-/commit/1fb0eb7956
[4] http://snapshot.debian.org/package/linux/4.19.98-1%2Bdeb10u1/#linux-libc-dev_4.19.98-1:2b:deb10u1

Cc: Salvatore Bonaccorso <carnil@debian.org>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[AJB: dropped pinning]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200513120147.21443-1-f4bug@amsat.org>
---
 tests/docker/dockerfiles/debian10.docker | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker
index 0769700a416..58b23117240 100644
--- a/tests/docker/dockerfiles/debian10.docker
+++ b/tests/docker/dockerfiles/debian10.docker
@@ -9,6 +9,15 @@
 #
 FROM debian:buster-slim
 
+ # Use a snapshot known to work (see http://snapshot.debian.org/#Usage)
+ENV DEBIAN_SNAPSHOT_DATE "20200428T212054Z"
+RUN sed -i \
+    "s%^deb \(https\?://\)deb.debian.org/debian/\? \(.*\)%deb [check-valid-until=no] \1snapshot.debian.org/archive/debian/${DEBIAN_SNAPSHOT_DATE} \2%" \
+    /etc/apt/sources.list
+RUN sed -i \
+    "s%^deb \(https\?://\)security.debian.org/debian-security/\? \(.*\)%deb [check-valid-until=no] \1snapshot.debian.org/archive/debian-security/${DEBIAN_SNAPSHOT_DATE} \2%" \
+    /etc/apt/sources.list
+
 # Duplicate deb line as deb-src
 RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list
 
-- 
2.20.1



  parent reply	other threads:[~2020-05-13 17:56 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 17:51 [PATCH v1 00/10] testing and tcg tweaks Alex Bennée
2020-05-13 17:51 ` [PATCH v1 01/10] tests/guest-debug: catch hanging guests Alex Bennée
2020-05-21 14:06   ` Philippe Mathieu-Daudé
2020-05-13 17:51 ` [PATCH v1 02/10] travis.yml: Improve the --disable-tcg test on s390x Alex Bennée
2020-05-13 17:51 ` Alex Bennée [this message]
2020-05-13 17:51 ` [PATCH v1 04/10] linux-user: completely re-write init_guest_space Alex Bennée
2020-05-21  4:43   ` Thomas Huth
2020-05-21  8:21     ` Alex Bennée
2020-05-21 15:39       ` Richard Henderson
2020-05-22 10:24         ` Alex Bennée
2020-05-22 10:36           ` Peter Maydell
2020-05-13 17:51 ` [PATCH v1 05/10] exec/cpu-all: Use bool for have_guest_base Alex Bennée
2020-05-13 18:18   ` Laurent Vivier
2020-05-13 17:51 ` [PATCH v1 06/10] accel/tcg: Relax va restrictions on 64-bit guests Alex Bennée
2020-05-13 17:51 ` [PATCH v1 07/10] accel/tcg: don't disable exec_tb trace events Alex Bennée
2020-05-13 17:51 ` [PATCH v1 08/10] disas: include an optional note for the start of disassembly Alex Bennée
2020-05-13 17:51 ` [PATCH v1 09/10] disas: add optional note support to cap_disas Alex Bennée
2020-05-13 17:51 ` [PATCH v1 10/10] translate-all: include guest address in out_asm output Alex Bennée
2020-05-21 14:04   ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200513175134.19619-4-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=borntraeger@de.ibm.com \
    --cc=carnil@debian.org \
    --cc=f4bug@amsat.org \
    --cc=fam@euphon.net \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).