From nobody Wed Oct 1 02:58:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1687882472; cv=none; d=zohomail.com; s=zohoarc; b=Vnbc93RpMrglxQ/pZwDR3oV6eU20sIzcqERxPD/LbFYezVj6eGMsP1lBZXfTNqxiCtk+iQCRAqSsg94J2iHgGs3d+ka1Ck8DKr1Iv5NS6ccPa9Hf3vCI1VUxVcJyAx676lk5Nu9G94oxIWoMqvKXnlu2WGmHBin96PhKMAVdCMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687882472; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; b=lHKP6tHWPPOWTUaqkSb+b8PG5T6Kh/dvnkaFjTu25uFKDFN1qubbUxTNkyCd07CKJQ9wI7s6UNH5yBg5rVB+GVQRf3ROxVJXbqo25dYyMvpJdFfrfALNQh7Xp3akJc1IYG1/qPFGBgqhlGk2tEQU7SA5QytEDnyEpVbZ3DSQzJ0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16878824720431010.0243277176901; Tue, 27 Jun 2023 09:14:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEBGa-0000mc-8b; Tue, 27 Jun 2023 12:10:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEBGR-00009l-Bl for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:59 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEBGK-0005py-PY for qemu-devel@nongnu.org; Tue, 27 Jun 2023 12:09:59 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3fb4146e8ceso18828005e9.0 for ; Tue, 27 Jun 2023 09:09:52 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id p23-20020a1c7417000000b003f9b0f640b1sm11192228wmc.22.2023.06.27.09.09.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 09:09:49 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A53901FFC7; Tue, 27 Jun 2023 17:09:45 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687882191; x=1690474191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; b=RSdoGeIOhjPGBh7hnRqlIiKjmplaUDhh5qegHRToHsrfsF+BAXO2Pn9+jzLeP0akNi fsAzMg7RR6U/tOsTI8To/qBK1YAhmjvueWV7Oj/sxaCMy+f1z3+vWAlWf39jBnYWPxaT jvVTdH2G0Uasfk0j37yWG+DIKk4gl8eFRIYOv6Al2ve6IylmEii72lDpr0wcxXb/89GB m66FzDiDRypnDUAL0ZfRw0Rf63lJrojZJckX9fYi2ePCoImY1IoJcVxtDD/iwdFXylzS bJOMsAD8DTloVFkKa7ef2kGjatlLFjDWhWk9pJRlEvCP7qtNCviiXu7Fwqhs/AyKpNDT +akw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687882191; x=1690474191; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; b=UMRA8cvyYfBYLS2v5h741g+sjP7poNUJ+famWJ+KRoyXqtnzCrvgcoHs/JFEO+xO5R I3gSyflci9ZwsTLProoLYOa7NHW5gFS4zTbpyyySN9Aef6Sor08V7NOLsAOUwWZLbZsT dtE9HbXzt2Xu40kkgvg5zQeTfVbApKCzMBQTKvhQypF6FiLpv1z+zmEdY3RmQKLjn6rR 4XlU43km8DZfsOsUYRfBLNTe4ETttl1RcKMUXOLZQ+Bi0jAKWRFyjyO4V7NaCVhx4MJ+ e+aYpsiApL1SrY4N2pMCGdAOVRIxS1hbP0BjNrVSKdOoYkfw+Ls6aUl8Y/gHX59RGuMo b/3w== X-Gm-Message-State: AC+VfDzvrkUl13Ayvk6jNMM0M4ANtHsVOFF0ncG004otKvt0vp/NGWHI 2/HXEui7LlCaV2kjHNq7RCQGUg== X-Google-Smtp-Source: ACHHUZ5M4B6hlWsQciw3F2OZYFfD8+hhwlXLkyBoakXNzwi0aiT6O7Y0SUtCdmB7DWg5IsCS2sCzCg== X-Received: by 2002:a05:600c:295:b0:3f9:c8b2:dfbd with SMTP id 21-20020a05600c029500b003f9c8b2dfbdmr13605224wmk.19.1687882190973; Tue, 27 Jun 2023 09:09:50 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Wainer dos Santos Moschetta , Juan Quintela , Thomas Huth , Cleber Rosa , Leonardo Bras , Beraldo Leal , Peter Maydell , Bin Meng , Yanan Wang , Darren Kenny , Alexander Bulekov , Marcel Apfelbaum , Peter Xu , Radoslaw Biernacki , Laurent Vivier , Paolo Bonzini , Eduardo Habkost , qemu-arm@nongnu.org, Stefan Hajnoczi , Richard Henderson , Bandan Das , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Alexandre Iooss , Marcin Juszkiewicz , Leif Lindholm , Laurent Vivier , Qiuhao Li , Mahmoud Mandour , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 15/36] tests/docker: convert riscv64-cross to lcitool Date: Tue, 27 Jun 2023 17:09:22 +0100 Message-Id: <20230627160943.2956928-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627160943.2956928-1-alex.bennee@linaro.org> References: <20230627160943.2956928-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1687882473757100011 We still need to base this on Debian Sid until riscv64 is promoted to a release architecture (or another distro provides a full cross compile target). We use the new qemu-minimal project description to avoid bringing in all the extra dependencies because every extra package is another chance for sid to fail. Signed-off-by: Alex Benn=C3=A9e --- .../dockerfiles/debian-riscv64-cross.docker | 119 +++++++++++------- tests/lcitool/projects/qemu-minimal.yml | 4 + tests/lcitool/refresh | 10 +- 3 files changed, 87 insertions(+), 46 deletions(-) diff --git a/tests/docker/dockerfiles/debian-riscv64-cross.docker b/tests/d= ocker/dockerfiles/debian-riscv64-cross.docker index 081404e014..a2d879ee1f 100644 --- a/tests/docker/dockerfiles/debian-riscv64-cross.docker +++ b/tests/docker/dockerfiles/debian-riscv64-cross.docker @@ -1,54 +1,85 @@ +# THIS FILE WAS AUTO-GENERATED # -# Docker cross-compiler target for riscv64 +# $ lcitool dockerfile --layers all --cross riscv64 debian-sid qemu-minim= al # -# Currently the only distro that gets close to cross compiling riscv64 -# images is Debian Sid (with unofficial ports). As this is a moving -# target we keep the library list minimal and are aiming to migrate -# from this hack as soon as we are able. -# -FROM docker.io/library/debian:sid-slim +# https://gitlab.com/libvirt/libvirt-ci =20 -# Add ports -RUN apt update && \ - DEBIAN_FRONTEND=3Dnoninteractive apt install -yy eatmydata && \ - DEBIAN_FRONTEND=3Dnoninteractive eatmydata apt update -yy && \ - DEBIAN_FRONTEND=3Dnoninteractive eatmydata apt upgrade -yy - -# Install common build utilities -RUN DEBIAN_FRONTEND=3Dnoninteractive eatmydata apt install -yy \ - bison \ - bc \ - build-essential \ - ca-certificates \ - debian-ports-archive-keyring \ - dpkg-dev \ - flex \ - gettext \ - git \ - libglib2.0-dev \ - ninja-build \ - pkg-config \ - python3 \ - python3-venv +FROM docker.io/library/debian:sid-slim =20 -# Add ports and riscv64 architecture -RUN echo "deb http://ftp.ports.debian.org/debian-ports/ sid main" >> /etc/= apt/sources.list -RUN dpkg --add-architecture riscv64 +RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ + apt-get update && \ + apt-get install -y eatmydata && \ + eatmydata apt-get dist-upgrade -y && \ + eatmydata apt-get install --no-install-recommends -y \ + bash \ + bc \ + bison \ + ca-certificates \ + ccache \ + findutils \ + flex \ + gcc \ + git \ + libglib2.0-dev \ + locales \ + make \ + meson \ + ninja-build \ + pkgconf \ + python3 \ + python3-venv \ + sed \ + tar && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \ + dpkg-reconfigure locales =20 -# Duplicate deb line as deb-src -RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sourc= es.list +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" +ENV LANG "en_US.UTF-8" +ENV MAKE "/usr/bin/make" +ENV NINJA "/usr/bin/ninja" +ENV PYTHON "/usr/bin/python3" =20 -RUN apt update && \ - DEBIAN_FRONTEND=3Dnoninteractive eatmydata \ - apt install -y --no-install-recommends \ - gcc-riscv64-linux-gnu \ - libc6-dev-riscv64-cross \ - libfdt-dev:riscv64 \ - libffi-dev:riscv64 \ - libglib2.0-dev:riscv64 \ - libpixman-1-dev:riscv64 +RUN export DEBIAN_FRONTEND=3Dnoninteractive && \ + dpkg --add-architecture riscv64 && \ + eatmydata apt-get install debian-ports-archive-keyring && \ + eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ sid main= ' > /etc/apt/sources.list.d/ports.list && \ + eatmydata echo 'deb http://ftp.ports.debian.org/debian-ports/ unreleas= ed main' >> /etc/apt/sources.list.d/ports.list && \ + eatmydata apt-get update && \ + eatmydata apt-get dist-upgrade -y && \ + eatmydata apt-get install --no-install-recommends -y dpkg-dev && \ + eatmydata apt-get install --no-install-recommends -y \ + g++-riscv64-linux-gnu \ + gcc-riscv64-linux-gnu \ + libc6-dev:riscv64 \ + libfdt-dev:riscv64 \ + libffi-dev:riscv64 \ + libglib2.0-dev:riscv64 \ + libpixman-1-dev:riscv64 && \ + eatmydata apt-get autoremove -y && \ + eatmydata apt-get autoclean -y && \ + mkdir -p /usr/local/share/meson/cross && \ + printf "[binaries]\n\ +c =3D '/usr/bin/riscv64-linux-gnu-gcc'\n\ +ar =3D '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\ +strip =3D '/usr/bin/riscv64-linux-gnu-strip'\n\ +pkgconfig =3D '/usr/bin/riscv64-linux-gnu-pkg-config'\n\ +\n\ +[host_machine]\n\ +system =3D 'linux'\n\ +cpu_family =3D 'riscv64'\n\ +cpu =3D 'riscv64'\n\ +endian =3D 'little'\n" > /usr/local/share/meson/cross/riscv64-linux-gnu &&= \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --sh= ow > /packages.txt && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-c= ++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-c= c && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-g= ++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/riscv64-linux-gnu-g= cc =20 -# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV ABI "riscv64-linux-gnu" +ENV MESON_OPTS "--cross-file=3Driscv64-linux-gnu" ENV QEMU_CONFIGURE_OPTS --cross-prefix=3Driscv64-linux-gnu- ENV DEF_TARGET_LIST riscv64-softmmu,riscv64-linux-user # As a final step configure the user (if env is defined) diff --git a/tests/lcitool/projects/qemu-minimal.yml b/tests/lcitool/projec= ts/qemu-minimal.yml index b60fec715c..d44737dc1d 100644 --- a/tests/lcitool/projects/qemu-minimal.yml +++ b/tests/lcitool/projects/qemu-minimal.yml @@ -4,6 +4,8 @@ packages: - bash - bc - bison + - ccache + - findutils - flex - g++ - gcc @@ -21,3 +23,5 @@ packages: - pkg-config - python3 - python3-venv + - sed + - tar diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index 5e06fb2cf5..b54566edcc 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -63,12 +63,12 @@ add_user_mapping =3D [ " id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi\n" ] =20 -def generate_dockerfile(host, target, cross=3DNone, trailer=3DNone): +def generate_dockerfile(host, target, project=3D"qemu", cross=3DNone, trai= ler=3DNone): filename =3D Path(src_dir, "tests", "docker", "dockerfiles", host + ".= docker") cmd =3D lcitool_cmd + ["dockerfile"] if cross is not None: cmd.extend(["--cross", cross]) - cmd.extend([target, "qemu"]) + cmd.extend([target, project]) =20 if trailer is not None: trailer +=3D "\n".join(add_user_mapping) @@ -164,6 +164,12 @@ try: trailer=3Dcross_build("powerpc64le-linux-gnu-", "ppc64-softmmu,ppc64-linux-use= r")) =20 + generate_dockerfile("debian-riscv64-cross", "debian-sid", + project=3D"qemu-minimal", + cross=3D"riscv64", + trailer=3Dcross_build("riscv64-linux-gnu-", + "riscv64-softmmu,riscv64-linux= -user")) + generate_dockerfile("debian-s390x-cross", "debian-11", cross=3D"s390x", trailer=3Dcross_build("s390x-linux-gnu-", --=20 2.39.2