Installation fails under Windows 10

Hi,

I've installed Swift on Windows 10 following the official instructions. After installation Swift fails to find some needed includes from the Windows SDK. E.g. downloading swift-argument-parser and calling swift package resolve in cmd fails (exact error output below). It works if I add the Windows 11 SDK to the Visual Studio installation.

I'm running Windows 10 22H2, Visual Studio Community 2022 - 17.7.0.

Am I missing something obvious or is it worth reporting that as a bug?

error: 'swift-argument-parser': Invalid manifest (compiled with: ["C:\\Library\\Developer\\Toolchains\\unknown-Asserts-development.xctoolchain\\usr\\bin\\swiftc.exe", "-L", "C:\\Library\\Developer\\Toolchains\\unknown-Asserts-development.xctoolchain\\usr\\lib\\swift\\pm\\ManifestAPI", "-lPackageDescription", "-sdk", "C:\\Library\\Developer\\Platforms\\Windows.platform\\Developer\\SDKs\\Windows.sdk", "-libc", "MD", "-I", "C:\\Library\\Developer\\Platforms\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows", "-I", "C:\\Library\\Developer\\Platforms\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64", "-L", "C:\\Library\\Developer\\Platforms\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64", "-use-ld=lld", "-swift-version", "5", "-I", "C:\\Library\\Developer\\Toolchains\\unknown-Asserts-development.xctoolchain\\usr\\lib\\swift\\pm\\ManifestAPI", "-package-description-version", "5.6.0", "C:\\Users\\MyUsername\\AppData\\Local\\Temp\\TemporaryDirectory.jBwIK8\\manifest.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "C:\\Users\\MyUsername\\AppData\\Local\\Temp\\TemporaryDirectory.CuGqBR\\swift-argument-parser-manifest.exe"])
<module-includes>:1:10: note: in file included from <module-includes>:1:
#include "dispatch.h"
         ^
C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\include\dispatch/dispatch.h:66:10: note: in file included from C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\include\dispatch/dispatch.h:66:
#include <dispatch/time.h>
         ^
C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\include\dispatch/time.h:67:9: error: missing '#include <stdint.h>'; 'uint64_t' must be declared before it is used
typedef uint64_t dispatch_time_t;
        ^
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\stdint.h:25:28: note: declaration here is not visible
typedef unsigned long long uint64_t;
                           ^
<unknown>:0: error: could not build C module 'CDispatch'

Thanks for the error report @HBu

I've been using the latest SDKs, which would explain how this might've snuck through. It seems that the module definition is not compatible with the the Windows SDK (presumably some header changes). I don't have a solution off hand, but this seems like it may be addressed by the recent changes that were done in service of C++ Interop. Unfortunately, a new build with those changes is not out yet, but it may be worth testing that once it is out.

Ok, I will test again when the new build is out.