fix: build std.compat with Clang and MSVC STL - #769
Merged
Sunrisepeak merged 2 commits intoOct 5, 2026
Merged
Conversation
Sunrisepeak
approved these changes
Oct 5, 2026
Sunrisepeak
left a comment
Member
There was a problem hiding this comment.
LGTM. Binds std.compat.ixx from the same MSVC toolset as std.ixx (also covers the default msvc@system row), and applies -x c++-module only to the source precompile, never to the BMI codegen; the unit test pins both. CI is green.
Follow-ups tracked separately (non-blocking):
ensure_builtbuilds std.compat whenever a compat source exists, so every clang + MSVC STLimport stdbuild now also compilesstd.compat.ixx; consider building it only when a unit imports it.- A Windows e2e for llvm + MSVC STL
import std.compat(the canary from #768) so SPEC-009 §6.2's acceptance is enforced in CI.
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.
Clang builds using MSVC STL fail on
import std.compatbecause sysroot binding leaves its source unset and the compat precompile command does not recognize MSVC's.ixxextension.Bind
std.compat.ixxalongsidestd.ixxfrom the selected MSVC toolset, clearing the compat source when unavailable. Apply-x c++-moduleonly to.ixxsource precompilation; BMI code generation and libc++.cppminput retain their existing behavior. Both commands continue to use the requested language standard and CRT flags.Closes #768
Validation
unit/test_toolchain_stdmodtests passed with the freshly built binary.import std.compatexecutable built and ran with LLVM 22.1.8 and MSVC STL 14.44.35207 / 14.51.36231, exercising::malloc,::free,::printf, andstd::vector..ixxreceives the module language override only during source parsing,.cppmreceives no override, and std BMI / CRT flags reach both commands.git diff --checkpassed. Full platform coverage is left to CI.