On Fri, Sep 19, 2025 at 05:33:12PM +0400, [email protected] wrote:
> From: Marc-André Lureau <[email protected]>
> 
> Enable Rust on various distro images: alpine, centos, debian, fedora,
> opensuse.
> 
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
>  tests/docker/dockerfiles/alpine.docker             |  2 ++
>  tests/docker/dockerfiles/centos9.docker            |  2 ++
>  tests/docker/dockerfiles/debian-amd64-cross.docker |  2 ++
>  tests/docker/dockerfiles/debian-arm64-cross.docker |  2 ++
>  tests/docker/dockerfiles/debian-armhf-cross.docker |  2 ++
>  tests/docker/dockerfiles/debian-i686-cross.docker  |  2 ++
>  .../docker/dockerfiles/debian-ppc64el-cross.docker |  2 ++
>  .../docker/dockerfiles/debian-riscv64-cross.docker |  2 ++
>  tests/docker/dockerfiles/debian-s390x-cross.docker |  2 ++
>  tests/docker/dockerfiles/debian.docker             |  2 ++
>  .../docker/dockerfiles/fedora-rust-nightly.docker  |  2 ++
>  tests/docker/dockerfiles/fedora.docker             |  2 ++
>  tests/docker/dockerfiles/opensuse-leap.docker      |  2 ++
>  tests/lcitool/refresh                              | 14 +++++++++++---
>  14 files changed, 37 insertions(+), 3 deletions(-)

snip

> diff --git a/tests/docker/dockerfiles/opensuse-leap.docker 
> b/tests/docker/dockerfiles/opensuse-leap.docker
> index d71dbc30c7..2b6d7efd94 100644
> --- a/tests/docker/dockerfiles/opensuse-leap.docker
> +++ b/tests/docker/dockerfiles/opensuse-leap.docker
> @@ -148,3 +148,5 @@ ARG USER
>  ARG UID
>  RUN if [ "${USER}" ]; then \
>    id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi
> +
> +ENV ENABLE_RUST 1
> \ No newline at end of file
> diff --git a/tests/lcitool/refresh b/tests/lcitool/refresh
> index 649568c5c2..c585baa89c 100755
> --- a/tests/lcitool/refresh
> +++ b/tests/lcitool/refresh
> @@ -63,7 +63,8 @@ add_user_mapping = [
>      "  id ${USER} 2>/dev/null || useradd -u ${UID} -U ${USER}; fi\n"
>  ]
>  
> -def generate_dockerfile(host, target, project="qemu", cross=None, 
> trailer=None):
> +def generate_dockerfile(host, target, project="qemu", cross=None, 
> trailer=None,
> +                        enable_rust=True):
>      filename = Path(src_dir, "tests", "docker", "dockerfiles", host + 
> ".docker")
>      cmd = lcitool_cmd + ["dockerfile"]
>      if cross is not None:
> @@ -75,6 +76,8 @@ def generate_dockerfile(host, target, project="qemu", 
> cross=None, trailer=None):
>      else:
>          trailer = "\n".join(add_user_mapping)
>  
> +    if enable_rust:
> +        trailer += "\nENV ENABLE_RUST 1"

Needs a trailing newline to remove all the

 "\ No newline at end of file"

warnings which will result in excessive diff context on subsequent
additions.

>      generate(filename, cmd, trailer)
>  
>  
> @@ -180,7 +183,9 @@ try:
>      generate_dockerfile("fedora", "fedora-41")
>      generate_dockerfile("opensuse-leap", "opensuse-leap-15")
>      generate_dockerfile("ubuntu2204", "ubuntu-2204",
> -                        trailer="".join(ubuntu2204_rust_extras))
> +                        trailer="".join(ubuntu2204_rust_extras),
> +                        # 
> https://bugs.launchpad.net/ubuntu/+source/rustc-1.83/+bug/2120318
> +                        enable_rust=False)
>  
>      #
>      # Non-fatal Rust-enabled build
> @@ -237,7 +242,10 @@ try:
>                          project='qemu,qemu-win-installer',
>                          cross="mingw64",
>                          trailer=cross_build("x86_64-w64-mingw32-",
> -                                            "x86_64-softmmu"))
> +                                            "x86_64-softmmu"),
> +                        # linking with rust is buggy:
> +                        # https://github.com/mesonbuild/meson/pull/14991
> +                        enable_rust=False)
>  
>      #
>      # Cirrus packages lists for GitLab
> -- 
> 2.51.0
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


Reply via email to