aboutsummaryrefslogtreecommitdiff
path: root/tests/lcitool/refresh
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-10-07 16:36:59 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2024-10-11 12:32:17 +0200
commit8105ca851246338d58ee329d8471878023650b5a (patch)
tree746192ff275038885f292d9a8d04cbbe6c1c13ee /tests/lcitool/refresh
parent8db4e0f92e83fd80b6609439440b303ddded7ad8 (diff)
dockerfiles: add a Dockerfile using a nightly Rust toolchain
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. Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/lcitool/refresh')
-rwxr-xr-xtests/lcitool/refresh26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
index a78219f7bc..1ae0962f04 100755
--- a/tests/lcitool/refresh
+++ b/tests/lcitool/refresh
@@ -116,6 +116,26 @@ debian12_extras = [
"ENV QEMU_CONFIGURE_OPTS --enable-netmap\n"
]
+# Based on the hub.docker.com/library/rust Dockerfiles
+fedora_rustup_nightly_extras = [
+ "RUN dnf install -y wget\n",
+ "ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo\n",
+ "ENV RUSTC=/usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc\n",
+ "RUN set -eux && \\\n",
+ " rustArch='x86_64-unknown-linux-gnu' && \\\n",
+ " rustupSha256='6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d' && \\\n",
+ ' url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/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-toolchain 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" = "$(/usr/local/cargo/bin/rustup +nightly which rustc)"\n',
+ 'ENV PATH=$CARGO_HOME/bin:$PATH\n',
+ 'RUN /usr/local/cargo/bin/rustup run nightly cargo install bindgen-cli\n',
+]
def cross_build(prefix, targets):
conf = "ENV QEMU_CONFIGURE_OPTS --cross-prefix=%s\n" % (prefix)
@@ -140,6 +160,12 @@ try:
generate_dockerfile("ubuntu2204", "ubuntu-2204")
#
+ # Non-fatal Rust-enabled build
+ #
+ generate_dockerfile("fedora-rust-nightly", "fedora-40",
+ trailer="".join(fedora_rustup_nightly_extras))
+
+ #
# Cross compiling builds
#
generate_dockerfile("debian-amd64-cross", "debian-12",