DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Aaron Conole <aconole@redhat.com>,
	Michael Santana <maicolgabriel@hotmail.com>
Subject: [PATCH 2/2] ci: add mingw cross compilation in GHA
Date: Tue, 26 Apr 2022 09:18:28 +0200	[thread overview]
Message-ID: <20220426071828.1810-2-david.marchand@redhat.com> (raw)
In-Reply-To: <20220426071828.1810-1-david.marchand@redhat.com>

Add mingw cross compilation in our public CI so that users with their
own github repository have a first level of checks for Windows compilation
before submitting to the mailing list.
This does not replace our better checks in other entities of the CI.

Only the helloworld example is compiled (same as what is tested in
test-meson-builds.sh).

Note: the mingw cross compilation toolchain (version 5.0) in Ubuntu
18.04 was broken (missing a ENOMSG definition).

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 .ci/linux-build.sh          | 22 +++++++++++++++++-----
 .github/workflows/build.yml |  8 ++++++++
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh
index 30119b61ba..06dd20772d 100755
--- a/.ci/linux-build.sh
+++ b/.ci/linux-build.sh
@@ -37,16 +37,26 @@ catch_coredump() {
     return 1
 }
 
+cross_file=
+
 if [ "$AARCH64" = "true" ]; then
     if [ "${CC%%clang}" != "$CC" ]; then
-        OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_clang_ubuntu2004"
+        cross_file=config/arm/arm64_armv8_linux_clang_ubuntu2004
     else
-        OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
+        cross_file=config/arm/arm64_armv8_linux_gcc
     fi
 fi
 
+if [ "$MINGW" = "true" ]; then
+    cross_file=config/x86/cross-mingw
+fi
+
 if [ "$PPC64LE" = "true" ]; then
-    OPTS="$OPTS --cross-file config/ppc/ppc64le-power8-linux-gcc-ubuntu2004"
+    cross_file=config/ppc/ppc64le-power8-linux-gcc-ubuntu2004
+fi
+
+if [ -n "$cross_file" ]; then
+    OPTS="$OPTS --cross-file $cross_file"
 fi
 
 if [ "$BUILD_DOCS" = "true" ]; then
@@ -59,7 +69,9 @@ if [ "$BUILD_32BIT" = "true" ]; then
     export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
 fi
 
-if [ "$DEF_LIB" = "static" ]; then
+if [ "$MINGW" = "true" ]; then
+    OPTS="$OPTS -Dexamples=helloworld"
+elif [ "$DEF_LIB" = "static" ]; then
     OPTS="$OPTS -Dexamples=l2fwd,l3fwd"
 else
     OPTS="$OPTS -Dexamples=all"
@@ -76,7 +88,7 @@ fi
 meson build --werror $OPTS
 ninja -C build
 
-if [ "$AARCH64" != "true" ] && [ "$PPC64LE" != "true" ]; then
+if [ -z "$cross_file" ]; then
     failed=
     configure_coredump
     devtools/test-null.sh || failed="true"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 812aa7055d..e2f94d786b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -21,6 +21,7 @@ jobs:
       CC: ccache ${{ matrix.config.compiler }}
       DEF_LIB: ${{ matrix.config.library }}
       LIBABIGAIL_VERSION: libabigail-1.8
+      MINGW: ${{ matrix.config.cross == 'mingw' }}
       MINI: ${{ matrix.config.mini != '' }}
       PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
       REF_GIT_TAG: v22.03
@@ -52,6 +53,10 @@ jobs:
             compiler: gcc
             library: static
             cross: i386
+          - os: ubuntu-20.04
+            compiler: gcc
+            library: static
+            cross: mingw
           - os: ubuntu-20.04
             compiler: gcc
             library: static
@@ -119,6 +124,9 @@ jobs:
       if: env.AARCH64 == 'true'
       run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
         pkg-config-aarch64-linux-gnu
+    - name: Install mingw cross compiling packages
+      if: env.MINGW == 'true'
+      run: sudo apt install -y mingw-w64 mingw-w64-tools
     - name: Install ppc64le cross compiling packages
       if: env.PPC64LE == 'true'
       run: sudo apt install -y gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
-- 
2.23.0


  reply	other threads:[~2022-04-26  7:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-26  7:18 [PATCH 1/2] ci: switch to Ubuntu 20.04 David Marchand
2022-04-26  7:18 ` David Marchand [this message]
2022-04-26 15:07   ` [PATCH 2/2] ci: add mingw cross compilation in GHA Aaron Conole
2022-04-26  9:14 ` [PATCH 1/2] ci: switch to Ubuntu 20.04 Ruifeng Wang
2022-04-28 12:28   ` David Marchand
2022-04-26 15:06 ` Aaron Conole
2022-05-06 11:57 ` [PATCH v2 " David Marchand
2022-05-06 11:57   ` [PATCH v2 2/2] ci: add mingw cross compilation in GHA David Marchand
2022-05-07  3:36   ` [PATCH v2 1/2] ci: switch to Ubuntu 20.04 Ruifeng Wang
2022-05-09  7:42     ` David Marchand

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=20220426071828.1810-2-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=aconole@redhat.com \
    --cc=dev@dpdk.org \
    --cc=maicolgabriel@hotmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).