From df58e89a8b4c8674c53d11ec4889ec75b5bf874f Mon Sep 17 00:00:00 2001 From: Justin Kim Date: Wed, 6 May 2026 11:34:00 +0900 Subject: [PATCH 1/2] tests: silence MSVC fopen deprecation in test_lexer MSVC's CRT marks fopen() as deprecated in favour of the Annex K *_s variants, which are not portable to glibc/musl. clang-cl inherits the same warning under MSVC argument syntax, so the Windows main-CI build fails under -Werror at tests/test_lexer.c:57. Define _CRT_SECURE_NO_WARNINGS only for this test target so the production library stays unaffected. --- tests/meson.build | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 5e0237b..2562675 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -16,15 +16,22 @@ test('skeleton', test_skeleton, suite : 'unit') # Normalise to forward slashes; fopen accepts both on every platform. fixture_dir = meson.current_source_dir().replace('\\', '/') + '/fixtures' +# MSVC's CRT marks fopen() as deprecated in favour of the Annex K *_s +# variants, which are not portable to glibc/musl. Silence the deprecation +# only for this test target so the production library stays unaffected. +# clang-cl uses MSVC argument syntax and inherits the same warning. +test_lexer_args = ['-DWG_FIXTURE_DIR="' + fixture_dir + '"'] +if meson.get_compiler('c').get_argument_syntax() == 'msvc' + test_lexer_args += '-D_CRT_SECURE_NO_WARNINGS' +endif + test_lexer = executable('test_lexer', files( 'test_lexer.c', '../wiig/lexer/lexer.c', ), include_directories : [wiig_inc, wiig_src_inc], - c_args : [ - '-DWG_FIXTURE_DIR="' + fixture_dir + '"', - ], + c_args : test_lexer_args, dependencies : [glib_dep], install : false, ) From cf41ee03f2b37401485e6dfd0f3128fd14dc4d7a Mon Sep 17 00:00:00 2001 From: Justin Kim Date: Wed, 6 May 2026 11:38:43 +0900 Subject: [PATCH 2/2] ci: persist Windows vcpkg cache even when build/test fails actions/cache@v5's combined action runs save as a post-step that is skipped when the job fails. The first runs of CI Main on this repo all failed at "Build and test (clang-cl)" so the post-save was never executed and the vcpkg binary + installed-tree caches were never persisted; every subsequent main run still missed and rebuilt glib from source. gh cache list shows zero caches as a result. Switch the Windows job to the split actions/cache/restore@v5 + actions/cache/save@v5 pattern (already in use on the PR workflow), with save running before configure so the cache is committed regardless of later step outcomes. Save steps are gated on cache-hit and marked continue-on-error so a save race does not red the run. --- .github/workflows/ci-main.yml | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 8c391c1..87b834c 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -122,16 +122,23 @@ jobs: git clone --depth 1 --branch 2026.04.27 https://github.com/microsoft/vcpkg.git "%VCPKG_ROOT%" call "%VCPKG_ROOT%\bootstrap-vcpkg.bat" -disableMetrics - - name: Cache vcpkg binary packages - uses: actions/cache@v5 + # actions/cache@v5's combined restore+save runs save as a post-step + # that is skipped when the job fails. Splitting into restore + save + # lets the cache be persisted even when later steps (build/test) + # fail, so a single broken commit doesn't strand the cache for every + # subsequent main-branch run. + - name: Restore vcpkg binary packages + id: vcpkg-cache + uses: actions/cache/restore@v5 with: path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} key: vcpkg-windows-v1-2026.04.27-x64-windows-glib restore-keys: | vcpkg-windows-v1-2026.04.27-x64-windows- - - name: Cache vcpkg installed tree - uses: actions/cache@v5 + - name: Restore vcpkg installed tree + id: vcpkg-installed-cache + uses: actions/cache/restore@v5 with: path: ${{ env.VCPKG_ROOT }}\installed key: vcpkg-windows-installed-v1-2026.04.27-x64-windows-glib @@ -156,6 +163,22 @@ jobs: @echo off "%VCPKG_ROOT%\vcpkg.exe" install glib:x64-windows --x-abi-tools-use-exact-versions + - name: Save vcpkg binary packages + if: steps.vcpkg-cache.outputs.cache-hit != 'true' + continue-on-error: true + uses: actions/cache/save@v5 + with: + path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }} + key: ${{ steps.vcpkg-cache.outputs.cache-primary-key }} + + - name: Save vcpkg installed tree + if: steps.vcpkg-installed-cache.outputs.cache-hit != 'true' + continue-on-error: true + uses: actions/cache/save@v5 + with: + path: ${{ env.VCPKG_ROOT }}\installed + key: ${{ steps.vcpkg-installed-cache.outputs.cache-primary-key }} + - name: Configure (clang-cl) shell: cmd run: |