Skip to content

Commit cbfa872

Browse files
jimmunnigaw
authored andcommitted
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 <[email protected]>
1 parent 3404ebd commit cbfa872

3 files changed

Lines changed: 36 additions & 28 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -226,35 +226,38 @@ jobs:
226226
run: |
227227
scripts/build.sh distro
228228
229-
build-windows:
230-
name: build windows
229+
windows-msys2-ucrt64:
231230
runs-on: windows-latest
232-
defaults:
233-
run:
234-
shell: msys2 {0}
231+
timeout-minutes: 60
235232
steps:
236233
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
237-
- name: Setup MSYS2
238-
uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0
234+
- uses: msys2/setup-msys2@cafece8e6baf9247cf9b1bf95097b0b983cc558d # v2.31.0
239235
with:
240-
msystem: MINGW64
236+
msystem: UCRT64
241237
update: true
242-
install: >
238+
install: >-
243239
git
244-
mingw-w64-x86_64-gcc
245-
mingw-w64-x86_64-meson
246-
mingw-w64-x86_64-ninja
247-
mingw-w64-x86_64-pkg-config
248-
mingw-w64-x86_64-json-c
249-
- name: Configure (Meson)
250-
run: |
251-
meson setup .build-ci \
252-
--prefix=/mingw64 \
253-
-Dversion-tag=master \
254-
-Ddefault_library=static
255-
- name: Build
256-
run: |
257-
meson compile -C .build-ci
258-
- name: Run tests (optional)
240+
mingw-w64-ucrt-x86_64-gcc
241+
mingw-w64-ucrt-x86_64-pkgconf
242+
mingw-w64-ucrt-x86_64-meson
243+
mingw-w64-ucrt-x86_64-ninja
244+
mingw-w64-ucrt-x86_64-ccache
245+
mingw-w64-ucrt-x86_64-json-c
246+
247+
- name: Build nvme-cli
248+
shell: msys2 {0}
259249
run: |
260-
meson test -C .build-ci || true
250+
set -euxo pipefail
251+
which bash
252+
bash --version
253+
which git
254+
git --version
255+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
256+
scripts/build.sh -b release -c gcc
257+
258+
- uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
259+
if: failure()
260+
with:
261+
name: windows-msys2-ucrt64-logs
262+
path: |
263+
.build-ci/meson-logs/*.txt

libnvme/doc/meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ subdir('rst')
4949
top_source_dir = meson.current_source_dir() + '/../'
5050

5151
kernel_doc = find_program(top_source_dir + 'scripts/kernel-doc')
52-
kernel_doc_check = find_program(top_source_dir +'scripts/kernel-doc-check')
52+
kernel_doc_check = files(top_source_dir + 'scripts/kernel-doc-check')
53+
# Find the path to bash and use it so we don't pick up the WSL bash in Windows.
54+
bash_prog = find_program('bash', required: true)
5355

54-
test('libnvme - kdoc', kernel_doc_check, args: api_paths)
56+
test('libnvme - kdoc', bash_prog, args: [kernel_doc_check] + api_paths)
5557

5658
if want_docs != 'false'
5759
if want_docs == 'all' or want_docs == 'man'

meson.build

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,11 @@ version_tag = get_option('version-tag')
123123
if version_tag != ''
124124
conf.set('GIT_VERSION', '"@0@"'.format(version_tag))
125125
else
126+
# Find the path to bash and use it so we don't pick up the WSL bash in Windows.
127+
bash_prog = find_program('bash', required: true)
126128
r = run_command(
127-
'scripts/meson-vcs-tag.sh',
129+
bash_prog,
130+
files('scripts/meson-vcs-tag.sh'),
128131
meson.current_source_dir(),
129132
meson.project_version(),
130133
check: true,

0 commit comments

Comments
 (0)