Skip to content

feat: robust MSVC STL discovery via msvc.cppm (fixes std.ixx not found)#54

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/msvc-stl-discovery
May 19, 2026
Merged

feat: robust MSVC STL discovery via msvc.cppm (fixes std.ixx not found)#54
Sunrisepeak merged 1 commit into
mainfrom
fix/msvc-stl-discovery

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Fixes error: source imports std but toolchain 'clang 20.1.7' provides no std module source on Windows machines where Visual Studio is not installed at the hardcoded CI path.

Root cause: clang.cppm hardcoded C:\Program Files\Microsoft Visual Studio\2022 to find std.ixx. This fails on machines with VS2019, VS installed in non-default paths, or Build Tools only.

Fix: New src/toolchain/msvc.cppm module with three discovery strategies:

  1. vswhere.exe — Microsoft's official VS locator (most reliable)
  2. Environment variablesVSINSTALLDIR, VS170COMNTOOLS, etc.
  3. Well-known paths — VS 2017-2025, all editions (Enterprise/Professional/Community/BuildTools/Preview)

clang.cppm now calls msvc::find_std_module_source() instead of hardcoded paths.

Test plan

  • CI: Windows self-host build (uses std.ixx)
  • CI: Windows E2E tests
  • User verification on non-CI Windows machine

New module mcpp.toolchain.msvc with three discovery strategies:
1. vswhere.exe (Microsoft's official VS locator) — most reliable
2. Environment variables (VSINSTALLDIR, VS*COMNTOOLS)
3. Well-known paths (VS 2017-2025, all editions + BuildTools)

Replaces the hardcoded VS2022 path in clang.cppm with
msvc::find_std_module_source(). Fixes "no std module source"
error on machines with non-standard VS installations.

Also provides find_cl() for future MSVC toolchain support.
@Sunrisepeak Sunrisepeak merged commit b362894 into main May 19, 2026
3 checks passed
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