From nobody Sun Nov 24 00:45:46 2024 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1728321521; cv=none; d=zohomail.com; s=zohoarc; b=jp9XEywNFMUOYJfSwgkgWnJz/AE/8E3B+18q7woskZZdMjplmjhRczfX1ntJMIRv6BAifBnvgtWV+DaYgBArwHmLkFXfIT9TMaLaKlhztAyw9kj60XSHEqizdgDN+dwQQLbCFL0yMreau2UxZpO1gM7bq8KzTex3//9vCgCBsLY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728321521; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8flSEvkTKNfQE0YmmjDCEHuPtG8e2TAlNuuJGdu2NLU=; b=f3pxkyVnwjKi6Vv4V5BYdmDhkKhZ/PiAULckj61RWzrGKAtpHRrI9R5Uz8NSWAcS0vNEXOTcpePWdxB/KVoOcOedGI+NsyIzHjnh6UgMqGXpdY796hS8A9ReCyxGgjSKPZ6TzSs9E1HrYyKUoi9J5rlEaYQd8GKqRu7e6wVi9D0= 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 1728321521921365.8091195668617; Mon, 7 Oct 2024 10:18:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sxrMT-00035P-Cq; Mon, 07 Oct 2024 13:17:33 -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 1sxrMQ-00034v-6q for qemu-devel@nongnu.org; Mon, 07 Oct 2024 13:17:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sxrMO-00051e-8U for qemu-devel@nongnu.org; Mon, 07 Oct 2024 13:17:29 -0400 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-296-c_txk0gBM0K5f7InUXD4Ew-1; Mon, 07 Oct 2024 13:17:26 -0400 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-42cb5f6708aso29949945e9.2 for ; Mon, 07 Oct 2024 10:17:26 -0700 (PDT) Received: from avogadro.local ([151.62.111.131]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42f89e89fcbsm80673675e9.15.2024.10.07.10.17.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 10:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728321447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8flSEvkTKNfQE0YmmjDCEHuPtG8e2TAlNuuJGdu2NLU=; b=TX0+E3EbumSm74S/9PKoemHrCJlHrT201W8LjmJxq3pnPbR1N3ZIHjBcogqJthwvOb7CUR kwhDFzHt9YZJHd32/d7ulpYqb6V11Ct/vhlpk0DKdd8zAAj3AUspFQB7Yh+A0OOtysrhqF tAqnnF50d+9uWFO+nkzyG3GJeK7GKeo= X-MC-Unique: c_txk0gBM0K5f7InUXD4Ew-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728321445; x=1728926245; 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=8flSEvkTKNfQE0YmmjDCEHuPtG8e2TAlNuuJGdu2NLU=; b=YLLi5NoSsIoacgBCsFAAsY7Mhb6T4pwxbWxJo+VsR5Pv5FA6M1DtPXlh5KjlvR/Q4w HfPJMux1G3jchDmtImmkpKA3OycaCKsdM3E9tgMcfwWZljhgaY8hp5IoVjSlx1lvZJ8U rYobmxl9I9hWDrq4BQWjOsHBrz7N1FgoNf7ROB+g6SIieam1X/08sNlfpct5f4a7wK6V UCEjW3JYVbzpt6UE/bl8yJZ67oMIycJB2a7anxNPd9j5YZBCkTfEL1mdjzA8Lzvx1mLp i1F7dMCncz49zbVKFHfqsF6Zi7KUUPyzWVzyGKlahfKQdsrqGHxAWW2GH/i9VjNVuMaM cGhQ== X-Gm-Message-State: AOJu0YxRYo6KagPr6nG6NNg/caPi2L49uQjPccGPK3KtHPbCnWrP0ZMh lMliH/cKCEUcEZOKZvWa73k322g9o9VOEDCy9hRemAQUGr8uxpRG2vHj0dQzZwNY+O7hLStnkZ5 K1/A0DAFtBq96rpdG1E5mlST3YKGNJzJnyQEUl6BXupHS6Ge6KXKl1uwRHJzphIOhdiUD9/IhyR lP7Xp+eSo3OSnmo6Hdb0QHDqabRLT1/XO89U5dPhM= X-Received: by 2002:a05:600c:3c8c:b0:42d:a024:d6bb with SMTP id 5b1f17b1804b1-42f85abf4damr77964965e9.20.1728321444771; Mon, 07 Oct 2024 10:17:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJaKVJFux0yNog9eMBBzHVTv1gveKmR0hy3616euumMMHRIr3jds6dAbE/SAfRNHFaCM22kA== X-Received: by 2002:a05:600c:3c8c:b0:42d:a024:d6bb with SMTP id 5b1f17b1804b1-42f85abf4damr77964775e9.20.1728321444309; Mon, 07 Oct 2024 10:17:24 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Manos Pitsidianakis , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH 1/2] dockerfiles: add a Dockerfile using a nightly Rust toolchain Date: Mon, 7 Oct 2024 19:17:12 +0200 Message-ID: <20241007171717.1436982-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20241007171717.1436982-1-pbonzini@redhat.com> References: <20241007171717.1436982-1-pbonzini@redhat.com> MIME-Version: 1.0 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=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.153, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.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 @redhat.com) X-ZM-MESSAGEID: 1728321523952116600 Content-Type: text/plain; charset="utf-8" This will be useful in order to test QEMU's Rust code with nightly clippy. It can also be used to check that the code builds, until the minimum supported Rust version is lowered enough to allow enabling Rust in other Dockerfiles too. Use a separate container, instead of the Fedora one, to avoid that CI breaks for everyone if for some reason the rustup build turns out to be shaky. Signed-off-by: Paolo Bonzini Reviewed-by: Daniel P. Berrang=C3=A9 --- .../dockerfiles/fedora-rust-nightly.docker | 173 ++++++++++++++++++ tests/lcitool/refresh | 26 +++ 2 files changed, 199 insertions(+) create mode 100644 tests/docker/dockerfiles/fedora-rust-nightly.docker diff --git a/tests/docker/dockerfiles/fedora-rust-nightly.docker b/tests/do= cker/dockerfiles/fedora-rust-nightly.docker new file mode 100644 index 00000000000..e642db163c7 --- /dev/null +++ b/tests/docker/dockerfiles/fedora-rust-nightly.docker @@ -0,0 +1,173 @@ +# THIS FILE WAS AUTO-GENERATED +# +# $ lcitool dockerfile --layers all fedora-40 qemu +# +# https://gitlab.com/libvirt/libvirt-ci + +FROM registry.fedoraproject.org/fedora:40 + +RUN dnf install -y nosync && \ + printf '#!/bin/sh\n\ +if test -d /usr/lib64\n\ +then\n\ + export LD_PRELOAD=3D/usr/lib64/nosync/nosync.so\n\ +else\n\ + export LD_PRELOAD=3D/usr/lib/nosync/nosync.so\n\ +fi\n\ +exec "$@"\n' > /usr/bin/nosync && \ + chmod +x /usr/bin/nosync && \ + nosync dnf update -y && \ + nosync dnf install -y \ + SDL2-devel \ + SDL2_image-devel \ + alsa-lib-devel \ + bash \ + bc \ + bison \ + brlapi-devel \ + bzip2 \ + bzip2-devel \ + ca-certificates \ + capstone-devel \ + ccache \ + clang \ + ctags \ + cyrus-sasl-devel \ + daxctl-devel \ + dbus-daemon \ + device-mapper-multipath-devel \ + diffutils \ + findutils \ + flex \ + fuse3-devel \ + gcc \ + gcovr \ + gettext \ + git \ + glib2-devel \ + glib2-static \ + glibc-langpack-en \ + glibc-static \ + glusterfs-api-devel \ + gnutls-devel \ + gtk-vnc2-devel \ + gtk3-devel \ + hostname \ + jemalloc-devel \ + json-c-devel \ + libaio-devel \ + libasan \ + libattr-devel \ + libbpf-devel \ + libcacard-devel \ + libcap-ng-devel \ + libcmocka-devel \ + libcurl-devel \ + libdrm-devel \ + libepoxy-devel \ + libfdt-devel \ + libffi-devel \ + libgcrypt-devel \ + libiscsi-devel \ + libjpeg-devel \ + libnfs-devel \ + libpmem-devel \ + libpng-devel \ + librbd-devel \ + libseccomp-devel \ + libselinux-devel \ + libslirp-devel \ + libssh-devel \ + libtasn1-devel \ + libubsan \ + liburing-devel \ + libusbx-devel \ + libxdp-devel \ + libzstd-devel \ + llvm \ + lttng-ust-devel \ + lzo-devel \ + make \ + mesa-libgbm-devel \ + meson \ + mtools \ + ncurses-devel \ + nettle-devel \ + ninja-build \ + nmap-ncat \ + numactl-devel \ + openssh-clients \ + pam-devel \ + pcre-static \ + pipewire-devel \ + pixman-devel \ + pkgconfig \ + pulseaudio-libs-devel \ + python3 \ + python3-PyYAML \ + python3-numpy \ + python3-opencv \ + python3-pillow \ + python3-pip \ + python3-sphinx \ + python3-sphinx_rtd_theme \ + python3-zombie-imp \ + rdma-core-devel \ + sed \ + snappy-devel \ + socat \ + sparse \ + spice-protocol \ + spice-server-devel \ + swtpm \ + systemd-devel \ + systemtap-sdt-devel \ + tar \ + tesseract \ + tesseract-langpack-eng \ + usbredir-devel \ + util-linux \ + virglrenderer-devel \ + vte291-devel \ + which \ + xen-devel \ + xorriso \ + zlib-devel \ + zlib-static \ + zstd && \ + nosync dnf autoremove -y && \ + nosync dnf clean all -y && \ + rm -f /usr/lib*/python3*/EXTERNALLY-MANAGED && \ + rpm -qa | sort > /packages.txt && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc + +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 dnf install -y wget +ENV RUSTUP_HOME=3D/usr/local/rustup CARGO_HOME=3D/usr/local/cargo +ENV RUSTC=3D/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/= bin/rustc +RUN set -eux && \ + rustArch=3D'x86_64-unknown-linux-gnu' && \ + rustupSha256=3D'6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41= f920f56d' && \ + url=3D"https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/ru= stup-init" && \ + wget "$url" && \ + echo "${rustupSha256} *rustup-init" | sha256sum -c - && \ + chmod +x rustup-init && \ + ./rustup-init -y --no-modify-path --profile default --default-toolchain = nightly --default-host ${rustArch} && \ + chmod -R a+w $RUSTUP_HOME $CARGO_HOME && \ + /usr/local/cargo/bin/rustup --version && \ + /usr/local/cargo/bin/rustup run nightly rustc --version && \ + test "$RUSTC" =3D "$(/usr/local/cargo/bin/rustup +nightly which rustc)" +ENV PATH=3D$CARGO_HOME/bin:$PATH +RUN /usr/local/cargo/bin/rustup run nightly cargo install bindgen-cli +# As a final step configure the user (if env is defined) +ARG USER +ARG UID +RUN if [ "${USER}" ]; then \ + id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh index a78219f7bc5..1ae0962f04c 100755 --- a/tests/lcitool/refresh +++ b/tests/lcitool/refresh @@ -116,6 +116,26 @@ debian12_extras =3D [ "ENV QEMU_CONFIGURE_OPTS --enable-netmap\n" ] =20 +# Based on the hub.docker.com/library/rust Dockerfiles +fedora_rustup_nightly_extras =3D [ + "RUN dnf install -y wget\n", + "ENV RUSTUP_HOME=3D/usr/local/rustup CARGO_HOME=3D/usr/local/cargo\n", + "ENV RUSTC=3D/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux= -gnu/bin/rustc\n", + "RUN set -eux && \\\n", + " rustArch=3D'x86_64-unknown-linux-gnu' && \\\n", + " rustupSha256=3D'6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def5= 78d41f920f56d' && \\\n", + ' url=3D"https://static.rust-lang.org/rustup/archive/1.27.1/${rustArc= h}/rustup-init" && \\\n', + ' wget "$url" && \\\n', + ' echo "${rustupSha256} *rustup-init" | sha256sum -c - && \\\n', + " chmod +x rustup-init && \\\n", + " ./rustup-init -y --no-modify-path --profile default --default-toolc= hain nightly --default-host ${rustArch} && \\\n", + " chmod -R a+w $RUSTUP_HOME $CARGO_HOME && \\\n", + " /usr/local/cargo/bin/rustup --version && \\\n", + " /usr/local/cargo/bin/rustup run nightly rustc --version && \\\n", + ' test "$RUSTC" =3D "$(/usr/local/cargo/bin/rustup +nightly which rus= tc)"\n', + 'ENV PATH=3D$CARGO_HOME/bin:$PATH\n', + 'RUN /usr/local/cargo/bin/rustup run nightly cargo install bindgen-cli= \n', +] =20 def cross_build(prefix, targets): conf =3D "ENV QEMU_CONFIGURE_OPTS --cross-prefix=3D%s\n" % (prefix) @@ -139,6 +159,12 @@ try: generate_dockerfile("opensuse-leap", "opensuse-leap-15") generate_dockerfile("ubuntu2204", "ubuntu-2204") =20 + # + # Non-fatal Rust-enabled build + # + generate_dockerfile("fedora-rust-nightly", "fedora-40", + trailer=3D"".join(fedora_rustup_nightly_extras)) + # # Cross compiling builds # --=20 2.46.1