Skip to content

xtool dev fails at package planning on Swift 6.4.2 (Linux): SwiftBuild linker probe reports ld.lld -version_details JSON parse error #419

Closed

Description

@JlassiRafet

Environment

  • xtool 1.24.0 (xtool-x86_64.AppImage, FUSE available)
  • Host: Omarchy 4.0.6 (Arch-based), x86_64
  • 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

  1. xtool setup completes, swift sdk list shows darwin.
  2. 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

  1. Is the -v fallback meant to run on Linux hosts with the Swift 6.4 toolchain? If so, why is the error still raised?
  2. 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.
  3. 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.)

Related

Expected

xtool dev finishes planning and builds the app for the device.

Activity

  1. kabiroberai commented on Nov 1, 2026

    @kabiroberai
    Member

    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.

    ~/.local/share/swift-6.4.2/usr/bin/ld.lld -v; echo "exit=$?"
    ldd ~/.local/share/swift-6.4.2/usr/bin/lld | grep -e xml -e icu -e "not found"

    Converting this into a discussion since it's not an xtool bug

  2. locked and limited conversation to collaborators on Nov 1, 2026
  3. converted this issue into a discussion #420 on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions