Skip to content

ci(tests): add msvc@system leg on Windows and pin MSVC via setup-msvc-dev - #16

Open
ZheFeng7110 wants to merge 21 commits into
mcpplibs:mainfrom
ZheFeng7110:ci/windows-msvc-system
Open

ZheFeng7110 wants to merge 21 commits into
mcpplibs:mainfrom
ZheFeng7110:ci/windows-msvc-system

Conversation

@ZheFeng7110

@ZheFeng7110 ZheFeng7110 commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add native Windows MSVC (windows-msvc, msvc@system, x86_64) to the Build and Tests workflow (test groups A/B, tests/dll & tests/test/utf sub-projects, and examples), pinned via TheMrMilchmann/setup-msvc-dev@v4 (MSVC 14.52 + Windows SDK 10.0.26100.0), along with the module/export/patch/test adaptations needed for all 120 Boost libraries and 417 test programs to build and pass cleanly under native cl.exe.

Changes

1. CI & Build Configuration

  • .github/workflows/tests.yml:
    • Pin MSVC environment on windows-latest using TheMrMilchmann/setup-msvc-dev@v4 (arch: x64, toolset: "14.52", sdk: "10.0.26100.0").
    • Add windows-msvc (msvc@system, x86_64) matrix entries to both test (groups A and B) and examples jobs; skip mcpp toolchain install when install is empty; include MSVC_TOOLSET and WINDOWS_SDK in the msvc@system sandbox cache key.
    • Skip examples/git-dep on msvc@system while examples/git-dep/mcpp.toml still pins the pre-MSVC release tag mwrap-1.92.0 (future release tags will exercise msvc@system automatically).
  • mcpp.toml:
    • Add [target.'cfg(compiler = "msvc")'.build] with cxxflags = ["/Zc:__cplusplus", "/bigobj"] and Windows *.lib ldflags (while keeping -l* in [target.windows.build] for windows-llvm-msvc).
  • build.mcpp:
    • Omit mcpplibs.mwrap.boost.sort from the root :closure partition on native MSVC (_MSC_VER && !__clang__) when range is enabled (avoiding C2757: 'boost::sort' function vs namespace conflict, matching GCC's existing handling).

2. Platform & Compiler Export Guards (tools/export_policy.toml, generated/exports/*.inc)

  • hana: Guard #include <boost/hana/experimental/type_name.hpp> in src/hana.cppm and its 4 exported symbols under defined(BOOST_HANA_CONFIG_CLANG) || defined(BOOST_HANA_CONFIG_GCC).
  • type_traits & variant: Guard MSVC-absent helpers (false_or_cpp11_noexcept_move_*, tt_align_ns::{a2,a4}, sized_type_for_promotion) and handle BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE (::mpl_::* vs boost::mpl::*).
  • concept_check: Guard general.hpp symbols under !defined(BOOST_MSVC) and export the msvc.hpp symbols in #else.
  • algorithm, units, uuid, convert: Guard is_blank (!defined(BOOST_NO_CXX11)), si::pascal (!defined(BOOST_UNITS_NO_PASCAL)), uuids::detail::*_u128 (defined(__SIZEOF_INT128__)), and parameter::aux::tag_if_* (defined(BOOST_PARAMETER_CAN_USE_MP11) && !BOOST_WORKAROUND(BOOST_MSVC, >= 1910)).
  • property_tree: Add multi_index to [property_tree.deps] and src/property_tree.cppm so ADL finds boost::multi_index::detail::operator==.
  • interprocess: Add boost::interprocess::winapi::{hkey_local_machine,invalid_handle_value,key_query_value} to the defined(_WIN32) guard.

3. Upstream Adaptations (patches/, tools/apply_patches.py)

  • type_erasure.patch: Disable BOOST_TYPE_ERASURE_SFINAE_FRIENDLY_CONSTRUCTORS under BOOST_MSVC to avoid an MSVC 14.52 IFC serializer ICE (C1001, msc1.cpp:1678) on the mutual CRTP cycle in any<Concept, T>, and guard its 13 helper symbols in tools/export_policy.toml.
  • math.patch: Introduce BOOST_MATH_DIFF_DETAIL_NS (diff_detail under BOOST_MSVC, detail elsewhere) to resolve C2872: 'detail': ambiguous symbol with autodiff_v1::detail, and promote lambert_w_lookup::* tables to BOOST_INLINE_CONSTEXPR.
  • asio.patch: Work around MSVC 14.52 IFC bugs by keeping executor require/query members public: and using upstream's typedef T type; fallback for proxy/static_proxy SFINAE wrappers under BOOST_ASIO_MSVC.
  • url.patch: Make url_view_base/url_base/static_url_base constructors/destructors/data protected:, move url_view_base::shared_impl out to detail::url_view_shared_impl to break circular IFC deserialization (C2504), delegate concept Rule and concept RangeRule to is_rule<T>::value / is_range_rule<T>::value under BOOST_MSVC, and promote url detail charsets/rules to BOOST_INLINE_CONSTEXPR.
  • Internal-linkage promotions for MSVC C++20 modules: Promote internal-linkage static inline helpers, namespace-scope constexpr/static const tables/tags, and dynamically initialized static handles to inline / BOOST_INLINE_CONSTEXPR across bloom.patch, charconv.patch, decimal.patch, histogram.patch, interprocess.patch (default_map_options, win32_api.hpp), json.patch, move.patch, mqtt5.patch, serialization.patch (get_singleton_module), sort.patch, system.patch (default_location), unordered.patch, winapi.patch, and BOOST_MSVC-guarded accumulators.patch (functional*.hpp).
  • serialization.patch (tests/dll): Gate BOOST_DLLEXPORT in force_include.hpp on BOOST_ALL_DYN_LINK || BOOST_SERIALIZATION_DYN_LINK for native cl.exe as well, so static-Boost objects do not suppress mcpp's auto-generated .def when building the shared boost.dll in tests/dll.
  • openmethod.patch: Pass std::decay_t<decltype(Fn)> to override_aux for MSVC 14.52 partial specialization matching.

4. Test & Documentation Updates

  • tests/statechart.cpp: Move #include <boost/mpl/list.hpp> before import mcpplibs.mwrap.boost.statechart; (C2572).
  • tests/describe/include_examples.cpp: Match MSVC's skipped pair<int, float>::second line in pm_to_string.
  • tests/test/included/example/test_case_template_example.cpp: Normalize MSVC's boost__mpl__integral_c spelling in ex_harness::normalize.
  • tests/beast/examples_websocket.cpp: Sequence ex_http_get before ex_ws_exchange in advanced_server instead of relying on + evaluation order.
  • patches/README.md & .agents/docs/2026-12-04-windows-msvc-ci-adaptations-design.md: Document all native MSVC adaptations and verification results.

Verification

  • All 23 / 23 CI checks passed on commit 817035cc across all 6 host configurations (windows-msvc, windows-llvm-msvc, linux-gcc x86_64/arm64, linux-llvm, macos-llvm), including Group A/B library builds, all 417 tests, tests/dll and tests/test/utf sub-projects, examples + template smoke tests, Verify Generation Scripts, Check Documents, and example coverage.

… RangeRule, interprocess win32_api, describe) and gcc duplicate constexpr
…indows -l* ldflags for clang++, and update patches/README
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.

1 participant