Hide last authors
Soeren Domroes 7.1 1 = Running KEITH =
Soeren Domroes 6.1 2
Soeren Domroes 7.1 3
4
Soeren Domroes 16.1 5 {{toc maxLevel="2"/}}
Soeren Domroes 6.1 6
Niklas Rentz 32.1 7 == Setting up your Eclipse ==
Soeren Domroes 1.1 8
Soeren Domroes 8.1 9 For everything not mentioned here refer to [[Getting Eclipse>>doc:KIELER.Getting Eclipse||shape="rect"]] guide.
Soeren Domroes 1.1 10
Niklas Rentz 32.1 11 Use the installer go to advanced mode, add the KIELER url. Then select first semantics and after that pragmatics (**that is very** **important**). You can see that you have done that correctly on the automatically generated name of your Eclipse: It should be something like kieler-semantics-theia.
Soeren Domroes 1.1 12
Niklas Rentz 32.1 13 Select the Theia stream for semantics and the Keith stream for pragmatics and use the latest Eclipse if possible. Set the targetplatform to latest and finish.
Soeren Domroes 1.1 14
Soeren Domroes 8.1 15 Wait till everything installs and the setup tasks finish. If you have any problems in this stage refer to the [[Getting Eclipse>>doc:KIELER.Getting Eclipse||shape="rect"]] guide.
Soeren Domroes 1.1 16
Soeren Domroes 5.1 17 \\
Soeren Domroes 1.1 18
Soeren Domroes 13.1 19 The setup tasks for Modular Target will fail. Disable it after this happens and execute them again via //Help>Perform Setup Tasks//. Open the //plug-in development// perspective. Select working sets as top level elements. Run //clean build//. Several pragmatics projects have errors. Just close them and you will be fine.
Soeren Domroes 1.1 20
Niklas Rentz 32.1 21 To run the language server go to //Run Configurations// create a new E//clipse Application// run configuration and select //Run an application//  and //de.cau.cs.kieler.language.server.LanguageServer//
Soeren Domroes 1.1 22
Soeren Domroes 5.1 23 == [[image:attach:Screenshot from 2019-02-15 14-10-50.png]] ==
Soeren Domroes 1.1 24
Soeren Domroes 5.1 25 \\
Soeren Domroes 1.1 26
Niklas Rentz 33.1 27 You have to edit the arguments too. The Vm arguments host and port are added to connect the LS via socket:
Soeren Domroes 1.1 28
Niklas Rentz 33.1 29 {{code}}
30 -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog
31 {{/code}}
32
33 {{code}}
34 -Dhost=localhost -Dport=5007
35 {{/code}}
36
37 \\
38
Soeren Domroes 5.1 39 [[image:attach:Screenshot from 2019-02-15 14-13-34.png]]
Soeren Domroes 1.1 40
Soeren Domroes 5.1 41 The default port to which KEITH tries to connect is 5007.
Soeren Domroes 1.1 42
43 == Setting up a KEITH developer setup... ==
44
45 General requirements:
46
Soeren Domroes 30.1 47 * node (and additional dependencies see [[Theia developer guide>>url:https://github.com/theia-ide/theia/blob/master/doc/Developing.md||shape="rect"]])
Soeren Domroes 1.1 48 * npm (whatever node installs)
49 * yarn (latest version)
50 * Python (2.7.X)
51 * gcc, g++, and make (for native dependencies of some npm packages)
52 * [[Visual Studio Code>>url:https://code.visualstudio.com/||shape="rect"]] (latest version)
53 * a cloned [[keith >>url:https://git.rtsys.informatik.uni-kiel.de/projects/KIELER/repos/keith/browse||shape="rect"]]repository
54
55 == ... on linux: ==
56
57 (Theia has a [[guide >>url:https://www.theia-ide.org/doc/authoring_extensions||shape="rect"]]for extension development that might be helpful)
58
59 install node 8:
60
61 {{code}}
62 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
63 nvm install 8
64 {{/code}}
65
66 Install python if you haven't (remember: Python 2: , Python 3: ).
67
68 {{code language="none"}}
69 Install yarn (a package manager build on the package manager npm):
70 {{/code}}
71
72 {{{}}}
73
74 \\
75
76 {{code}}
77 npm install -g yarn
78 {{/code}}
79
80 \\
81
82 == ... on windows: ==
83
84 Install [[node 8>>url:https://nodejs.org/download/release/v8.15.0/||shape="rect"]] for windows. I personally used the {{code language="none"}}.msi{{/code}}.
85
Soeren Domroes 11.1 86 Use that to install windows-build-tools by executing the command in an administrative powershell.
Soeren Domroes 1.1 87
88 {{code}}
89 npm install -g windows-build-tools
90 {{/code}}
91
Soeren Domroes 15.1 92 This installs make, gcc, g++, python and all this. Somehow this does not really terminate. If nothing happens anymore it may be finished, just kill the process if it does not terminate.
Soeren Domroes 1.1 93
Soeren Domroes 15.1 94 All the installed executables are not in the path and that is okay. This is not needed since yarn/npm knows how to call them when needed.
95
Soeren Domroes 14.1 96 Yarn can be downloaded and installed from [[here>>url:https://yarnpkg.com/lang/en/docs/install/#windows-stable||shape="rect"]].
97
Soeren Domroes 11.1 98 === Known Problems in this step ===
99
Soeren Domroes 15.1 100 If python3 was already installed this may cause some problems.
Soeren Domroes 11.1 101
Soeren Domroes 1.1 102 == ... on mac: ==
103
104 Get a package manager, something like [[brew>>url:https://brew.sh/index_de||shape="rect"]].
105
106 Use brew to install all necessary stuff.
107
108 Apparently there is an issue with xcode-select: [[Theia developers>>url:https://github.com/theia-ide/theia/blob/master/doc/Developing.md||shape="rect"]] recommend the following:
109
110 {{code}}
111 xcode-select --install
112 {{/code}}
113
Niklas Rentz 32.1 114 After doing this for your OS all that is missing is running KEITH (in developer setup) and setting up your Eclipse for language server development).
Soeren Domroes 1.1 115
Soeren Domroes 5.1 116 = Stuff that may help =
Soeren Domroes 1.1 117
Soeren Domroes 5.1 118 == Running the already build LS ==
Soeren Domroes 1.1 119
Soeren Domroes 5.1 120 Go to the latest [[Bamboo build>>url:https://rtsys.informatik.uni-kiel.de/bamboo/browse/KISEMA-NSI||shape="rect"]] and go to Artifacts.
Soeren Domroes 1.1 121
Soeren Domroes 5.1 122 [[image:attach:image2019-2-7_17-46-58.png]]
Soeren Domroes 1.1 123
Soeren Domroes 5.1 124 Select Language Server Zip and download the LS and unpack it somewhere.
125
126 Locate the kieler.ini file. Depending on the OS it has a different location (linux; toplevel, windows, toplevel, mac: Content/Eclipse/kieler.ini)
127
128 Paste the following at the beginning of the ini-file:
129
Soeren Domroes 1.1 130 {{code language="bash"}}
Soeren Domroes 5.1 131 -application
132 de.cau.cs.kieler.language.server.LanguageServer
133 -noSplash
Soeren Domroes 1.1 134 {{/code}}
135
Niklas Rentz 32.1 136 Since an Eclipse application is built, this is needed to start the LS without a splashscreen.
Soeren Domroes 1.1 137
Soeren Domroes 5.1 138 If you want to connect that LS via socket to your Theia application (KEITH) add the following to the vmargs:
Soeren Domroes 3.1 139
Soeren Domroes 5.1 140 {{code}}
141 -Dport=5007
142 {{/code}}
Soeren Domroes 1.1 143
Soeren Domroes 5.1 144 5007 is the standard port KEITH is currently connecting to in socket mode. You can find this port in your Theia application at the following location:
Soeren Domroes 1.1 145
Soeren Domroes 5.1 146 Assume you are in the [[keith >>url:https://git.rtsys.informatik.uni-kiel.de/projects/KIELER/repos/keith/browse||shape="rect"]]repository. Go to {{code language="none"}}keith-app{{/code}}, you should see something like this:
Soeren Domroes 1.1 147
Soeren Domroes 5.1 148 [[image:attach:image2019-2-7_17-58-22.png]]
Soeren Domroes 1.1 149
Soeren Domroes 5.1 150 Open the {{code language="none"}}package.json{{/code}}. In the{{code language="none"}} package.json{{/code}} are several scripts defined.
Soeren Domroes 3.1 151
Soeren Domroes 26.1 152 {{code language="js"}}
153 "scripts": {
154 "prepare": "yarn run clean && yarn build",
155 "clean": "theia clean",
156 "build": "theia build --mode development",
157 "start": "theia start --root-dir=../workspace",
158 "socket": "node ./src-gen/backend/main.js --root-dir=../workspace --LSP_PORT=5007 --port=3000 --loglevel=debug",
159 "watch": "theia build --watch --mode development"
160 },
161 {{/code}}
Soeren Domroes 1.1 162
Soeren Domroes 26.1 163 \\
164
Soeren Domroes 5.1 165 The {{code language="none"}}LSP_PORT{{/code}} option is used to activate the connection via socket. It is also possible to specify a relative location to a LS via {{code language="none"}}LS_PATH=<path to LS>{{/code}}.
Soeren Domroes 3.1 166
Soeren Domroes 5.1 167 == How run KEITH in developer setup (socket) ==
Soeren Domroes 3.1 168
Soeren Domroes 5.1 169 Run the following to build and run KEITH in its developer setup (in socket mode, so the LS has to be started separately)
Soeren Domroes 3.1 170
Soeren Domroes 26.1 171 === Running KEITH in the browser ===
172
173 \\
174
Soeren Domroes 5.1 175 {{code language="bash"}}
176 yarn && cd keith-app && yarn run socket
177 {{/code}}
178
Soeren Domroes 13.1 179 //yarn// builds all the stuff. //yarn run socket// in keith-app starts the application. After an initial build via yarn you can run //yarn watch // to watch the changes in your repository. In another console you run yarn run socket in keith-app. Now refreshing your browser is enough to apply the changes.
180
Soeren Domroes 5.1 181 Per default the KEITH opens on localhost:3000.
182
Soeren Domroes 26.1 183 {{info}}
Soeren Domroes 27.1 184 If you previously build keith electron, you have to execute {{code language="none"}}yarn run rebuild:browser{{/code}}
Soeren Domroes 26.1 185 {{/info}}
Soeren Domroes 7.1 186
Soeren Domroes 26.1 187 \\
188
189 === Running KEITH as (unbundled) electron app ===
190
191 {{code language="bash"}}
192 yarn && yarn run rebuild:electron && cd keith-app-electron && yarn run socket
193 {{/code}}
194
195 //yarn// builds all the stuff. //yarn run socket// in keith-app-electron starts the application. After an initial build via yarn you can run //yarn watch // to watch the changes in your repository. In another console you run yarn run socket in keith-app-electron. Now refreshing your browser is enough to apply the changes.
196
197 {{info}}
Soeren Domroes 27.1 198 If you previously build keith electron, you have to execute {{code language="none"}}yarn run rebuild:electron{{/code}}
Soeren Domroes 26.1 199 {{/info}}
200
Soeren Domroes 13.1 201 === Known issues for windows: ===
202
203 nsfw.code not found: In the top level package.json exists a script called postinstall. Remove this on windows, delete the node_modules folder and rebuilt the application. This is a known issue of electron-builder.
204
205 === Known issues on mac: ===
206
207 Since SWT is still used as part of the diagram synthesis (but is not relevant anymore). Since it is not called on the main thread this causes a deadlock. Therefore mac just does not work.
208
209 === Known issues: ===
210
Soeren Domroes 26.1 211 * KEITH works in the browser/electron app, but not in the electron app/browser with the following error message:(((
212 {{code language="none"}}symbol lookup error: ... symbol lookup error: .../keith/node_modules/nsfw/build/Release/nsfw.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE {{/code}}{{code language="none"}}Done in 0.90s.{{/code}}
Soeren Domroes 13.1 213
Soeren Domroes 26.1 214 * run
215
216 {{code language="none"}}
217 yarn run rebuild:electron/browser
Soeren Domroes 29.1 218 {{/code}} after yarn to fix this. If it does not work, delete the
219
220 {{code language="none"}}
221 node_modules
222 {{/code}} folder and try again (for browser version rebuild browser is not needed, since
223
224 {{code language="none"}}
225 yarn
226 {{/code}} already builds the correct sources).
Soeren Domroes 26.1 227 )))
228
Soeren Domroes 21.1 229 \\