Hello,
I can't get debugging to work in VScode on a Windows 11 ARM VM.
I am not sure if that's simply because ARM is not yet supported (although building and everything except debugging seems to work), or if there's some problem with my setup.
The behavior I see is that everything (i.e., package resolution, building) works fine, except for debugging, where nothing happens after the build step has completed.
I tried with and without the "Use Debug Adapter From Toolchain" setting, but saw no difference. The debugging session simply would not start in either case.
I tried different toolchains, both the official Swift.org one, as well as builds by The Browser Company. I provided some diagnostics for the different toolchains below.
Environment & Test App
- VSCode 1.96.2
- Swift extension 1.11.4
- Windows 11 Home 24H2
- on a 2021 Mac Book Pro with M1 Pro
My test app is a minimal console app created with SPM.
Test app
@main
struct HelloConsole {
static func main() {
print("hello, console")
}
}
// swift-tools-version: 6.0
import PackageDescription
let package = Package(
name: "helloconsole",
targets: [
.executableTarget(
name: "helloconsole"),
]
)
launch.json
{
"configurations": [
{
"type": "swift-lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:helloconsole}",
"name": "Debug helloconsole",
"program": "${workspaceFolder:helloconsole}/.build/debug/helloconsole",
"preLaunchTask": "swift: Build Debug helloconsole"
},
{
"type": "swift-lldb",
"request": "launch",
"args": [],
"cwd": "${workspaceFolder:helloconsole}",
"name": "Release helloconsole",
"program": "${workspaceFolder:helloconsole}/.build/release/helloconsole",
"preLaunchTask": "swift: Build Release helloconsole"
}
]
}
Swift.org latest 6.0 release, installed via winget
Following the installation instructions, this toolchain doesn't work:
PS E:\sandbox\compositorapp\helloconsole> swift build
error: toolchain is invalid: could not find CLI tool `link` at any of these directories: [<AbsolutePath:"C:\WINDOWS\system32">,
<AbsolutePath:"C:\WINDOWS">, <AbsolutePath:"C:\WINDOWS\System32\Wbem">, <AbsolutePath:"C:\WINDOWS\System32\WindowsPowerShell\v1.0\">,
<AbsolutePath:"C:\WINDOWS\System32\OpenSSH\">, <AbsolutePath:"C:\Program Files\Git\cmd">, <AbsolutePath:"C:\Program Files\dotnet\">,
<AbsolutePath:"C:\Users\karl\AppData\Local\Programs\Python\Python39\Scripts\">, <AbsolutePath:"C:\Users\karl\AppData\Local\Programs\Python\Python39\">,
<AbsolutePath:"C:\Users\karl\AppData\Local\Microsoft\WindowsApps">, <AbsolutePath:"C:\Users\karl\AppData\Local\Programs\Visual Studio Code\bin">,
<AbsolutePath:"C:\Users\karl\bin">, <AbsolutePath:"C:\Users\karl\.dotnet\tools">, <AbsolutePath:"E:\Swift\Runtimes\6.0.2\usr\bin\">,
<AbsolutePath:"E:\Swift\Toolchains\6.0.2+Asserts\usr\bin\">]
Diagnostics
> swift -version
Swift version 6.0.2 (swift-6.0.2-RELEASE)
Target: aarch64-unknown-windows-msvc
Settings captured by VScode Swift diagnostics:
Swift version 6.0.2 (swift-6.0.2-RELEASE)
Platform: win32
Swift Path: E:\Swift\Toolchains\6.0.2+Asserts\usr\bin
Toolchain Path: E:\Swift\Toolchains\6.0.2+Asserts\usr
Runtime Library Path: E:\Swift\Runtimes\6.0.2\usr\bin
Default Target: aarch64-unknown-windows-msvc
Settings:
{
"path": "e:\\Swift\\Toolchains\\6.0.2+Asserts\\usr\\bin",
"buildArguments": [],
"additionalTestArguments": [],
"testEnvironmentVariables": {},
"sanitizer": "off",
"searchSubfoldersForPackages": false,
"autoGenerateLaunchConfigurations": true,
"disableAutoResolve": false,
"diagnosticsCollection": "keepSourceKit",
"diagnosticsStyle": "llvm",
"backgroundCompilation": false,
"actionAfterBuildError": "Focus Terminal",
"buildPath": "",
"disableSwiftPackageManagerIntegration": false,
"warnAboutSymlinkCreation": true,
"enableTerminalEnvironment": true,
"excludeFromCodeCoverage": [],
"excludePathsFromPackageDependencies": [
".git",
".github"
],
"showBuildStatus": "swiftStatus",
"showCreateSwiftProjectInWelcomePage": true,
"openAfterCreateNewProject": "prompt",
"sourcekit-lsp": {
"serverPath": "",
"serverArguments": [],
"supported-languages": [
"swift",
"objective-c",
"objective-cpp",
"c",
"cpp"
],
"backgroundIndexing": "auto",
"trace": {
"server": "off"
},
"disable": false
},
"debugger": {
"useDebugAdapterFromToolchain": true,
"path": ""
},
"swiftEnvironmentVariables": {
"DEVELOPER_DIR": "public"
},
"runtimePath": "",
"SDK": "",
"diagnostics": false
}
Swift.org latest 6.0 release, manual installer
Using this installer, the toolchain works fine, except for debugging.
Diagnostics
> swift -version
Swift version 6.0.3 (swift-6.0.3-RELEASE)
Target: aarch64-unknown-windows-msvc
Settings captured by VScode Swift diagnostics:
Swift version 6.0.3 (swift-6.0.3-RELEASE)
Platform: win32
Swift Path: E:\Swift\Toolchains\6.0.3+Asserts\usr\bin
Toolchain Path: E:\Swift\Toolchains\6.0.3+Asserts\usr
Runtime Library Path: E:\Swift\Runtimes\6.0.3\usr\bin
Default Target: aarch64-unknown-windows-msvc
Default SDK: E:\Swift\Platforms\6.0.3\Windows.platform\Developer\SDKs\Windows.sdk\
XCTest Path: E:\Swift\Platforms\6.0.3\Windows.platform\Developer\Library\XCTest-development\usr\bin64a
Settings:
{
"path": "",
"buildArguments": [],
"additionalTestArguments": [],
"testEnvironmentVariables": {},
"sanitizer": "off",
"searchSubfoldersForPackages": false,
"autoGenerateLaunchConfigurations": true,
"disableAutoResolve": false,
"diagnosticsCollection": "keepSourceKit",
"diagnosticsStyle": "llvm",
"backgroundCompilation": false,
"actionAfterBuildError": "Focus Terminal",
"buildPath": "",
"disableSwiftPackageManagerIntegration": false,
"warnAboutSymlinkCreation": true,
"enableTerminalEnvironment": true,
"excludeFromCodeCoverage": [],
"excludePathsFromPackageDependencies": [
".git",
".github"
],
"showBuildStatus": "swiftStatus",
"showCreateSwiftProjectInWelcomePage": true,
"openAfterCreateNewProject": "prompt",
"sourcekit-lsp": {
"serverPath": "",
"serverArguments": [],
"supported-languages": [
"swift",
"objective-c",
"objective-cpp",
"c",
"cpp"
],
"backgroundIndexing": "auto",
"trace": {
"server": "off"
},
"disable": false
},
"debugger": {
"useDebugAdapterFromToolchain": true,
"path": ""
},
"swiftEnvironmentVariables": {},
"runtimePath": "",
"SDK": "",
"diagnostics": false
}
The Browser Company's latest dev release 20241227.3
This toolchain also works fine, except for debugging.
Diagnostics
> swift -version
compnerd.org Swift version 6.2-dev (LLVM 9f6c3d784782c34, Swift 55189bae8e55169)
Target: aarch64-unknown-windows-msvc
Settings captured by VScode Swift diagnostics:
compnerd.org Swift version 6.2-dev (LLVM 9f6c3d784782c34, Swift 55189bae8e55169)
Platform: win32
Swift Path: E:\Swift\Toolchains\0.0.0+Asserts\usr\bin
Toolchain Path: E:\Swift\Toolchains\0.0.0+Asserts\usr
Runtime Library Path: E:\Swift\Runtimes\0.0.0\usr\bin
Default Target: aarch64-unknown-windows-msvc
Default SDK: E:\Swift\Platforms\0.0.0\Windows.platform\Developer\SDKs\Windows.sdk\
XCTest Path: E:\Swift\Platforms\0.0.0\Windows.platform\Developer\Library\XCTest-development\usr\bin64a
Settings:
{
"path": "",
"buildArguments": [],
"additionalTestArguments": [],
"testEnvironmentVariables": {},
"sanitizer": "off",
"searchSubfoldersForPackages": false,
"autoGenerateLaunchConfigurations": true,
"disableAutoResolve": false,
"diagnosticsCollection": "keepSourceKit",
"diagnosticsStyle": "llvm",
"backgroundCompilation": false,
"actionAfterBuildError": "Focus Terminal",
"buildPath": "",
"disableSwiftPackageManagerIntegration": false,
"warnAboutSymlinkCreation": true,
"enableTerminalEnvironment": true,
"excludeFromCodeCoverage": [],
"excludePathsFromPackageDependencies": [
".git",
".github"
],
"showBuildStatus": "swiftStatus",
"showCreateSwiftProjectInWelcomePage": true,
"openAfterCreateNewProject": "prompt",
"sourcekit-lsp": {
"serverPath": "",
"serverArguments": [],
"supported-languages": [
"swift",
"objective-c",
"objective-cpp",
"c",
"cpp"
],
"backgroundIndexing": "auto",
"trace": {
"server": "off"
},
"disable": false
},
"debugger": {
"useDebugAdapterFromToolchain": true,
"path": "E:\\Swift\\Toolchains\\0.0.0+Asserts\\usr\\bin\\lldb-dap.exe"
},
"swiftEnvironmentVariables": {
"DEVELOPER_DIR": "public"
},
"runtimePath": "",
"SDK": "",
"diagnostics": false
}
Thanks in advance,
Karl