[PATCH v2 22/27] RFC: tests/docker: add rust to debian-legacy-test-cross

marcandre.lureau--- via Devel posted 27 patches 4 days, 3 hours ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Yonggang Luo <luoyonggang@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, Kohei Tokunaga <ktokunaga.mail@gmail.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>
[PATCH v2 22/27] RFC: tests/docker: add rust to debian-legacy-test-cross
Posted by marcandre.lureau@redhat.com 4 days, 3 hours ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Unfortunately, debian 11 has bindgen version 0.55...
Should we install it with cargo install bindgen-cli?

Linking is still failing with -lrt, despite it being present in the link arguments...

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 .gitlab-ci.d/buildtest.yml                               | 2 +-
 tests/docker/dockerfiles/debian-legacy-test-cross.docker | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index c3467200f4..34d8c1a496 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -389,7 +389,7 @@ build-legacy:
   variables:
     IMAGE: debian-legacy-test-cross
     TARGETS: alpha-linux-user alpha-softmmu sh4-linux-user
-    CONFIGURE_ARGS: --disable-tools
+    CONFIGURE_ARGS: --disable-tools --enable-rust
     MAKE_CHECK_ARGS: check-tcg
 
 build-user-hexagon:
diff --git a/tests/docker/dockerfiles/debian-legacy-test-cross.docker b/tests/docker/dockerfiles/debian-legacy-test-cross.docker
index 5a6616b7d3..f9b31b0eab 100644
--- a/tests/docker/dockerfiles/debian-legacy-test-cross.docker
+++ b/tests/docker/dockerfiles/debian-legacy-test-cross.docker
@@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
 RUN DEBIAN_FRONTEND=noninteractive eatmydata \
         apt install -y --no-install-recommends \
         bison \
+        cargo-web \
         ccache \
         clang  \
         flex \
@@ -36,14 +37,20 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
         python3-pip \
         python3-setuptools \
         python3-venv \
-        python3-wheel && \
+        python3-wheel \
+        rustc-web \
+        && \
         dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
 
+ENV CARGO_HOME=/usr/local/cargo
+RUN cargo install bindgen-cli
+
 RUN /usr/bin/pip3 install tomli
 
 ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
 ENV DEF_TARGET_LIST alpha-linux-user,sh4-linux-user
 ENV MAKE /usr/bin/make
+ENV PATH=$CARGO_HOME/bin:$PATH
 # As a final step configure the user (if env is defined)
 ARG USER
 ARG UID
-- 
2.51.0


Re: [PATCH v2 22/27] RFC: tests/docker: add rust to debian-legacy-test-cross
Posted by Alex Bennée 1 day, 23 hours ago
marcandre.lureau@redhat.com writes:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Unfortunately, debian 11 has bindgen version 0.55...
> Should we install it with cargo install bindgen-cli?

I wouldn't bother. This only exists for older targets that are either
linux-user or unlikely to get a rust version of any of their device
backends.

>
> Linking is still failing with -lrt, despite it being present in the link arguments...
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  .gitlab-ci.d/buildtest.yml                               | 2 +-
>  tests/docker/dockerfiles/debian-legacy-test-cross.docker | 9 ++++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
> index c3467200f4..34d8c1a496 100644
> --- a/.gitlab-ci.d/buildtest.yml
> +++ b/.gitlab-ci.d/buildtest.yml
> @@ -389,7 +389,7 @@ build-legacy:
>    variables:
>      IMAGE: debian-legacy-test-cross
>      TARGETS: alpha-linux-user alpha-softmmu sh4-linux-user
> -    CONFIGURE_ARGS: --disable-tools
> +    CONFIGURE_ARGS: --disable-tools --enable-rust
>      MAKE_CHECK_ARGS: check-tcg
>  
>  build-user-hexagon:
> diff --git a/tests/docker/dockerfiles/debian-legacy-test-cross.docker b/tests/docker/dockerfiles/debian-legacy-test-cross.docker
> index 5a6616b7d3..f9b31b0eab 100644
> --- a/tests/docker/dockerfiles/debian-legacy-test-cross.docker
> +++ b/tests/docker/dockerfiles/debian-legacy-test-cross.docker
> @@ -24,6 +24,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
>  RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>          apt install -y --no-install-recommends \
>          bison \
> +        cargo-web \
>          ccache \
>          clang  \
>          flex \
> @@ -36,14 +37,20 @@ RUN DEBIAN_FRONTEND=noninteractive eatmydata \
>          python3-pip \
>          python3-setuptools \
>          python3-venv \
> -        python3-wheel && \
> +        python3-wheel \
> +        rustc-web \
> +        && \
>          dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt
>  
> +ENV CARGO_HOME=/usr/local/cargo
> +RUN cargo install bindgen-cli
> +
>  RUN /usr/bin/pip3 install tomli
>  
>  ENV QEMU_CONFIGURE_OPTS --disable-system --disable-docs --disable-tools
>  ENV DEF_TARGET_LIST alpha-linux-user,sh4-linux-user
>  ENV MAKE /usr/bin/make
> +ENV PATH=$CARGO_HOME/bin:$PATH
>  # As a final step configure the user (if env is defined)
>  ARG USER
>  ARG UID

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro