From patchwork Mon Jun 26 21:59:15 2023 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: 696504 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3448081wrm; Mon, 26 Jun 2023 15:03:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6tVWtCcbZ4QhW+Pw8qUZf7jOtbJjSSWGJO+lkE5cs4kLxEW8Y0LKVZoRUR6MxwIhFqcx53 X-Received: by 2002:ad4:5c6f:0:b0:635:d10b:aeb0 with SMTP id i15-20020ad45c6f000000b00635d10baeb0mr7379077qvh.57.1687817007157; Mon, 26 Jun 2023 15:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687817007; cv=none; d=google.com; s=arc-20160816; b=y1c1pvoyCH4mTdLpvmh9dgn4iuCL2mG8Ln0irrfkLF4zPuEvCCO4qkVvoSeKBBf5vj zuzMaYeSRTuAMiyDJkBL+QzLjaLyBUFNUwCsanHJr9gDWtpW8pTerqPaMdrBBF9QUq37 9bNB42wcAELuPw0PKooPWT4FkUPzR9+UJEGaergygKthMmgeCL9dwCoEGJUEStra7FBI u+ZVRKBUk9acKB3+fvervD0qzR/PT+/CQKeyv8AEXGZRSSJkDngnN1j8AIFQbZzZelVf GGO0UmGo1vSMomLiBHwksgccSoVFx/K9WlUBX+21BTbAyEj+kkjWdLQl36Ud8HcXtE/k Kvuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=CntAb+cgLtatchfM+3lzjapvTHJaq2r9C16N2thtx8U=; fh=sQEya64SXtq2IEsk3H77u01QQAMvGjGQGvqUW/mcVd0=; b=hs4Q17V+wKmqM7xg8/tZbDfSD7AY23qhKfFHBdj0/vsmjOnUykSo+EPvsjBsbboGxc pw+97eGnZAzbSo/Hk5EeLdkP8uNU5uAfrvwWqvoSDTsqvLhhZOfmKUqQvdQO0Ola93AB O0QIG3c1eH5q0cTTntbR7sHJkec0GC1e4cu6DyVEImwQWagneAaFNYTVWgV9NoiA+Qrw wjPVIsmt3tUMc+9IYw5lMKI1wL7cnJn+5QEKllPxxcm23Xr5xfCyeWhm+6SOFyssNXR7 PSvwIRgIcC5Zgz/JeElYl8Z18azrUDgpU9bq9LBTEQBFtzIlLdqqtTbAmhzZJHTdBwKN mXkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J+zL8Mxv; 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=pass (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 g10-20020a0562140aca00b006260b52a5c4si2475346qvi.389.2023.06.26.15.03.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2023 15:03:27 -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=pass header.i=@linaro.org header.s=google header.b=J+zL8Mxv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDuFM-0002if-Fn; Mon, 26 Jun 2023 17:59:44 -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 1qDuFK-0002gD-5O for qemu-devel@nongnu.org; Mon, 26 Jun 2023 17:59:42 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDuFE-0004ud-9M for qemu-devel@nongnu.org; Mon, 26 Jun 2023 17:59:41 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f9ede60140so35849605e9.0 for ; Mon, 26 Jun 2023 14:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687816775; x=1690408775; 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=J+zL8MxvZNzHOX8kXWaNa0/a65S4jsJSKUS25Oc34Kk33lGxd18SFoyPsW49oYT0uu k6bRYPIz0xtGT5KWohXRfnmAvxDBX5GhM4irHPB3iPiIdg1PitP+7uergBT5fo0vjJS6 FUUsuUZCGHJMbbNkWBdVArcjI/CPSmBhcRZNFDZ1l/qVeY4SmL/4fRiV54FFYx680yim hBbLs+piJSdIvIaSHBBet6/QcHK9fEEgp24gt+gjmHbusaa6JUPnHie7NGe05XUgsm6K 5EnjhHa+9xNtPm2Ec/Tusef6QyQ/b7wpdv8oNmK+QoKGC9C+O+msdn5TmyJxzEoQJLik sd1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687816775; x=1690408775; 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=jFCZP3HE36k5JNll2rgVBwldeiV4EzUxzKH4u8UDtCfGffLMJLsVZwxi8BahvSlUit Us5ctjkL4FanQllLfyX81MONKI5m6zJOXPYc1VkxZBmVudFkpCjpKnGhRhybGQSliklW FUrHmJGBqvYewL43a4C9RGGkZsEvT63XGj4SP1fXQVGrfHHDN5aCvZOv3EfZw/QtqbE/ 1H0YOfdUjh10k2nAD9OrdhsECYEAOB7XFqXd3Q5TmPqJMC2iecWO4nmc3Ojf1KUj76r+ lIP7RuX6EEBiY7isxtDM9TEeHPYCI4xRt+x303yYINHLg9NvwR7Sy62mlMTz93kxjbiF xfig== X-Gm-Message-State: AC+VfDyyd+lTui1+TdrtW6cyiXBz83BG7LA3dJaipH8ARzmLyOt1rbaZ KgeP1bISGb+kR7GGsBSZrd/okA== X-Received: by 2002:a7b:c5c7:0:b0:3f8:946:115d with SMTP id n7-20020a7bc5c7000000b003f80946115dmr21414182wmk.30.1687816774954; Mon, 26 Jun 2023 14:59:34 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id u3-20020a05600c00c300b003faa6ce54b2sm2872517wmm.2.2023.06.26.14.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 14:59:34 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9CC891FFC7; Mon, 26 Jun 2023 22:59:28 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexander Bulekov , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Juan Quintela , Alexandre Iooss , Thomas Huth , Marcel Apfelbaum , Leif Lindholm , Riku Voipio , Peter Maydell , Paolo Bonzini , Bandan Das , Leonardo Bras , Cleber Rosa , Richard Henderson , Beraldo Leal , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Xu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mahmoud Mandour , Stefan Hajnoczi , Yanan Wang , Eduardo Habkost , Bin Meng , qemu-arm@nongnu.org, Wainer dos Santos Moschetta , Darren Kenny , Radoslaw Biernacki , Marcin Juszkiewicz , Qiuhao Li , Laurent Vivier Subject: [PATCH v2 15/26] tests/docker: convert riscv64-cross to lcitool Date: Mon, 26 Jun 2023 22:59:15 +0100 Message-Id: <20230626215926.2522656-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626215926.2522656-1-alex.bennee@linaro.org> References: <20230626215926.2522656-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée --- .../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/docker/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-minimal # -# 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 -# Add ports -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ - DEBIAN_FRONTEND=noninteractive eatmydata apt update -yy && \ - DEBIAN_FRONTEND=noninteractive eatmydata apt upgrade -yy - -# Install common build utilities -RUN DEBIAN_FRONTEND=noninteractive 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 -# 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=noninteractive && \ + 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 -# Duplicate deb line as deb-src -RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.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" -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive 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=noninteractive && \ + 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/ unreleased 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 = '/usr/bin/riscv64-linux-gnu-gcc'\n\ +ar = '/usr/bin/riscv64-linux-gnu-gcc-ar'\n\ +strip = '/usr/bin/riscv64-linux-gnu-strip'\n\ +pkgconfig = '/usr/bin/riscv64-linux-gnu-pkg-config'\n\ +\n\ +[host_machine]\n\ +system = 'linux'\n\ +cpu_family = 'riscv64'\n\ +cpu = 'riscv64'\n\ +endian = 'little'\n" > /usr/local/share/meson/cross/riscv64-linux-gnu && \ + dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /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-cc && \ + 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-gcc -# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV ABI "riscv64-linux-gnu" +ENV MESON_OPTS "--cross-file=riscv64-linux-gnu" ENV QEMU_CONFIGURE_OPTS --cross-prefix=riscv64-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/projects/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 = [ " id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi\n" ] -def generate_dockerfile(host, target, cross=None, trailer=None): +def generate_dockerfile(host, target, project="qemu", cross=None, trailer=None): filename = Path(src_dir, "tests", "docker", "dockerfiles", host + ".docker") cmd = lcitool_cmd + ["dockerfile"] if cross is not None: cmd.extend(["--cross", cross]) - cmd.extend([target, "qemu"]) + cmd.extend([target, project]) if trailer is not None: trailer += "\n".join(add_user_mapping) @@ -164,6 +164,12 @@ try: trailer=cross_build("powerpc64le-linux-gnu-", "ppc64-softmmu,ppc64-linux-user")) + generate_dockerfile("debian-riscv64-cross", "debian-sid", + project="qemu-minimal", + cross="riscv64", + trailer=cross_build("riscv64-linux-gnu-", + "riscv64-softmmu,riscv64-linux-user")) + generate_dockerfile("debian-s390x-cross", "debian-11", cross="s390x", trailer=cross_build("s390x-linux-gnu-",