sde
sde copied to clipboard
The Swift server crashed 5 times in the last 3 minutes. The server will not be restarted
Using macOS Sierra
/Users/gustavoperdomo/.vscode/extensions/jinmingjian.sde-1.0.20170112/out/src/server/server.js:157
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sourcekitd-repl ENOENT
at exports._errnoException (util.js:1026: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 - 3:40:48 PM] Connection to server got closed. Server will restart.
/Users/gustavoperdomo/.vscode/extensions/jinmingjian.sde-1.0.20170112/out/src/server/server.js:157
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sourcekitd-repl ENOENT
at exports._errnoException (util.js:1026: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 - 3:40:49 PM] Connection to server got closed. Server will restart.
/Users/gustavoperdomo/.vscode/extensions/jinmingjian.sde-1.0.20170112/out/src/server/server.js:157
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sourcekitd-repl ENOENT
at exports._errnoException (util.js:1026: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 - 3:40:49 PM] Connection to server got closed. Server will restart.
/Users/gustavoperdomo/.vscode/extensions/jinmingjian.sde-1.0.20170112/out/src/server/server.js:157
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sourcekitd-repl ENOENT
at exports._errnoException (util.js:1026: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 - 3:40:49 PM] Connection to server got closed. Server will restart.
/Users/gustavoperdomo/.vscode/extensions/jinmingjian.sde-1.0.20170112/out/src/server/server.js:157
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sourcekitd-repl ENOENT
at exports._errnoException (util.js:1026: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)
[Error - 3:40:49 PM] Connection to server got closed. Server will not be restarted.
You don't have the sourcekitd-repl tool in this location (/usr/bin/sourcekitd-repl ENOENT
).
@PuerkitoBio do you know where it is located on macOS?
I'm trying to figure this out atm, looks like it isn't built by default (it's a test tool or something). I checked /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
and it's not there.
online just now. really thanks for all report. The choose of 'sourcekitd-repl' is not accident. It is a tool made by official Swift team. So it should work in all platform which Swift supports. It is great.
The tool is also not built by default. I use a build preset file way (customized @ ~/.swift-build-presets) in my Linux which modified from the official preset file.
please wait a moment. I will share you a build preset in Linux which give you some hints.
this preset file now lives here.
the "secretβ may be this:
... extra-cmake-options="-DSWIFT_BUILD_SOURCEKIT:BOOL=ON -DSWIFT_TOOL_SOURCEKITD_REPL_BUILD=1"
dash-dash
swift-install-components=autolink-driver;compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-inproc;tools ...
at OSX, you may change:
sourcekit-inproc -> sourcekit-xpc-service
and component "tools" should corresponds to sourcekit side gen.
extra-cmake-options is must for Linux. but I guess no harm for OSX.
And it needs two passes in Linux: First, disable "sourcekit-inproc" comopnent for libdispatch, and second enable "sourcekit-inproc" for itself.
@alblue recently introduce a PR to solve this problem, but seemly reverted...
Add if some successfully, it may be possible to only ship the binary for macOS in that the sourcekit lib should already have existed which used by xcode. Great.
I just pushed new version into VSCode Marketplace which fixs #14 for macOS
I'm having the same problem on Ubuntu 16.04. I'm using https://github.com/norio-nomura/docker-sourcekit-builder provides sourcekitd-repl.
and note: we need SPM 3.1 for the info of project which is not available for 3.0.
In macOS, it has fancy tool swiftenv for use.
More notes: It can be hard coded by assumption with Sources or src by ablue. But this is too special. One workaround is to use build.yaml. However, this is a internal generated build file. It is better to based on "swfit package"(which is official interface to reflect Pacakge.swift itself)
@fwgreen do you have sourcekitd-repl in path? How about you execute the following cmd in shell:
which sourcekitd-repl
sourcekitd-repl
@fwgreen thanks for report for Linux.
More note: sourcekitd-repl even can not be executed in my Arch default. Because the linked library name is not correct. The following workaround this:
sudo ln -s /usr/lib/sourcekitdInProc.framework/sourcekitdInProc /usr/lib/sourcekitdInProc
But the ubuntu release is officially supported, so I guess the problem should not be there...
@fwgreen could you like to try some binary from my own build? :smile:
@jinmingjian I'll have to try and build it myself: I tried running sourcekitd-repl
and got an error. Maybe the a complete language server written in TypeScript would save us π. I'll try to build it and report back.
@jinmingjian I managed to get sourcekitd-repl
working, but the error persists π
@fwgreen if sourcekitd-repl works, then it almost becomes working for all.
what is your exact error output?
and still show you output of the following cmd in shell:
which sourcekitd-repl
you add a sym link to /usr/bin/sourcekitd-repl. or use override configurations. You can see all configurable constants in Extensions's page in vscode:
ok, more detail config like this:
@PuerkitoBio I know this is not the place to ask, but I didn't manage to find the required info anywhere :( Any idea how to build the sourcekitd-repl / sourcekit on a mac?
which sourcekitd-repl
returns
/usr/bin/sourcekitd-repl
sourcekitd-repl
returns
Welcome to SourceKit. Type ':help' for assistance.
(SourceKit)
The output from vscode is
/home/fwgreen/.vscode/extensions/jinmingjian.sde-1.0.20170113/out/src/server/server.js:64
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sh ENOENT
at exports._errnoException (util.js:1026: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 - 6:20:37 AM] Connection to server got closed. Server will restart.
/home/fwgreen/.vscode/extensions/jinmingjian.sde-1.0.20170113/out/src/server/server.js:64
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sh ENOENT
at exports._errnoException (util.js:1026: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 - 6:20:38 AM] Connection to server got closed. Server will restart.
/home/fwgreen/.vscode/extensions/jinmingjian.sde-1.0.20170113/out/src/server/server.js:64
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sh ENOENT
at exports._errnoException (util.js:1026: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 - 6:20:38 AM] Connection to server got closed. Server will restart.
/home/fwgreen/.vscode/extensions/jinmingjian.sde-1.0.20170113/out/src/server/server.js:64
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sh ENOENT
at exports._errnoException (util.js:1026: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 - 6:20:38 AM] Connection to server got closed. Server will restart.
/home/fwgreen/.vscode/extensions/jinmingjian.sde-1.0.20170113/out/src/server/server.js:64
throw err; //FIXME more friendly prompt
^
Error: spawn /usr/bin/sh ENOENT
at exports._errnoException (util.js:1026: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)
[Error - 6:20:39 AM] Connection to server got closed. Server will not be restarted.
@jinmingjian Thanks I got it to work on macOS π
@rolandleth I needed to compile it manually.
$ mkdir swift-sources && cd swift-sources
# Probably other swift versions will work too
$ git clone --branch swift-DEVELOPMENT-SNAPSHOT-2017-01-05-a --depth 1 https://github.com/apple/swift
$ brew install cmake ninja
$ swift/utils/update-checkout --clone
# This will end with an error about master not found or so, just ignore it
# Now I edited `swift/utils/build-presets.init` according to @jinmingjian
# As follows https://gist.github.com/vknabel/170caee6b5883624f55c4d7f1b0b259c/revisions
# On the line starting with: 'swift-install-components='
# I replaced 'sourcekit-xpc-service' with 'sourcekit-inproc'
$ swift/utils/build-script # This takes a while
# sourcekitd-repl is now at
# build/Ninja-DebugAssert/swift-macosx-x86_64/bin/sourcekitd-repl
Now you can either link it to /usr/bin
or set "swift.path.sourcekitd_repl"
in Code to the appropriate path.
@vknabel Cool!
@vknabel Awesome, thanks a lot! π
@fwgreen You are using the docker container, right? Did you execute which sourcekitd_repl
in docker run bash
or so?
I guess the problem is that only your docker has sourcekitd_repl
, whereas the rest of your computer (including VS Code) doesn't. Maybe you need to create a bash script that passes all Inputs to docker run sourcekitd_repl
and link that file to /usr/bin/sourcekitd_repl
outside docker.
@fwgreen you met issue #14 in Linux... you have not sh in /usr/bin/sh, find your sh, do a sym link to /usr/bin/sh. I will add config option later for you.
which sh
@vknabel thanks for contributing ideas!
@rolandleth If you still have not build sourcekitd-repl successfully, you may wait for serveral days. I am considering add a simpler solution in #9. The implementation itself is trivial. But I hope to leave a space for further extension. So just wait several days.
After #9 fixed, I plan to ship the binary in the package. For Linux, we still need sourcekitd library to build:( For macOS, the state may be better, I guess sourcekitd have existed in that xcode, but we need to test. You can also help in this if interesting:)
@jinmingjian Oooh, that's great news! I already started building it, but I'll probably just delete everything after you release an update. Thanks!
Should be nice having sourcekitd-repl
as a homebrew formula :D
@jinmingjian The symlink from /bin/sh
to /usr/bin/sh
did the trick! Thanks.
@fwgreen #15 done. And I have published a new version. You can delete the sym link /usr/bin/sh now!