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
SDK install copies PATH Clang 22 headers incompatible with Swift 6.4’s embedded Clang 21 #273
On Linux, xtool sdk install copies Clang resource headers from the clang executable found on PATH:
letclangURL=tryawaitToolRegistry.locate(\"clang\")...try await FileManager.default.copyItem(at: hostInclude, to: sdkInclude, preserveOwner: false)
On my system, this selects Clang 22.1.8, but Swift 6.4 embeds libclang.so.21.0.0. The resulting SDK contains Clang 22 resource headers that are compiled by Swift’s Clang 21 frontend.
Building an iOS package then fails in arm_neon.h:
.../usr/lib/clang/21/include/arm_neon.h:49996:11:
error: size of '__builtin_bit_cast' source type 'int' does not match
destination type 'int64_t' (aka 'long long') (4 vs 8 bytes)
Expected result
xtool sdk install should use Clang resource headers compatible with the selected Swift toolchain, or fail during SDK installation with an actionable version-mismatch error.
Actual result
The generated SDK copies Clang 22 headers from PATH, while swift-frontend uses Swift 6.4’s embedded Clang 21. xtool dev fails before app sources compile.
Validation
I replaced the installed SDK resource headers with the resource headers from Clang 21.1.8:
/usr/lib/llvm21/lib/clang/21/include
The __builtin_bit_cast and arm_neon.h failures disappeared completely. The build progressed through the prior _Builtin_intrinsics stage and into app compilation.
@kabiroberai got a bunch of warnings, but the build passed now with your fix, so I guess I'll just ignore these 🤷
warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssilShared-t.build/Objects-normal/arm64/ytrssilShared-primary-emit-module.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
warning: Unable to locate libSwiftScan. Fallback to `swift-frontend` dependency scanner invocation.
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssilShared-t.build/Objects-normal/arm64/ServerConfiguration.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/ServerConfiguration.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssilShare-t.build/Objects-normal/arm64/ytrssilShare-primary-emit-module.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/SettingsStore.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil-Builder.build/Debug-iphoneos/ytrssilShare-Extension-p.build/Objects-normal/arm64/stub.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/KeychainStore.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/APIClient.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/ytrssil-primary-emit-module.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil-Builder.build/Debug-iphoneos/ytrssil-App-p.build/Objects-normal/arm64/stub.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/ContentView.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/ytrssilApp.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssilShare-t.build/Objects-normal/arm64/ShareViewController.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/SettingsView.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/HistoryView.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/ChannelsView.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
warning: /home/user/dev/ios/ytrssil/.build/out/Intermediates.noindex/ytrssil.build/Debug-iphoneos/ytrssil-t.build/Objects-normal/arm64/FeedView.dia Could not read serialized diagnostics file: unable to find libclang in any registered toolchain
@TheEdgeOfRage hmm I wonder if that's a toolchain issue (with AUR swift-bin) or an xtool one. Swift 6.4 has some growing pains with SwiftBuild. Do you see something similar when building an executable for Linux?
Yeah, seems that this is actually a swift build warning. Compiling a test swift package shows the same warnings, unless I switch to the legacy build system, so definitely not caused by xtool
Activity
kabiroberai commentedon Sep 21, 2026
I wonder if we're picking up the wrong clang resource dir (we should be using the one in the Swift toolchain).
Could you please share the output of the following?
kabiroberai commentedon Sep 21, 2026
Also could you check if #274 fixes the issue for you?
sdk: get clang resources from swift toolchain (xtool-org#274)
TheEdgeOfRage commentedon Sep 22, 2026
@kabiroberai got a bunch of warnings, but the build passed now with your fix, so I guess I'll just ignore these 🤷
kabiroberai commentedon Sep 22, 2026
@TheEdgeOfRage hmm I wonder if that's a toolchain issue (with AUR swift-bin) or an xtool one. Swift 6.4 has some growing pains with SwiftBuild. Do you see something similar when building an executable for Linux?
TheEdgeOfRage commentedon Sep 22, 2026
Yeah, seems that this is actually a swift build warning. Compiling a test swift package shows the same warnings, unless I switch to the legacy build system, so definitely not caused by xtool