ci: unbreak and stabilise the Windows main job - #1
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two atomic commits, both targeting the Windows main-CI job.
1. tests: silence MSVC fopen deprecation in test_lexer
-Werrorbuild on clang-cl flaggedtests/test_lexer.c:57'sfopen()as-Wdeprecated-declarations(MSVC's CRT prefers Annex Kfopen_s). Annex K*_svariants are not portable to glibc/musl, so the call site is left as-is and_CRT_SECURE_NO_WARNINGSis defined for the test target only when the compiler uses MSVC argument syntax.2. ci: persist Windows vcpkg cache even when build/test fails
actions/cache@v5's combined action runs save as a post-step skipped when the job fails. Every previous Main run failed at the build step → no cache was ever saved (gh cache listshowed zero entries) → every subsequent run rebuilt glib from source. Switched to the splitcache/restore+cache/savepattern (already used on the PR workflow), with save before configure so the cache is committed regardless of later step outcomes.Test plan
meson setup -Ddefault_library=static -Dwerror=true && meson test --suite unitgreen (Linux, gcc).python3 -c "yaml.safe_load(...)"confirmsci-main.ymlis valid YAML.build-windows,build-macos-latest,build-ubuntu-latestall green.