Hi there.
I'm trying to install Swift on my Windows 10 machine.
I've installed Swift 6.0 from the package installer, as described here: Swift.org - Traditional Installation.
I've installed Visual Studio 2022 -- I installed the 2019 build tools using the Visual Studio Installer.
When trying to build a minimal executable SwiftPM package I get the following error:
D:\Code\hello>swift build
error: 'hello': Invalid manifest (compiled with: ["C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\swiftc.exe", "-vfsoverlay", "C:\\Users\\JOEBLOG~1\\AppData\\Local\\Temp\\TemporaryDirectory.WEPqVZ\\vfs.yaml", "-L", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-lPackageDescription", "-sdk", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\SDKs\\Windows.sdk\\", "-libc", "MD", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64", "-L", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows", "-L", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows\\x86_64", "-use-ld=lld", "-swift-version", "6", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-package-description-version", "6.0.0", "D:\\Code\\hello\\Package.swift", "-o", "C:\\Users\\JOEBLOG~1\\AppData\\Local\\Temp\\TemporaryDirectory.4P3XOM\\hello-manifest.exe"])
<unknown>:0: error: unable to load standard library for target 'x86_64-unknown-windows-msvc'
error: 'hello': Invalid manifest (compiled with: ["C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\bin\\swiftc.exe", "-vfsoverlay", "C:\\Users\\JOEBLOG~1\\AppData\\Local\\Temp\\TemporaryDirectory.OlEqiF\\vfs.yaml", "-L", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-lPackageDescription", "-sdk", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\SDKs\\Windows.sdk\\", "-libc", "MD", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64", "-L", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\x86_64", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows", "-L", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.0\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows\\x86_64", "-use-ld=lld", "-swift-version", "6", "-I", "C:\\Users\\Joe Bloggs\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.0+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-package-description-version", "6.0.0", "D:\\Code\\hello\\Package.swift", "-o", "C:\\Users\\JOEBLOG~1\\AppData\\Local\\Temp\\TemporaryDirectory.C7kHTN\\hello-manifest.exe"])
<unknown>:0: error: unable to load standard library for target 'x86_64-unknown-windows-msvc'
Trying to invoke the compiler on its own doesn't fair any better:
D:\Code\hello>swiftc -emit-executable -o a.exe Sources\main.swift
e[1m<unknown>:0: e[0me[0;1;31merror: e[0me[1munable to load standard library for target 'x86_64-unknown-windows-msvc'
e[0m
This is from a developer prompt. The results are the same from regular CMD and Powershell prompts.
I've enabled symlinks for standard users, and installed Python 3.9. Passing the flag -sdk %SDKROOT%
doesn't improve the situation.
Any help would be appreciated.