SourceKitten
SourceKitten copied to clipboard
Sourcekitten 'complete' resulting in Loading standard library failed.
I tried the complete version from documentation but with my current SDK.
sourcekitten complete --text "import UIKit ; UIColor." --offset 22 -- -target arm64-apple-ios16.0-simulator -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.0.sdk
I don't know whats wrong. Any ideas?
same issue
sourcekitten complete --text "import UIKit ; UIColor." --offset 22 -- -Xcc -isysroot -sdk $(xcrun --show-sdk-path --sdk iphonesimulator) -target arm64-apple-ios16.1
Dunno if I am closer or further away:
I think I might be a little bit closer, but I'm still running in to what I believe is the same bug. I'm on 0.34.1.
$ sourcekitten complete --text "import UIKit ; UIColor." --offset 22 -- -sdk $(xcrun --show-sdk-path --sdk iphoneos) -Xcc "-isysroot $(xcrun --show-sdk-path --sdk iphoneos)"
<unknown>:0: warning: no such sysroot directory: ' /Applications/Xcode-15.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk'
<unknown>:0: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX'
2C457FED-88F1-4B8C-AE75-94B6D5AF6827.swift:1:8: error: no such module 'UIKit'
import UIKit ; UIColor.
^
[{"typeName":"_","numBytesToErase":0,"sourcetext":".self","context":"source.codecompletion.context.thisclass","descriptionKey":"self","kind":"source.lang.swift.keyword","name":"self"}]
I've tried with and without -target arm64-apple-ios17.0
. With -target
:
$ sourcekitten complete --text "import UIKit ; UIColor." --offset 22 -- -target arm64-apple-ios17.0 -sdk $(xcrun --show-sdk-path --sdk iphoneos) -Xcc "-isysroot $(xcrun --show-sdk-path --sdk iphoneos)"
<unknown>:0: warning: no such sysroot directory: ' /Applications/Xcode-15.0.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk'
<unknown>:0: error: unable to load standard library for target 'arm64-apple-ios17.0'
Error: Loading the standard library failed
For what it's worth, I believe that the arguments passed to -Xcc
need to be quoted (-Xcc
arguments are passed to the compiler, and I guess in this case -isysroot path/to/something
is supposed to be passed to cc
). I think that's why you're seeing that -fbuild-session-timestamp
error.
I'm guessing the complete feature is not compatible with the latest Xcode + clang + etc.