I'm trying to figure out the current guidelines for getting Swift working on Windows. My attempt is using the Swift 5.5.1 installer. I am on Windows 11, FWIW.
The basic symptom here is that I cd into an empty directory and do:
swift package init
swift build
and I get
error: manifest parse error(s):
<unknown>:0: error: missing required module 'ucrt'
Which seems to suggest that I don't have the necessary Visual Studio components installed, but I think I do.
I have Visual Studio 2019 Enterprise. I've got both of these installed:
--add Microsoft.VisualStudio.Component.Windows10SDK.19041
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Interestingly, when I try the swift build from a Visual Studio command prompt (x64 Native tools) I get the error above (missing required module 'ucrt'), but if I try it from a regular command prompt, I get:
error: manifest parse error(s):
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "AssertionReporting.h"
^
C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\shims\AssertionReporting.h:16:10: note: in file included from C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\shims\AssertionReporting.h:16:
#include "SwiftStdint.h"
^
C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\lib\swift\shims\SwiftStdint.h:28:10: error: 'stdint.h' file not found
#include <stdint.h>
^
<unknown>:0: error: could not build C module 'SwiftShims'
I wasn't sure if maybe swift requires VS 2019 Community (rather than Enterprise), so I tried that installing that as well, but no luck.
I've tried running the Swift installer by downloading it and running it manually. I've also tried the winget-oriented instructions on the download page.
The instructions on the download page seem to suggest that doing the "Support files" stuff to copy the modulemap files should no longer be necessary for Swift 5.5.1, but given the nature of the error messages, I am wondering about that.
Can anyone clarify what steps should be necessary to get swift tools going on Windows?
Thanks!