terhechte / SourceKittenDaemon

Swift Auto Completions for any Text Editor
MIT License
529 stars 37 forks source link

Swift tools version misreported #77

Open dabrahams opened 5 years ago

dabrahams commented 5 years ago
$ make
mkdir -p .build/release
swift build -c release --build-path .build
/Users/dave/src/SourceKittenDaemon: error: package at '/Users/dave/src/SourceKittenDaemon' requires a minimum Swift tools version of 4.0.0 (currently 3.1.0)
make: *** [.build/release/sourcekittend] Error 1

I'm sure this is not a bug in SourceKittenDaemon, but it's blocking me. The only Swift compiler I have is 4.2, so I don't understand the complaint. Any ideas?

terhechte commented 5 years ago

Hm, that's weird. I just tried the above with Swift 4.2(swiftlang-1000.11.37.1 clang-1000.11.45.1) and it worked just fine. Are you building on macOS or Linux?

$ make
mkdir -p .build/release
swift build -c release --build-path .build
warning: PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): SourceKittenDaemon, Embassy, XcodeEdit
swift --version
dabrahams commented 5 years ago

MacOS

terhechte commented 5 years ago

Catching straws here as you know all this much better than me

Does adding verbose swift build -c release --verbose --build-path .build provide hints?

What's weird is that the original make seems to have run just fine. So I'd venture that when you run swift generate-xcodeproj and do xcodebuild or open it in Xcode it also builds fine, right?

dabrahams commented 5 years ago
$ swift build -c release --verbose --build-path .build
xcrun --sdk macosx --show-sdk-path
xcrun --sdk macosx --show-sdk-platform-path
xcrun --sdk macosx --find xctest
/Users/dave/src/SourceKittenDaemon: error: package at '/Users/dave/src/SourceKittenDaemon' requires a minimum Swift tools version of 4.0.0 (currently 3.1.0)

What's weird is that the original make seems to have run just fine.

Sorry, what's "the original make?"

So I'd venture that when you run swift generate-xcodeproj and do xcodebuild or open it in Xcode it also builds fine, right?

I guess not!

error: unable to invoke subcommand: /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-generate-xcodeproj (No such file or directory)

Maybe the necessary facilities are not built into my Apple-internal development Xcode.

terhechte commented 5 years ago

I've created a branch with an added xcodeproj. Does that work (or maybe provide additional hints)?

https://github.com/terhechte/SourceKittenDaemon/tree/issue/77

dabrahams commented 5 years ago

It might work if I knew how to fetch the dependencies:

CYaml Group
XcodeEdit Group
Error Group
:-1: Build input files cannot be found: '/Users/dave/src/SourceKittenDaemon/.build/checkouts/XcodeEdit.git-1802152492601644490/Sources/XCProjectFile.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/XcodeEdit.git-1802152492601644490/Sources/Extensions.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/XcodeEdit.git-1802152492601644490/Sources/PBXObject.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/XcodeEdit.git-1802152492601644490/Sources/Serialization.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/XcodeEdit.git-1802152492601644490/Sources/AllObjects.swift'
SWXMLHash Group
Error Group
:-1: Build input files cannot be found: '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SWXMLHash.git--9112193995048455000/Source/shim.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SWXMLHash.git--9112193995048455000/Source/SWXMLHash+TypeConversion.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SWXMLHash.git--9112193995048455000/Source/SWXMLHash.swift'
Commandant Group
Error Group
:-1: Build input files cannot be found: '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/Switch.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/OrderedSet.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/ArgumentParser.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/HelpCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/Option.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/Command.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/Argument.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/Errors.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Commandant.git--3489350664079169906/Sources/Commandant/ArgumentProtocol.swift'
Yams Group
Error Group
:-1: Build input files cannot be found: '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Tag.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/YamlError.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Encoder.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Decoder.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/String+Yams.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Node.Sequence.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Emitter.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Representer.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Parser.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Resolver.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Constructor.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/shim.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Node.Mapping.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Node.Scalar.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Mark.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/Yams.git-814441078639266472/Sources/Yams/Node.swift'
SourceKittenFramework Group
Error Group
:-1: Build input files cannot be found: '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/library_wrapper_Documentation.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SwiftDocs.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Version.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/String+SourceKitten.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Clang+SourceKitten.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Language.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SwiftDeclarationKind.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SwiftDocKey.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Parameter.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/LinuxCompatibility.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Request.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Xcode.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SyntaxKind.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Structure.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/UID.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SourceDeclaration.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/ClangTranslationUnit.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SyntaxToken.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/StatementKind.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Documentation.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SourceLocation.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SwiftDeclarationAttributeKind.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Module.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Dictionary+Merge.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/shim.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SourceKitObject.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/SyntaxMap.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/library_wrapper_CXString.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/CodeCompletionItem.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/File.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/ObjCDeclarationKind.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/Text.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/library_wrapper_Index.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/library_wrapper_sourcekitd.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/JSONOutput.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/library_wrapper.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/SourceKittenFramework/OffsetMap.swift'
sourcekitten Group
Error Group
:-1: Build input files cannot be found: '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/main.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/SyntaxCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/IndexCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/DocCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/CompleteCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/ModuleInfoCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/YamlRequestCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/FormatCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/VersionCommand.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/Errors.swift', '/Users/dave/src/SourceKittenDaemon/.build/checkouts/SourceKitten.git-5440527223896005158/Source/sourcekitten/StructureCommand.swift'
SourceKittenDaemon Group
Swift Compiler Error Group
/Users/dave/src/SourceKittenDaemon/Sources/SourceKittenDaemon/Completer/Completer.swift:10:8: No such module 'SourceKittenFramework'
Uncategorized Group
Command CompileSwift failed with a nonzero exit code
sourcekittend Group
Swift Compiler Error Group
/Users/dave/src/SourceKittenDaemon/Sources/sourcekittend/StartCommand.swift:9:8: No such module 'Commandant'
terhechte commented 5 years ago

Does swift package resolve work on your system?

I can't just add the checkouts to the custom branch as they're themselves git repositories. I could zip them and add them if that would work for you.

rudedogg commented 5 years ago

Does the output for the versions of everything look correct?

xcode-select --print-path
xcodebuild -version
swift --version
swift build --version

Probably some overlap checking those, just throwing out ideas and commands :D

woolsweater commented 5 years ago

Looks like a // swift-tools-version:N.N line at the top of Package.swift became mandatory with the Package API redesign. Without it, SPM seems to assume v3.3.1. Additionally, the list of excluded paths for a target was moved from Package to Target after SE-0162 so there are changes needed to the manifest.

Unfortunately, after updating the manifest I am continually getting timeouts during dependency resolution. Mostly -- as far as I can tell -- when the process gets to Clang_C, which seems to be a dependency of SourceKitten. Sometimes it's during a swiftc invocation, but other times git cat-file. Still trying to figure out the issue.