jinmingjian / sourcekite

the backend of SDE's language server
Apache License 2.0
56 stars 9 forks source link

MakeError #6

Open wolfcolony opened 7 years ago

wolfcolony commented 7 years ago

When I Run make or “swift build -Xswiftc -framework -Xswiftc sourcekitd -Xswiftc -F -Xswiftc /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib” after clone git。It prompts a compiler erro

ld: framework not found sourcekitd

:0: error: link command failed with exit code 1 (use -v to see invocation) :0: error: build had 1 command failures error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/mistletoe/sourcekite/.build/debug.yaml what can i do?thank you
jinmingjian commented 7 years ago

@pairmu Have you installed the latest swift 3.1 dev/snapshot? Maybe the layout or convention of latest Swift changed?(I may need a check)

can you show the console printout of this command?:

ls -la /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib

Yuki-Judai commented 7 years ago

I also have a problem with make. I can't get a binary file.

Compile sourcekitd dummy.c Linking sourcekitd Compile Swift Module 'sourcekite' (2 sources) Linking ./.build/release/sourcekite

I don't know if the build process has finished. Then, there are not the directory ./.build/release/sourcekite, I can't find binary file.

(I have installed swift dev 3.0.2 realease.)

jinmingjian commented 7 years ago

@Yuki-Judai I do a reproducer for the latest 3.1 dev. There is no problem on my 10.12 vm...

your output info is interesting because the default build configuration is debug not release.

... --configuration, -c Build with configuration (debug|release) [default: debug]

so you must change the build command to your own one.

Can you download swift dev 3.1 from the official site and install it for trying? Although Swift 3.0 may be OK for building but the SDE uses the API of 3.1 SPM for discovering the metadata of one SPM project. We still need Swift 3.1 for making SDE worked for you.

Yuki-Judai commented 7 years ago

I have installed swift 3.1. But build is failure:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc --driver-mode=swift -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm -lPackageDescription -target x86_64-apple-macosx10.10 /Users/mike/sourcekite/Package.swift -fileno 3 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/mike/sourcekite/.build/debug.yaml -v /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib -framework sourcekitd -F /Library/Developer/Toolchains/swift-latest.xctoolchain/usr/lib -target 'x86_64-apple-macosx10.10' -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk' -g -L/Users/mike/sourcekite/.build/debug -o /Users/mike/sourcekite/.build/debug/sourcekite -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -emit-executable /Users/mike/sourcekite/.build/debug/sourcekite.build/main.swift.o /Users/mike/sourcekite/.build/debug/sourcekite.build/utils.swift.o ld: framework not found sourcekitd

:0: error: link command failed with exit code 1 (use -v to see invocation) :0: error: build had 1 command failures error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/mike/sourcekite/.build/debug.yaml -v
jinmingjian commented 7 years ago

@Yuki-Judai interesting. Yes, /Library/Developer/Toolchains/swift-latest.xctoolchain is symbolic link to /Library/Developer/Toolchains/swift-3.1-DEV....

it seem generated by xcrun or something else of xcode tools automatically.

try the following workaround

ls -la /Library/Developer/Toolchains/

Find the directory name like swift-3.1-DEV... , then replace swift-latest.xctoolchain in the command with itm like:

swift build -Xswiftc -framework -Xswiftc sourcekitd -Xswiftc -F -Xswiftc /Library/Developer/Toolchains/swift-3.1-DEV.../usr/lib -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift-3.1-DEV.../usr/lib

NOTE: here replace swift-3.1-DEV... to your own diectory

Yuki-Judai commented 7 years ago

swift build -v -Xswiftc -framework -Xswiftc sourcekitd -Xswiftc -F -Xswiftc /Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib


/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc--driver-mode=swift -I /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm -L /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/pm -lPackageDescription -target x86_64-apple-macosx10.10 /Users/mike/sourcekite/Package.swift -fileno 3 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/mike/sourcekite/.build/debug.yaml -v /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -Xlinker -rpath -Xlinker '/Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib' -framework sourcekitd -F '/Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib' -target 'x86_64-apple-macosx10.10' -sdk '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk' -g -L/Users/mike/sourcekite/.build/debug -o /Users/mike/sourcekite/.build/debug/sourcekite -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -emit-executable /Users/mike/sourcekite/.build/debug/sourcekite.build/main.swift.o /Users/mike/sourcekite/.build/debug/sourcekite.build/utils.swift.o ld: framework not found sourcekitd

:0: error: link command failed with exit code 1 (use -v to see invocation) :0: error: build had 1 command failures error: exit(1): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/mike/sourcekite/.build/debug.yaml -v
jinmingjian commented 7 years ago

@Yuki-Judai can you show the console printout of this command?:

ls -la /Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib

Yuki-Judai commented 7 years ago

total 95664 drwxr-xr-x 8 root wheel 272 3 20 06:25 . drwxr-xr-x 5 root wheel 170 3 20 06:25 .. -rwxr-xr-x 1 root wheel 48107792 3 20 03:59 libclang.dylib drwxr-xr-x 3 root wheel 102 3 20 06:25 libclang.dylib.dSYM -rwxr-xr-x 1 root wheel 868052 3 20 04:03 libswiftDemangle.dylib drwxr-xr-x 3 root wheel 102 3 20 06:25 libswiftDemangle.dylib.dSYM drwxr-xr-x 3 root wheel 102 3 20 06:25 sourcekitd.framework drwxr-xr-x 10 root wheel 340 3 20 06:25 swift

jinmingjian commented 7 years ago

@Yuki-Judai wired... sourcekitd.framework is just under this path. why "ld: framework not found sourcekitd"?

jinmingjian commented 7 years ago

can you show the console printout of this command?:

swift -version

jinmingjian commented 7 years ago

how about executing the following command?:

/Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/bin/swift build -v -Xswiftc -framework -Xswiftc sourcekitd -Xswiftc -F -Xswiftc /Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib -Xlinker -rpath -Xlinker /Library/Developer/Toolchains/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-19-a.xctoolchain/usr/lib

Yuki-Judai commented 7 years ago

Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1) Target: x86_64-apple-macosx10.9

I should have uninstalled the 3.0.2 version......

error: rootManifestFileNotFound

kochrt commented 7 years ago

For me I had to use /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/ as the path to the Toolchain on macos for make to work

FsThatOne commented 7 years ago

When I run VSCode, i met this, what happened please.

/Users/wangzhengyi/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/sourcekites.js:42`
        throw err;
        ^

Error: spawn ~/sourcekite/.build/debug/sourcekite ENOENT
    at exports._errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
[Info  - 10:30:53 AM] Connection to server got closed. Server will restart.
/Users/wangzhengyi/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/sourcekites.js:42
        throw err;
        ^