From 9c11b57002edab4fa3a79cd6f32beac09ecfb99e Mon Sep 17 00:00:00 2001 From: Jim Munn Date: Fri, 27 Mar 2026 15:29:14 -0600 Subject: [PATCH] build: use MSYS2 UCRT64 for Windows CI build Switch the Windows workflow job in build.yml to MSYS2 UCRT64 and run the build via build.sh instead of invoking Meson directly. Signed-off-by: Jim Munn --- .github/workflows/build.yml | 53 ++++++++++++++++++++----------------- libnvme/doc/meson.build | 6 +++-- meson.build | 5 +++- 3 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7dc8bcf57..f7ea673458 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -226,35 +226,38 @@ jobs: run: | scripts/build.sh distro - build-windows: - name: build windows + windows-msys2-ucrt64: runs-on: windows-latest - defaults: - run: - shell: msys2 {0} + timeout-minutes: 60 steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Setup MSYS2 - uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0 + - uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0 with: - msystem: MINGW64 + msystem: UCRT64 update: true - install: > + install: >- git - mingw-w64-x86_64-gcc - mingw-w64-x86_64-meson - mingw-w64-x86_64-ninja - mingw-w64-x86_64-pkg-config - mingw-w64-x86_64-json-c - - name: Configure (Meson) - run: | - meson setup .build-ci \ - --prefix=/mingw64 \ - -Dversion-tag=master \ - -Ddefault_library=static - - name: Build - run: | - meson compile -C .build-ci - - name: Run tests (optional) + mingw-w64-ucrt-x86_64-gcc + mingw-w64-ucrt-x86_64-pkgconf + mingw-w64-ucrt-x86_64-meson + mingw-w64-ucrt-x86_64-ninja + mingw-w64-ucrt-x86_64-ccache + mingw-w64-ucrt-x86_64-json-c + + - name: Build nvme-cli + shell: msys2 {0} run: | - meson test -C .build-ci || true + set -euxo pipefail + which bash + bash --version + which git + git --version + git config --global --add safe.directory "$GITHUB_WORKSPACE" + scripts/build.sh -b release -c gcc + + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + if: failure() + with: + name: windows-msys2-ucrt64-logs + path: | + .build-ci/meson-logs/*.txt \ No newline at end of file diff --git a/libnvme/doc/meson.build b/libnvme/doc/meson.build index 16c437d6dd..315c8fd269 100644 --- a/libnvme/doc/meson.build +++ b/libnvme/doc/meson.build @@ -49,9 +49,11 @@ subdir('rst') top_source_dir = meson.current_source_dir() + '/../' kernel_doc = find_program(top_source_dir + 'scripts/kernel-doc') -kernel_doc_check = find_program(top_source_dir +'scripts/kernel-doc-check') +kernel_doc_check = files(top_source_dir + 'scripts/kernel-doc-check') +# Find the path to bash and use it so we don't pick up the WSL bash in Windows. +bash_prog = find_program('bash', required: true) -test('libnvme - kdoc', kernel_doc_check, args: api_paths) +test('libnvme - kdoc', bash_prog, args: [kernel_doc_check] + api_paths) if want_docs != 'false' if want_docs == 'all' or want_docs == 'man' diff --git a/meson.build b/meson.build index cbae578d25..816eca21d8 100644 --- a/meson.build +++ b/meson.build @@ -123,8 +123,11 @@ version_tag = get_option('version-tag') if version_tag != '' conf.set('GIT_VERSION', '"@0@"'.format(version_tag)) else + # Find the path to bash and use it so we don't pick up the WSL bash in Windows. + bash_prog = find_program('bash', required: true) r = run_command( - 'scripts/meson-vcs-tag.sh', + bash_prog, + files('scripts/meson-vcs-tag.sh'), meson.current_source_dir(), meson.project_version(), check: true,