From patchwork Mon Sep 13 13:07:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 509742 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp556899jao; Mon, 13 Sep 2021 06:30:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxC9+432Rfj3RoqBBtWNCA2o5rZ0XKUAXkCI+OKYGKAp9A1WkNHJknCM6CTn6r/12cvWOem X-Received: by 2002:a67:6d84:: with SMTP id i126mr4743652vsc.2.1631539805959; Mon, 13 Sep 2021 06:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631539805; cv=none; d=google.com; s=arc-20160816; b=yhh4h/MsSXgBhuQRtHoaqZ6i45VsKwuPMr2zQZwbGMcwEE4GFrs2G3T8Os3dqASB5C wBUAKzN80z2j2ADxtwOsJ2UrrBCb9b6BtJuW6CPz2LAOiTZRzVYJ+14S5poUJ7Z7TZm+ GkaRXLws4WG+MgiotN95sOASrhGbCmCDq4w2qmgheACz4wq36KSpFzRX8Pc3l80kTX0e lDIE1E1XHzTNuo8qzKAkh3b6QuImqwlFn0uF4M3rWAyOFbygaVYQZSdN0e3w4OHwkugE R7INka8VgMofWrytfA8aC7fyscETGVv22+XlFuN3z0+eEned0wc+nfTiEFkeGQuSrCwU esKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=H+KiKckyFlDN2qEuGt0nOh4JNFvDwuDMt9ylxfdkDTg=; b=H5kMbHrw0ka4nPbND0FkdVzdbL2At3pnm9St7CKhn+YYqRYLhUgRpsWS9i3yjYZpr1 zqfT9joUy9NRQfz7DaI0j9n85CIE2mwCHRGypvFNV2NuGZHQJqiCe9PitwuRB4sg3HcT EutV/9C5vOO+rbAcBOlZyTt6tcZ3zSDg7qRG7S2S64Hws3awH48jl/jt/8+tMn2sCQcU sl/OmmXcK7R8PMoQ8UL4RwyufVJvXwn6JxTUgNl/LqiGtBYG8CXSp9IYjgpyOY2AgGDk 9s19MExipw49LYPghw67E/yf2wmM1GfkiJUV2/SEk5SxFKzMlwqWRQQDQFPkjeR7uciJ lb3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lC1Ju+Fk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d9si389739vsb.117.2021.09.13.06.30.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Sep 2021 06:30:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lC1Ju+Fk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:39328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPm29-00058i-8Q for patch@linaro.org; Mon, 13 Sep 2021 09:30:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPlgC-0007Nv-SO for qemu-devel@nongnu.org; Mon, 13 Sep 2021 09:07:26 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mPlg3-0002dI-N7 for qemu-devel@nongnu.org; Mon, 13 Sep 2021 09:07:19 -0400 Received: by mail-wr1-x42f.google.com with SMTP id b6so14576852wrh.10 for ; Mon, 13 Sep 2021 06:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H+KiKckyFlDN2qEuGt0nOh4JNFvDwuDMt9ylxfdkDTg=; b=lC1Ju+FkMBr96R6Ofpdm8WAE+r3y1cjz/r0F+KjsW7rwH5VoL4q7TcTwc3xpnNOPl3 HBDAOBg4NGJzkUlczvjxKadP4Q8g1lAO5qcFk3LAv5RlaNRhsNbgzI0OGxK4iFUoFSj0 O3DSZVWvMWvq77E5eY98Ehc2qS5UDr5Ecb4DsuBOQighRAkCK+hOIRh2FBk8BKM1dQQ3 TijV+rkSeBpNJmj1LEbatheKbTv/qj4sGk15HzJfzdDkyEGL7ZJhzoChOCmJuJt88LYZ snyREl7ubdlZauBeuIbPQVHPzXEIkKCLGkNV6rXtLSGC+Bn+96gj7kuIkYSkyBujjrg7 gI0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H+KiKckyFlDN2qEuGt0nOh4JNFvDwuDMt9ylxfdkDTg=; b=Q0gMLddX23RG64g3qutu+EZcDkyCZ7M8b5K0dwaC97+QuDCjNacwxrtEnME+mCarfv 7uiHQq6S/fbQ8G/gehUBUzv+323rcjhphhM9DOywYvDXd+16uPY4JwGuib1N7jK1zZZG VgzPW+7s7lkoccuGOmqZ8g2umR5CYRO8zjaEh8/lq/MADaFSyPUgSZFdQcK0a6CRz6/6 m5JWH7pJlymEPZeQ0IcvJUuFUH90Ojwrpt0WXJRpOKiJygKi3TIpVI0Ezc7YFKGUlvNg YUonuqOQrO4ZOF5ObbuUmD0CP51o9MF2wI0EfcQ6CjdtBUiXrLBnHzaNG4nvfv6kwTVa opSw== X-Gm-Message-State: AOAM532sv8/HPd31YZJeEQi+1DEzEwCHtyQtuQD2e0OUFUFYSw3U313Q XrRsLX7Sx7qREsIcb0rcoTtFAw== X-Received: by 2002:a5d:6741:: with SMTP id l1mr12560726wrw.289.1631538433349; Mon, 13 Sep 2021 06:07:13 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q11sm6883906wrn.65.2021.09.13.06.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 06:07:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AC7C51FF96; Mon, 13 Sep 2021 14:07:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [RFC PATCH] tests/docker: promote debian-riscv64-cross to a full image Date: Mon, 13 Sep 2021 14:07:03 +0100 Message-Id: <20210913130703.815611-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Richard Henderson , =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" To be able to cross build QEMU itself we need to include a few more libraries. These are only available in Debian's unstable ports repo for now so we need: - a debian-sid base image with a few tools - tweak the riscv64 image to use it - add the minimal libs needed to build QEMU (glib/pixman) The result works but is not as clean as using build-dep to bring in more dependencies. However sid is by definition a shifting pile of sand and by keeping the list of libs minimal we reduce the chance of having an image we can't build. It's good enough for a basic cross build test. Signed-off-by: Alex Bennée Cc: Richard Henderson Cc: "Daniel P. Berrangé" --- tests/docker/Makefile.include | 5 ++- .../dockerfiles/debian-riscv64-cross.docker | 15 ++++++--- tests/docker/dockerfiles/debian-sid.docker | 33 +++++++++++++++++++ 3 files changed, 46 insertions(+), 7 deletions(-) create mode 100644 tests/docker/dockerfiles/debian-sid.docker -- 2.30.2 diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index ff5d732889..df56796405 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -11,7 +11,7 @@ HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m)) DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles # we don't run tests on intermediate images (used as base by another image) -DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-bootstrap empty +DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-sid debian-bootstrap empty DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds @@ -141,7 +141,7 @@ docker-image-debian-mips64-cross: docker-image-debian10 docker-image-debian-mips64el-cross: docker-image-debian10 docker-image-debian-mipsel-cross: docker-image-debian10 docker-image-debian-ppc64el-cross: docker-image-debian10 -docker-image-debian-riscv64-cross: docker-image-debian10 +docker-image-debian-riscv64-cross: docker-image-debian-sid docker-image-debian-s390x-cross: docker-image-debian10 docker-image-debian-sh4-cross: docker-image-debian10 docker-image-debian-sparc64-cross: docker-image-debian10 @@ -180,7 +180,6 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross DOCKER_PARTIAL_IMAGES += debian-hppa-cross DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross -DOCKER_PARTIAL_IMAGES += debian-riscv64-cross DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross DOCKER_PARTIAL_IMAGES += debian-tricore-cross DOCKER_PARTIAL_IMAGES += debian-xtensa-cross diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/docker/dockerfiles/debian-riscv64-cross.docker index 2bbff19772..0f7e5e010e 100644 --- a/tests/docker/dockerfiles/debian-riscv64-cross.docker +++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker @@ -1,12 +1,19 @@ # # Docker cross-compiler target # -# This docker target builds on the debian Buster base image. +# This docker target builds on the Debian Sid (with ports) base image. # -FROM qemu/debian10 +FROM qemu/debian-sid +RUN dpkg --add-architecture riscv64 RUN apt update && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ - gcc-riscv64-linux-gnu \ - libc6-dev-riscv64-cross + gcc-riscv64-linux-gnu \ + libc6-dev-riscv64-cross \ + libglib2.0-dev:riscv64 \ + libpixman-1-dev:riscv64 + +# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-linux-gnu- +ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user diff --git a/tests/docker/dockerfiles/debian-sid.docker b/tests/docker/dockerfiles/debian-sid.docker new file mode 100644 index 0000000000..cb2fdf0d4f --- /dev/null +++ b/tests/docker/dockerfiles/debian-sid.docker @@ -0,0 +1,33 @@ +# +# Docker sid/ports base packages +# +# This docker target uses the current unstable version of Debian as +# a base for building QEMU for architectures yet to have an official +# port. +# +# On its own you can't build much but the docker-foo-cross targets +# build on top of the base debian image. +# +FROM docker.io/library/debian:sid-slim + +# Add ports +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata +RUN DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -yy debian-ports-archive-keyring + +RUN echo "deb http://ftp.ports.debian.org/debian-ports/ sid main" >> /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 + +# Install common build utilities +RUN DEBIAN_FRONTEND=noninteractive eatmydata \ + apt upgrade -yy +RUN DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy \ + binutils \ + dpkg-dev \ + make \ + ninja-build \ + python3 \ + pkg-config