From 29f0be020dce3aea1e3927c65f5c6b2fa5dfd5a3 Mon Sep 17 00:00:00 2001 From: Guilherme Janczak Date: Fri, 27 Dec 2024 04:38:50 +0000 Subject: [PATCH] modernize msys2 environments The msys2 action can install packages via pacboy now. The hack to use clang32 stopped working. GCC is smaller and has less dependencies than Clang on msys2's environments, replace Clang with GCC it to speed up the CI. Unify MSYS environment and other msys2 environments into the same job. Disable LTO on msys2 because it's broken. Don't let the fallback integration fallback on libobsd. --- .github/workflows/build-and-test.yml | 46 +++++----------------------- .github/workflows/integration.yml | 35 +++++++++------------ 2 files changed, 22 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 49a4f06..81f622b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -173,27 +173,21 @@ jobs: shell: msys2 {0} strategy: matrix: - sys: [mingw64, mingw32, ucrt64, clang64, clang32] + # clang32 was broken last time I tried + sys: [msys, mingw64, mingw32, ucrt64, clang64] steps: - uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} - update: true path-type: strict - install: pactoys - - name: setup - run: | - # Lines stolen from: - # https://github.com/msys2/MINGW-packages/blob/56dd3261b3e67c901e45f9314b671ea19104bc0e/.github/workflows/main.yml#L56-L63 - grep -qF '[clang32]' /etc/pacman.conf || sed -i \ - '1s|^|[clang32]\nInclude = /etc/pacman.d/mirrorlist.mingw\n|' \ - /etc/pacman.conf - pacman --noconfirm -Suuy - pacboy --noconfirm -S --needed clang:p meson:p ninja:p + pacboy: gcc:p meson:p ninja:p - uses: actions/checkout@v3.3.0 - name: build run: | - meson setup -Dtest_system=true build + # LTO breaks msys (other environments seem to work): + # https://github.com/msys2/MINGW-packages/issues/11706 + # contributor says "not really production ready on windows" + meson setup -Db_lto=false -Dtest_system=true build meson compile -C build - name: test run: meson test --no-suite system -C build @@ -205,32 +199,6 @@ jobs: name: meson-logs-${{matrix.sys}} path: build/meson-logs - MSYS: - runs-on: windows-latest - defaults: - run: - shell: msys2 {0} - steps: - - uses: msys2/setup-msys2@v2 - with: - msystem: MSYS - path-type: strict - install: git gcc clang meson ninja - - uses: actions/checkout@v3.3.0 - - name: build - run: | - meson setup -Dtest_system=true build - meson compile -C build - - name: test - run: meson test --no-suite system -C build - - name: test_system - run: meson test --suite system -C build || true - - uses: actions/upload-artifact@v3.1.2 - if: always() - with: - name: meson-logs-msys2 - path: build/meson-logs - netbsd: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 689a0b4..1dff06a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2023 Guilherme Janczak +# Copyright (c) 2022-2024 Guilherme Janczak # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -18,47 +18,42 @@ on: [push, pull_request] jobs: msys2: runs-on: windows-latest + env: + # Meson's default destdir on MSYS isn't in pkgconf's default search path. + PKG_CONFIG_PATH: /usr/local/lib/pkgconfig defaults: run: shell: msys2 {0} strategy: matrix: - sys: [mingw64, mingw32, ucrt64, clang64, clang32] + sys: [msys, mingw64, mingw32, ucrt64, clang64] steps: - uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} - update: true path-type: strict - install: groff pactoys dos2unix - - name: setup - run: | - # Lines stolen from: - # https://github.com/msys2/MINGW-packages/blob/56dd3261b3e67c901e45f9314b671ea19104bc0e/.github/workflows/main.yml#L56-L63 - grep -qF '[clang32]' /etc/pacman.conf || sed -i \ - '1s|^|[clang32]\nInclude = /etc/pacman.d/mirrorlist.mingw\n|' \ - /etc/pacman.conf - pacman --noconfirm -Suuy - pacboy --noconfirm -S --needed clang:p meson:p ninja:p pkg-config:p - - uses: actions/checkout@v3.3.0 - - uses: actions/checkout@v3.3.0 + install: groff dos2unix + pacboy: gcc:p meson:p ninja:p pkg-config:p + - uses: actions/checkout@v3.3.0 # checkout libobsd + - uses: actions/checkout@v3.3.0 # checkout dictpw with: repository: guijan/dictpw path: dictpw - name: shared test run: | - meson setup -Dprovide_libbsd=true build + meson setup build -Db_lto=false -Dprovide_libbsd=true meson install -C build cd dictpw - meson setup build + meson setup build -Db_lto=false --wrap-mode=nofallback meson compile -C build - name: static test run: | - meson setup -Dprovide_libbsd=true -Ddefault_library=static --wipe \ - build + meson setup build -Db_lto=false -Dprovide_libbsd=true \ + -Ddefault_library=static --wipe meson install -C build cd dictpw - meson setup -Dstatic_deps=true build + meson setup build -Db_lto=false --wrap-mode=nofallback \ + -Dstatic_deps=true meson compile -C build - uses: actions/upload-artifact@v3.1.2 if: always()