]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
wip windows
authorTobias Brunner <tobias@strongswan.org>
Mon, 30 Nov 2020 09:00:04 +0000 (10:00 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 20 Aug 2021 09:55:19 +0000 (11:55 +0200)
wip: ccache ... just hangs (ccache -z does too if e.g. CCACHE_DIR is set
before it is called)

.appveyor.yml
.github/workflows/windows.yml
scripts/test.sh

index 3c826f3ccf541b0c57971262899e3648d268ada4..a4cca4fb2ceb5b823a7b3036feece2d6e6efeb23 100644 (file)
@@ -10,6 +10,7 @@ environment:
     TESTS_REDUCED_KEYLENGTHS: yes
     LEAK_DETECTIVE: no
     MONOLITHIC: yes
+    OS_NAME: windows
     TZ: Europe/Zurich
   matrix:
     - arch: x86_64
index 3e0c29ab36f87f8316fee186ca4bef37d409ee8f..50109750947d29a41831e8fe65278701043276bf 100644 (file)
@@ -4,7 +4,6 @@ on: [push, pull_request]
 
 env:
   TESTS_REDUCED_KEYLENGTHS: yes
-  CCACHE_BASEDIR: ${{ github.workspace }}
   CCACHE_COMPRESS: true
   CCACHE_MAXSIZE: 200M
   # since the compilers are newly installed every time, we have to use this to
@@ -31,6 +30,7 @@ jobs:
       matrix:
         test: [ win64, win32 ]
     env:
+      CCACHE_BASEDIR: ${{ github.workspace }}
       OS_NAME: linux
       TEST: ${{ matrix.test }}
     steps:
@@ -53,3 +53,67 @@ jobs:
           name: Logs ${{ github.job }}
           path: config.log
           retention-days: 5
+
+  native:
+    needs: pre-check
+    if: ${{ needs.pre-check.outputs.should_skip != 'true' }}
+    runs-on: windows-latest
+    strategy:
+      matrix:
+        include:
+          - msystem: MINGW64
+            test: win64
+          - msystem: MINGW32
+            test: win32
+    env:
+      OS_NAME: windows
+      TEST: ${{ matrix.test }}
+    steps:
+      - uses: msys2/setup-msys2@v2
+        with:
+          msystem: ${{ matrix.msystem }}
+      - run: git config --global core.autocrlf input
+        shell: bash
+      - uses: actions/checkout@v2
+      - uses: actions/cache@v2
+        with:
+          path: ~/.ccache
+          key: ccache-${{ runner.os }}-${{ matrix.test }}-${{ github.ref }}:${{ github.sha }}
+          restore-keys: |
+            ccache-${{ runner.os }}-${{ matrix.test }}-${{ github.ref }}:
+            ccache-${{ runner.os }}-${{ matrix.test }}-
+      - run: |
+          ./scripts/test.sh deps
+          pacman --noconfirm -S --needed ccache
+          ccache -z
+          ccache -s
+        shell: msys2 {0}
+      - run: |
+          # the ccache package does not add any symlinks and the scripts in the
+          # mingw-w64-...-ccache packages don't work, so do this via CC
+          case "$TEST" in
+          win64)
+            export CC="ccache x86_64-w64-mingw32-gcc"
+            ;;
+          win32)
+            export CC="ccache i686-w64-mingw32-gcc"
+            ;;
+          esac
+          ./scripts/test.sh
+        shell: msys2 {0}
+        # sometimes streaming/threading tests hang completely
+        timeout-minutes: 30
+      - run: ccache -s
+        shell: msys2 {0}
+      - if: ${{ failure() }}
+        uses: actions/upload-artifact@v2
+        with:
+          name: Logs ${{ github.job }}
+          path: config.log
+          retention-days: 5
+      - if: ${{ always() }}
+        uses: actions/upload-artifact@v2
+        with:
+          name: ccache ${{ matrix.test }}
+          path: ccache.log
+          retention-days: 1
index 1c0efd6d7c1ced4700401dca6abd98732a8ac0f3..4a14232a890091c11271f522363c06d7d9fac0c1 100755 (executable)
@@ -205,26 +205,36 @@ win*)
                        --enable-pki --enable-swanctl --enable-socket-win
                        --enable-kernel-iph --enable-kernel-wfp --enable-winhttp"
        # no make check for Windows binaries unless we run on a windows host
-       if test "$APPVEYOR" != "True"; then
+       if test "$OS_NAME" != "windows"; then
                TARGET=
+               DEPS="gcc-mingw-w64-base"
+               case "$TEST" in
+               win64)
+                       DEPS="gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev $DEPS"
+                       ;;
+               win32)
+                       DEPS="gcc-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-i686-dev $DEPS"
+                       ;;
+               esac
        else
                CONFIG="$CONFIG --enable-openssl"
-               CFLAGS="$CFLAGS -I$OPENSSL_DIR/include"
-               LDFLAGS="-L$OPENSSL_DIR"
-               export LDFLAGS
+               DEPS="base-devel git"
+               case "$TEST" in
+               win64)
+                       DEPS="$DEPS mingw-w64-x86_64-toolchain"
+                       ;;
+               win32)
+                       DEPS="$DEPS mingw-w64-i686-toolchain"
+                       ;;
+               esac
        fi
        CFLAGS="$CFLAGS -mno-ms-bitfields"
-       DEPS="gcc-mingw-w64-base"
        case "$TEST" in
        win64)
                CONFIG="--host=x86_64-w64-mingw32 $CONFIG --enable-dbghelp-backtraces"
-               DEPS="gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev $DEPS"
-               CC="x86_64-w64-mingw32-gcc"
                ;;
        win32)
                CONFIG="--host=i686-w64-mingw32 $CONFIG"
-               DEPS="gcc-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-i686-dev $DEPS"
-               CC="i686-w64-mingw32-gcc"
                ;;
        esac
        ;;
@@ -408,6 +418,9 @@ deps)
                pkg install -y automake autoconf libtool pkgconf && \
                pkg install -y bison flex gperf gettext $DEPS
                ;;
+       windows)
+               pacman --noconfirm -S --needed $DEPS
+               ;;
        esac
        exit $?
        ;;