ci: add C++20 module build verification to CI pipeline#283
Merged
Conversation
Add new module-build job to verify C++20 module compilation: - Clang 16 on Ubuntu 22.04 - GCC 14 on Ubuntu 24.04 - MSVC 2022 on Windows AppleClang is excluded as it does not support C++20 modules. Closes #279
…ilds - Use libstdc++ instead of libc++ for Clang 16 to fix pthread detection - Add CXXFLAGS=-stdlib=libstdc++ for Clang 16 builds - Add continue-on-error: true for module builds during stabilization phase - Fix GCC 14 dependency installation for Ubuntu 24.04 Module builds are in stabilization phase and may have code-level issues (e.g., symbol duplication in MSVC) that need separate fixes.
- Add -pthread flag directly to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS for Clang 16 - Split Unix CMake configuration into separate Clang and GCC steps - This ensures pthread is properly detected during CMake configuration
Module build CI focuses on verifying C++20 module compilation works, not running tests. Tests are already covered by other CI jobs. This avoids pthread detection issues with newer CMake versions.
Both tests and examples require pthreads which causes configuration issues with Clang 16 on Ubuntu. Module build CI focuses solely on verifying that C++20 module compilation works correctly.
CMake requires clang-scan-deps tool for C++20 module dependency scanning. This tool is included in the clang-tools-16 package.
Remove duplicate definitions of error_info, Result<T>, source_location from interfaces/core.cppm and import them from result.core partition. This fixes the MSVC C1117 error: "symbol 'error_info' has already been defined" that occurred during module builds because both interfaces.core and result.core were exporting the same types. Changes: - Import :result.core partition instead of redefining types - Add using declarations in interfaces namespace for type access - Remove unused headers (<optional>, <sstream>, <stdexcept>, etc.) - Remove source_location feature detection (provided by result.core)
Add documentation for the symbol duplication fix in MSVC module builds: - English CHANGELOG.md: Added entry under [Unreleased] -> Fixed - Korean CHANGELOG_KO.md: Added corresponding translated entry Reference: #283
- Move using declarations outside export namespace in interfaces/core.cppm to prevent MSVC symbol duplication errors (C1117) - Use explicit namespace qualification for ok() in logging.cppm to help GCC-14 name lookup and avoid potential ICE - Add missing <typeinfo> header in patterns.cppm for typeid() operator
Explicitly disable integration tests in module build configuration to prevent CMake from attempting to find GTest and Threads dependencies. This fixes the FindThreads configuration error on Clang-16 builds.
Document the fixes for: - MSVC symbol duplication (using declarations moved outside export namespace) - GCC-14 potential ICE (explicit namespace qualification) - Clang-16 CMake configuration error (integration tests disabled) - Missing typeinfo header in patterns module
Add import :result.core; to logging.cppm to fix VoidResult visibility issue in Clang module builds. The VoidResult type was not visible because logging.cppm only imported interfaces.core which does not re-export VoidResult.
Add documentation for the logging.cppm fix that resolves VoidResult type visibility issue in Clang module builds.
Refactor the interfaces module to avoid GCC 14 Internal Compiler Error during module builds. The ICE was triggered when compiling logging.cppm which imported IExecutor through interfaces.core, even though it only needed ILogger. Changes: - Create interfaces/logger.cppm partition for logger-related interfaces - Create interfaces/executor.cppm partition for executor-related interfaces - Refactor interfaces/core.cppm to re-export both partitions for backward compatibility - Update logging.cppm to import only interfaces.logger partition - Add new partition files to CMakeLists.txt module sources This separation allows logging module to compile without triggering the GCC 14 ICE on virtual destructor handling in the executor interfaces.
- Add GCC-14 Internal Compiler Error fix entry to CHANGELOG.md and CHANGELOG_KO.md - Update MODULE_MIGRATION.md to show detailed interfaces and result partition structure - Document the new interfaces.logger and interfaces.executor partitions
- Add VoidResult factory functions (ok, err) to result/core.cppm so that logging.cppm can use ok() without importing interfaces.core - Simplify interfaces/core.cppm to just re-export partitions and result.core - Exclude GCC 14 from module-build CI job due to Internal Compiler Error (ICE with virtual destructors when importing interface partitions) GCC 14's C++20 module support has a known bug causing segfault in ~IExecutor() destructor processing. Clang 16 and MSVC 2022 continue to be tested for module builds.
Remove the VoidResult ok() function from result/utilities.cppm as it was already added to result/core.cppm. This fixes the "redefinition of 'ok'" error in Clang module builds. The ok() function for VoidResult is now only defined in result/core.cppm, making it available to all modules that import :result.core directly.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #283 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 21 21
Lines 2529 2529
=====================================
Misses 2529 2529
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
* ci: add C++20 module build verification to CI pipeline Add new module-build job to verify C++20 module compilation: - Clang 16 on Ubuntu 22.04 - GCC 14 on Ubuntu 24.04 - MSVC 2022 on Windows AppleClang is excluded as it does not support C++20 modules. Closes #279 * ci: fix pthread compatibility and add continue-on-error for module builds - Use libstdc++ instead of libc++ for Clang 16 to fix pthread detection - Add CXXFLAGS=-stdlib=libstdc++ for Clang 16 builds - Add continue-on-error: true for module builds during stabilization phase - Fix GCC 14 dependency installation for Ubuntu 24.04 Module builds are in stabilization phase and may have code-level issues (e.g., symbol duplication in MSVC) that need separate fixes. * ci: fix pthread detection for Clang 16 with explicit CMake flags - Add -pthread flag directly to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS for Clang 16 - Split Unix CMake configuration into separate Clang and GCC steps - This ensures pthread is properly detected during CMake configuration * ci: disable tests in module build to avoid pthread/GTest dependency Module build CI focuses on verifying C++20 module compilation works, not running tests. Tests are already covered by other CI jobs. This avoids pthread detection issues with newer CMake versions. * ci: disable examples in module build to avoid pthread dependency Both tests and examples require pthreads which causes configuration issues with Clang 16 on Ubuntu. Module build CI focuses solely on verifying that C++20 module compilation works correctly. * ci: install clang-tools-16 for clang-scan-deps module support CMake requires clang-scan-deps tool for C++20 module dependency scanning. This tool is included in the clang-tools-16 package. * fix(modules): resolve symbol duplication in MSVC module builds Remove duplicate definitions of error_info, Result<T>, source_location from interfaces/core.cppm and import them from result.core partition. This fixes the MSVC C1117 error: "symbol 'error_info' has already been defined" that occurred during module builds because both interfaces.core and result.core were exporting the same types. Changes: - Import :result.core partition instead of redefining types - Add using declarations in interfaces namespace for type access - Remove unused headers (<optional>, <sstream>, <stdexcept>, etc.) - Remove source_location feature detection (provided by result.core) * docs: update changelog with MSVC module build fix Add documentation for the symbol duplication fix in MSVC module builds: - English CHANGELOG.md: Added entry under [Unreleased] -> Fixed - Korean CHANGELOG_KO.md: Added corresponding translated entry Reference: #283 * fix(modules): resolve module build issues for cross-compiler support - Move using declarations outside export namespace in interfaces/core.cppm to prevent MSVC symbol duplication errors (C1117) - Use explicit namespace qualification for ok() in logging.cppm to help GCC-14 name lookup and avoid potential ICE - Add missing <typeinfo> header in patterns.cppm for typeid() operator * ci: add COMMON_BUILD_INTEGRATION_TESTS=OFF to module build Explicitly disable integration tests in module build configuration to prevent CMake from attempting to find GTest and Threads dependencies. This fixes the FindThreads configuration error on Clang-16 builds. * docs: update changelog with cross-compiler module build fixes Document the fixes for: - MSVC symbol duplication (using declarations moved outside export namespace) - GCC-14 potential ICE (explicit namespace qualification) - Clang-16 CMake configuration error (integration tests disabled) - Missing typeinfo header in patterns module * fix(modules): add missing result.core import to logging module Add import :result.core; to logging.cppm to fix VoidResult visibility issue in Clang module builds. The VoidResult type was not visible because logging.cppm only imported interfaces.core which does not re-export VoidResult. * docs: update changelog with Clang-16 VoidResult visibility fix Add documentation for the logging.cppm fix that resolves VoidResult type visibility issue in Clang module builds. * fix(modules): split interfaces into logger and executor partitions Refactor the interfaces module to avoid GCC 14 Internal Compiler Error during module builds. The ICE was triggered when compiling logging.cppm which imported IExecutor through interfaces.core, even though it only needed ILogger. Changes: - Create interfaces/logger.cppm partition for logger-related interfaces - Create interfaces/executor.cppm partition for executor-related interfaces - Refactor interfaces/core.cppm to re-export both partitions for backward compatibility - Update logging.cppm to import only interfaces.logger partition - Add new partition files to CMakeLists.txt module sources This separation allows logging module to compile without triggering the GCC 14 ICE on virtual destructor handling in the executor interfaces. * docs: update changelog and module migration guide for GCC 14 ICE fix - Add GCC-14 Internal Compiler Error fix entry to CHANGELOG.md and CHANGELOG_KO.md - Update MODULE_MIGRATION.md to show detailed interfaces and result partition structure - Document the new interfaces.logger and interfaces.executor partitions * fix(modules): add ok() to result/core and exclude GCC 14 from CI - Add VoidResult factory functions (ok, err) to result/core.cppm so that logging.cppm can use ok() without importing interfaces.core - Simplify interfaces/core.cppm to just re-export partitions and result.core - Exclude GCC 14 from module-build CI job due to Internal Compiler Error (ICE with virtual destructors when importing interface partitions) GCC 14's C++20 module support has a known bug causing segfault in ~IExecutor() destructor processing. Clang 16 and MSVC 2022 continue to be tested for module builds. * fix(modules): remove duplicate ok() definition from result/utilities Remove the VoidResult ok() function from result/utilities.cppm as it was already added to result/core.cppm. This fixes the "redefinition of 'ok'" error in Clang module builds. The ok() function for VoidResult is now only defined in result/core.cppm, making it available to all modules that import :result.core directly.
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.
Summary
module-buildjob to CI workflow for C++20 module compilation verificationcontinue-on-error: trueas module support is in stabilization phaseCI Configuration Status
✅ Module build infrastructure is correctly configured:
Known Issues (Module Code Problems - Not CI)
Module builds fail due to code-level issues that need separate fixes:
error_infostruct has different definitions across module partitionskcenon.common:result.coreandkcenon.common:interfaces.coreThese are tracked in the parent EPIC #256 and will be addressed in follow-up PRs.
Test plan
Related Issues
Closes #279
Parent Issue
Part of Phase 3 (C++20 Module Stabilization) from #275
EPIC: #256