Description
By default, LLVM looks for the ucrt headers by picking the most recent version folder on disk, rather than use environment variables, the way MSVC does it.
This is problematic for the Windows Swift toolchain because Swift relies on a ucrt.modulemap
file, part of the toolchain installation, to properly parse the ucrt headers. However, ucrt.modulemap
is only compatible with a subset of UCRT headers. While it is updated whenever a new Windows SDK is released, there is a period of time where the Swift toolchain does not work with the most recent Windows SDK. The bootstrapping toolchain used to build the Swift compiler is typically one version behind the one being built, resulting in a ucrt.modulemap
that might not match the most recent available SDK.
As a result, the only reliable way of preventing LLVM from picking up an incompatible version of the Windows SDK is to delete the folders for unsupported SDK versions that are too recent.
This issue tracks removing this workaround when a more permanent solution to this problem has been found.