feat: robust MSVC STL discovery via msvc.cppm (fixes std.ixx not found)#54
Merged
Conversation
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.
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
Fixes
error: source imports std but toolchain 'clang 20.1.7' provides no std module sourceon Windows machines where Visual Studio is not installed at the hardcoded CI path.Root cause:
clang.cppmhardcodedC:\Program Files\Microsoft Visual Studio\2022to findstd.ixx. This fails on machines with VS2019, VS installed in non-default paths, or Build Tools only.Fix: New
src/toolchain/msvc.cppmmodule with three discovery strategies:VSINSTALLDIR,VS170COMNTOOLS, etc.clang.cppmnow callsmsvc::find_std_module_source()instead of hardcoded paths.Test plan