I have ventured to experiment with swift 6.0.1 on a Windows 11 (ARM) vm that runs in a Mac Book Pro M1 chip.
I have followed the simple install instructions using either manual config or winget cli.
And I can't get "swift build" on a simple hello world.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\cdeda> cd C:\Users\cdeda\Developer\hello_world
PS C:\Users\cdeda\Developer\hello_world> swift build
error: 'hello_world': Invalid manifest (compiled with: ["C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.1+Asserts\\usr\\bin\\swiftc.exe", "-vfsoverlay", "C:\\Users\\cdeda\\AppData\\Local\\Temp\\TemporaryDirectory.uNpAeu\\vfs.yaml", "-L", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.1+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-lPackageDescription", "-sdk", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\SDKs\\Windows.sdk\\", "-libc", "MD", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\aarch64", "-L", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\aarch64", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows", "-L", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows\\aarch64", "-use-ld=lld", "-swift-version", "6", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.1+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-package-description-version", "6.0.0", "C:\\Users\\cdeda\\Developer\\hello_world\\Package.swift", "-o", "C:\\Users\\cdeda\\AppData\\Local\\Temp\\TemporaryDirectory.0L7Xlo\\hello_world-manifest.exe"])
<module-includes>:1:10: note: in file included from <module-includes>:1:
1 | #include "AssertionReporting.h"
| `- note: in file included from <module-includes>:1:
2 | #include "CoreFoundationShims.h"
3 | #include "EmbeddedShims.h"
Tweaked the installed VS packages a bit and get a new error
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\cdeda> cd C:\Users\cdeda\Developer\hello_world
PS C:\Users\cdeda\Developer\hello_world> swift build
error: 'hello_world': Invalid manifest (compiled with: ["C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.1+Asserts\\usr\\bin\\swiftc.exe", "-vfsoverlay", "C:\\Users\\cdeda\\AppData\\Local\\Temp\\TemporaryDirectory.UHQwlF\\vfs.yaml", "-L", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.1+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-lPackageDescription", "-sdk", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\SDKs\\Windows.sdk\\", "-libc", "MD", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\aarch64", "-L", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\XCTest-development\\usr\\lib\\swift\\windows\\aarch64", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows", "-L", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Platforms\\6.0.1\\Windows.platform\\Developer\\Library\\Testing-development\\usr\\lib\\swift\\windows\\aarch64", "-use-ld=lld", "-swift-version", "6", "-I", "C:\\Users\\cdeda\\AppData\\Local\\Programs\\Swift\\Toolchains\\6.0.1+Asserts\\usr\\lib\\swift\\pm\\ManifestAPI", "-package-description-version", "6.0.0", "C:\\Users\\cdeda\\Developer\\hello_world\\Package.swift", "-o", "C:\\Users\\cdeda\\AppData\\Local\\Temp\\TemporaryDirectory.Hzsbto\\hello_world-manifest.exe"])
error: link command failed with exit code 1 (use -v to see invocation)
lld-link: error: could not open 'msvcrt.lib': no such file or directory
lld-link: error: could not open 'oldnames.lib': no such file or directory
lld-link: error: could not open 'msvcprt.lib': no such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To be honest, I don't know much about Windows 11 (ARM) and wonder where did you get Swift toolchain for it (or is it able to run x86_64 binaries?). Aside from the ARM specifics, I suggest the following:
You don't need Windows 10 SDK. Windows 11 SDK is the only one you need. Applications created with it will work under Windows 10 too. The recommended version of Windows 11 SDK at the moment is 10.0.22621 (component name Microsoft.VisualStudio.Component.Windows11SDK.22621), see here.
I suspect that the reason that you get that error is because you are installing the x64 toolchain image and running under emulation rather than installing the ARM64 toolchain.
Enabling developer mode is required (or you can use a GPO to grant yourself the SeCreateSymbolicLinkPrivelege privilege). This isn’t really a bug but a security restriction on windows.
The devopler mode might not be enough if the SeCreateSymbolicLinkPrivilege is suppressed by other controls, which might be the case in corporate environments, test via mklink newfile oldfile , creating a symbolic link file named newfile pointing to oldfile.