Skip to content

ci: add C++20 module build verification to CI pipeline#283

Merged
kcenon merged 17 commits into
mainfrom
feature/279-ci-module-builds
Jan 10, 2026
Merged

ci: add C++20 module build verification to CI pipeline#283
kcenon merged 17 commits into
mainfrom
feature/279-ci-module-builds

Conversation

@kcenon

@kcenon kcenon commented Jan 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add new module-build job to CI workflow for C++20 module compilation verification
  • Configure builds for supported compilers:
    • Clang 16 on Ubuntu 22.04 (with clang-tools-16 for clang-scan-deps)
    • GCC 14 on Ubuntu 24.04
    • MSVC 2022 on Windows
  • AppleClang is excluded as it does not support C++20 modules
  • Module build uses continue-on-error: true as module support is in stabilization phase

CI Configuration Status

✅ Module build infrastructure is correctly configured:

  • CMake 3.28+ installed via pip
  • Clang 16 with clang-tools-16 (provides clang-scan-deps for module scanning)
  • Ninja generator for parallel module builds
  • Module dependency scanning works correctly

Known Issues (Module Code Problems - Not CI)

Module builds fail due to code-level issues that need separate fixes:

  • MSVC/Clang/GCC: error_info struct has different definitions across module partitions
    • Defined differently in kcenon.common:result.core and kcenon.common:interfaces.core
    • This is an ODR (One Definition Rule) violation in the module code

These are tracked in the parent EPIC #256 and will be addressed in follow-up PRs.

Test plan

  • All standard CI tests pass (builds, sanitizers, static analysis)
  • Module build infrastructure configured correctly
  • clang-scan-deps works for module dependency scanning
  • Module compilation progresses (fails on code issues, not CI issues)
  • CI workflow correctly configured for supported compilers
  • macOS (AppleClang) correctly excluded from module builds

Related Issues

Closes #279

Parent Issue

Part of Phase 3 (C++20 Module Stabilization) from #275
EPIC: #256

kcenon added 17 commits January 11, 2026 00:26
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

codecov Bot commented Jan 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (01f4b4d) to head (f3012d4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main    #283   +/-   ##
=====================================
  Coverage   0.00%   0.00%           
=====================================
  Files         21      21           
  Lines       2529    2529           
=====================================
  Misses      2529    2529           
Flag Coverage Δ
integration-tests 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kcenon kcenon merged commit f10f6b6 into main Jan 10, 2026
26 checks passed
@kcenon kcenon deleted the feature/279-ci-module-builds branch January 10, 2026 17:33
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.
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.

[MODULE-P3] CI/CD update for module builds

1 participant