You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
xtool dev fails at package planning on Swift 6.4.2 (Linux): SwiftBuild linker probe reports ld.lld -version_details JSON parse error #419
Swift 6.4.2-RELEASE, official swift-6.4.2-RELEASE-ubuntu24.04.tar.gz (not swiftly: swiftly reports "Unsupported Linux platform" on this distro)
SDK: xtool sdk from Xcode_27.2.xip, darwin-sdk-version.txt: epoch=4,darwinTools=1.1.0,oam=1.4.1
Target: iPhone14,7, iOS 27.0.1, free Apple ID (login mode 1)
Package: one library product + targets, one external dependency (GRDB.swift 7.11.1), platforms: [.iOS(.v17)], swift-tools-version: 6.1
Steps
xtool setup completes, swift sdk list shows darwin.
xtool dev in the project folder.
Result
Building for debugging...
[Computing dependencies]
error: Could not parse output of `/home/<user>/.local/share/swift-6.4.2/usr/bin/ld.lld -version_details` as JSON: (x24)
error: Build failed
The build never reaches compilation. Earlier in the same setup, a full compile of all targets (including GRDB) for arm64-ios succeeded, and the failure was in the link step, so this appeared after some change in the environment that I could not reproduce.
What I checked
ld.lld -version_details on the Swift 6.4.2 toolchain: error: unknown argument '-version_details', exit 1, empty stdout.
ld.lld -v on the same toolchain: prints LLD 21.0.0 (https://github.com/swiftlang/llvm-project.git fb5f84d903a3b4e7aea15cd5666598a46f56c833) (compatible with GNU linkers) on stdout, exit 0.
In a clean environment (env -i), ld.lld could not start: libxml2.so.2 (Ubuntu 24.04 build) loaded but could not find libicuuc.so.74. Setting $ORIGIN as the runpath on the toolchain's libxml2 and ICU libraries fixed the load. ld.lld -v then works in the clean environment.
After that fix, xtool dev still reports the same 24 errors.
SwiftBuild source (swiftlang/swift-build, Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift, discoveredLinkerToolsInfo, around line 2015): it tries -version_details first, and on a JSON parse failure falls back to -v. The fallback recognises LLD (\d+). Yet the thrown error is still the original JSON parse error, so the fallback result seems to be discarded or never reached.
Questions
Is the -v fallback meant to run on Linux hosts with the Swift 6.4 toolchain? If so, why is the error still raised?
Which linker does SwiftBuild resolve during planning on Linux? The Darwin SDK toolset (toolset-swb.json) names ld64.lld, but the probe runs the toolchain's ld.lld.
Is there a known-good Swift 6.4 Linux toolchain for xtool 1.24.0? (We also tried 6.4.0 with the same result.)
AFAICT this is an issue with using the Ubuntu toolchain on Arch. The version_details error is a red herring.
Even though we don't actually use the toolchain's built-in ld.lld, SwiftBuild still checks it for version info. So basically ~/.local/share/swift-6.4.2/usr/bin/ld.lld -v isn't working in the SwiftBuild environment for some reason.
Claude recommends running the following commands to get more insight into the issue, let me know what you see.
Activity
kabiroberai commentedon Nov 1, 2026
AFAICT this is an issue with using the Ubuntu toolchain on Arch. The
version_detailserror is a red herring.Even though we don't actually use the toolchain's built-in
ld.lld, SwiftBuild still checks it for version info. So basically~/.local/share/swift-6.4.2/usr/bin/ld.lld -visn't working in the SwiftBuild environment for some reason.Claude recommends running the following commands to get more insight into the issue, let me know what you see.
Converting this into a discussion since it's not an xtool bug