All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: peter.maydell@linaro.org, alex.bennee@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] tests: docker: support mxe-based mingw builds
Date: Wed, 19 Aug 2020 09:20:13 +0100	[thread overview]
Message-ID: <20200819082013.GB69261@redhat.com> (raw)
In-Reply-To: <20200819080206.27423-1-pbonzini@redhat.com>

On Wed, Aug 19, 2020 at 04:02:06AM -0400, Paolo Bonzini wrote:
> This can be run with docker-test-mingw@ubuntu1804-mxe, and is the setup
> that Peter uses to test cross-compilation.

We already have docker containers with MXE based on Debian:

  debian-win32-cross.docker
  debian-win64-cross.docker

your image uses a different naming convention, and puts both
32 and 64 bit in the same image.

I feel like we should have the Ubuntu variant follow the same
structure and naming as the Debian variant for consistency.

> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/docker/common.rc                        | 18 ++++++-
>  .../docker/dockerfiles/ubuntu1804-mxe.docker  | 54 +++++++++++++++++++
>  tests/docker/test-mingw                       | 11 +++-
>  3 files changed, 80 insertions(+), 3 deletions(-)
>  create mode 100644 tests/docker/dockerfiles/ubuntu1804-mxe.docker
> 
> diff --git a/tests/docker/common.rc b/tests/docker/common.rc
> index ebc5b97ecf..402f6603b6 100755
> --- a/tests/docker/common.rc
> +++ b/tests/docker/common.rc
> @@ -15,10 +15,26 @@
>  # overriden by TARGET_LIST if the user sets it.
>  DEF_TARGET_LIST=${DEF_TARGET_LIST:-"x86_64-softmmu,aarch64-softmmu"}
>  
> +has()
> +{
> +    echo "$FEATURES" | grep -wq -e "$1"
> +}
> +
> +requires_any()
> +{
> +    for c in $@; do
> +        if has "$c"; then
> +            return
> +        fi
> +    done
> +    echo "None of prerequisites '$*' is present, skip"
> +    exit 0
> +}
> +
>  requires()
>  {
>      for c in $@; do
> -        if ! echo "$FEATURES" | grep -wq -e "$c"; then
> +        if ! has "$c"; then
>              echo "Prerequisite '$c' not present, skip"
>              exit 0
>          fi
> diff --git a/tests/docker/dockerfiles/ubuntu1804-mxe.docker b/tests/docker/dockerfiles/ubuntu1804-mxe.docker
> new file mode 100644
> index 0000000000..91895db80d
> --- /dev/null
> +++ b/tests/docker/dockerfiles/ubuntu1804-mxe.docker
> @@ -0,0 +1,54 @@
> +FROM ubuntu:18.04
> +ENV PACKAGES \
> +    ccache \
> +    gcc \
> +    gettext \
> +    git \
> +    gnupg \
> +    gnupg2 \
> +    make \
> +    nsis \
> +    python3-yaml \
> +    python3-sphinx \
> +    python3-setuptools \
> +    texinfo
> +RUN apt-get update && \
> +    DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES
> +
> +ENV MXE_PACKAGES \
> +    mxe-i686-w64-mingw32.shared-bzip2 \
> +    mxe-i686-w64-mingw32.shared-curl \
> +    mxe-i686-w64-mingw32.shared-glib \
> +    mxe-i686-w64-mingw32.shared-gcc \
> +    mxe-i686-w64-mingw32.shared-glib \
> +    mxe-i686-w64-mingw32.shared-gmp \
> +    mxe-i686-w64-mingw32.shared-gnutls \
> +    mxe-i686-w64-mingw32.shared-gtk3 \
> +    mxe-i686-w64-mingw32.shared-libjpeg-turbo \
> +    mxe-i686-w64-mingw32.shared-libpng \
> +    mxe-i686-w64-mingw32.shared-nettle \
> +    mxe-i686-w64-mingw32.shared-nsis \
> +    mxe-i686-w64-mingw32.shared-pixman \
> +    mxe-i686-w64-mingw32.shared-pkgconf \
> +    mxe-i686-w64-mingw32.shared-sdl2 \
> +    mxe-x86-64-w64-mingw32.shared-bzip2 \
> +    mxe-x86-64-w64-mingw32.shared-curl \
> +    mxe-x86-64-w64-mingw32.shared-gcc \
> +    mxe-x86-64-w64-mingw32.shared-glib \
> +    mxe-x86-64-w64-mingw32.shared-gmp \
> +    mxe-x86-64-w64-mingw32.shared-gnutls \
> +    mxe-x86-64-w64-mingw32.shared-gtk3 \
> +    mxe-x86-64-w64-mingw32.shared-libjpeg-turbo \
> +    mxe-x86-64-w64-mingw32.shared-libpng \
> +    mxe-x86-64-w64-mingw32.shared-nettle \
> +    mxe-x86-64-w64-mingw32.shared-nsis \
> +    mxe-x86-64-w64-mingw32.shared-pixman \
> +    mxe-x86-64-w64-mingw32.shared-pkgconf \
> +    mxe-x86-64-w64-mingw32.shared-sdl2
> +
> +RUN echo "deb http://pkg.mxe.cc/repos/apt bionic main" > \
> +   /etc/apt/sources.list.d/mxeapt.list && \
> +   apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C6BF758A33A3A276 && \
> +   apt-get update && \
> +   DEBIAN_FRONTEND=noninteractive apt-get install -y $MXE_PACKAGES
> +ENV FEATURES mxe
> diff --git a/tests/docker/test-mingw b/tests/docker/test-mingw
> index c30eb654eb..9e2fadb11a 100755
> --- a/tests/docker/test-mingw
> +++ b/tests/docker/test-mingw
> @@ -13,11 +13,18 @@
>  
>  . common.rc
>  
> -requires mingw dtc
> +requires dtc
> +requires_any mingw mxe
>  
>  cd "$BUILD_DIR"
>  
> -for prefix in x86_64-w64-mingw32- i686-w64-mingw32-; do
> +if has mingw; then
> +  prefixes='x86_64-w64-mingw32- i686-w64-mingw32-'
> +else
> +  prefixes='x86_64-w64-mingw32.shared- i686-w64-mingw32.shared-'
> +  export PATH=/usr/lib/mxe/usr/bin:$PATH
> +fi
> +for prefix in $prefixes; do
>      TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \
>          build_qemu --cross-prefix=$prefix \
>          --enable-trace-backends=simple \
> -- 
> 2.26.2
> 
> 

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 :|



  parent reply	other threads:[~2020-08-19  8:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-19  8:02 [PATCH] tests: docker: support mxe-based mingw builds Paolo Bonzini
2020-08-19  8:13 ` Marc-André Lureau
2020-08-19  8:20 ` Daniel P. Berrangé [this message]
2020-08-19 10:42   ` Paolo Bonzini
2020-08-19 11:09     ` Daniel P. Berrangé
2020-08-19 11:41       ` Paolo Bonzini
2020-08-19  8:59 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200819082013.GB69261@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.