Skip to content

CI: fix CI-mingw failures - #707

Merged
danmar merged 1 commit into
masterfrom
fix-ci-mingw
Oct 26, 2026
Merged

danmar merged 1 commit into
masterfrom
fix-ci-mingw

Conversation

@danmar

@danmar danmar commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

CI-mingw is failing on master (e.g. https://github.com/cppcheck-opensource/simplecpp/actions/runs/40300479372) for two unrelated reasons:

CLANG64 (clang++): MSYS2 now ships clang 23.1.3, and -Weverything enables new lifetime-safety suggestion warnings (-Wlifetime-safety-intra-tu-suggestions, -Wlifetime-safety-intra-tu-constructor-suggestions, -Wlifetime-safety-cross-tu-constructor-suggestions), which fail the build with CMAKE_COMPILE_WARNING_AS_ERROR. These are disabled via add_compile_options_safe, so older compilers are unaffected. A TODO is left to consider adding [[clang::lifetimebound]] annotations instead.

MINGW32 (g++): mingw-w64-i686-python-pytest is no longer available, and setup-msys2 warns that MINGW32 is deprecated with no replacement. MINGW32 is removed from the matrix. Note: this leaves no 32-bit build in CI.

- disable new clang 23 lifetime-safety suggestion warnings
- remove MINGW32 since MSYS2 is phasing out 32-bit environments and
  mingw-w64-i686-python-pytest is no longer available

@dmcppcheck dmcppcheck left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review

I found no problems in this PR. It only changes CI and CMake.

  • CMake: the three -Wno-lifetime-safety-* flags are added through add_compile_options_safe. On a clang that doesn't know them, check_cxx_compiler_flag fails, so the flags are skipped and the build is unaffected. They are also added inside the Clang branch, so the MINGW64 + clang++ job gets them too.
  • Workflow: removing MINGW32 also removes its include and exclude entries, and no other part of the workflow still refers to MINGW32 or i686.

The description already says that CI will have no 32-bit build after this. I couldn't check with clang 23 because it isn't in the container.

Testing

  • make -j8 testrunner simplecpp CXXOPTS=-Werror in pr/: built with no errors. ./testrunner exit code 0. python3 run-tests.py: 0 failed, 21 skipped. python3 -m pytest integration_test.py: 128 passed. ./selfcheck.sh exit code 0.
  • CMake path with an older clang: CXX=clang++ cmake -S . -B build -DCMAKE_COMPILE_WARNING_AS_ERROR=On with clang 18.1.3 and cmake 3.28.3. All three HAS_CXX_FLAG_Wno_lifetime_safety_* checks report Failed, so the flags are not added. The simplecpp and testrunner targets build with warnings-as-errors and testrunner passes.
  • Not tested: clang 23, where the flags should be accepted and the warnings turned off, and the MSYS2 workflow itself. Neither is available offline.
  • I didn't write preprocessor test inputs because the PR doesn't change any preprocessing code.

Automated review of 5cc78a0 by Claude. The pull request was built and tested locally.

@danmar
danmar merged commit 2567ec4 into master Oct 26, 2026
49 checks passed
@danmar
danmar deleted the fix-ci-mingw branch October 26, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants