Commit 53f9c261 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

software/theia: Fix shell bug

See merge request nexedi/slapos!951
parents 37237622 722179f0
Pipeline #14485 failed with stage
in 0 seconds
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[instance] [instance]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = ab61eeb45300a91c0c4fb42bd5c52c9f md5sum = a82e4fdc4efd60df699ee072399e6973
[yarn.lock] [yarn.lock]
filename = yarn.lock filename = yarn.lock
......
This diff is collapsed.
...@@ -78,7 +78,8 @@ for plugin_and_version in '''\ ...@@ -78,7 +78,8 @@ for plugin_and_version in '''\
EditorConfig/EditorConfig/latest EditorConfig/EditorConfig/latest
dbaeumer/vscode-eslint/latest dbaeumer/vscode-eslint/latest
ms-vscode/references-view/latest ms-vscode/references-view/latest
golang/Go/0.16.2 # golang.Go removed because it overwrites the PATH in theia shell
# golang/Go/0.16.2
vscjava/vscode-java-debug/0.29.0 vscjava/vscode-java-debug/0.29.0
redhat/java/0.61.0 redhat/java/0.61.0
vscjava/vscode-java-test/0.26.0 vscjava/vscode-java-test/0.26.0
......
...@@ -324,7 +324,7 @@ template = ...@@ -324,7 +324,7 @@ template =
export EDITOR="${python-language-server:location}/bin/python -m theia_open --wait" export EDITOR="${python-language-server:location}/bin/python -m theia_open --wait"
export THEIA_DEFAULT_PLUGINS="local-dir:${theia-plugins:location}" export THEIA_DEFAULT_PLUGINS="local-dir:${theia-plugins:location}"
. $${common-environment:rendered} . $${common-environment:rendered}
exec ${theia-wrapper:rendered} $@ exec ${theia-wrapper:rendered} "$@"
ip = $${theia-service-port:ip} ip = $${theia-service-port:ip}
port = $${theia-service-port:port} port = $${theia-service-port:port}
base-url = http://$${:ip}:$${:port}/ base-url = http://$${:ip}:$${:port}/
...@@ -346,16 +346,22 @@ recipe = slapos.recipe.template:jinja2 ...@@ -346,16 +346,22 @@ recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_} rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700 mode = 0700
template = inline: template = inline:
#!${python:location}/bin/python #!{{ bash }}
import os SHELL=$BASH
import sys
import time
args = sys.argv[1:]
# when running interactively, activate slapos configuration and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555 # when running interactively, activate slapos configuration and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
if not args: args = ["-c", ". $${slapos-standalone-activate:rendered} && exec env GIT_EXEC_PATH= ${bash:location}/bin/bash --rcfile $${theia-bashrc:rendered}", ] if [ $# = 0 ]; then
. {{ activate }}
unset GIT_EXEC_PATH
set -- --rcfile {{ bashrc }}
# otherwise, assume this shell is running task and add an artificial delay to workaround https://github.com/eclipse-theia/theia/issues/2961 # otherwise, assume this shell is running task and add an artificial delay to workaround https://github.com/eclipse-theia/theia/issues/2961
else: time.sleep(1) else
os.execv('${bash:location}/bin/bash', ['${bash:location}/bin/bash'] + args) sleep 1
fi
exec "$SHELL" "$@"
context =
raw bash ${bash:location}/bin/bash
key activate slapos-standalone-activate:rendered
key bashrc theia-bashrc:rendered
[theia-bashrc] [theia-bashrc]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
...@@ -396,9 +402,8 @@ computer-id = slaprunner ...@@ -396,9 +402,8 @@ computer-id = slaprunner
[slapos-standalone-activate] [slapos-standalone-activate]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_} rendered = $${directory:bin}/$${:_buildout_section_name_}
mode = 0700
template = template =
inline:#!/bin/sh inline:
export PATH=${buildout:bin-directory}:$PATH export PATH=${buildout:bin-directory}:$PATH
export SLAPOS_CONFIGURATION=$${slapos-standalone-config:slapos-configuration} export SLAPOS_CONFIGURATION=$${slapos-standalone-config:slapos-configuration}
export SLAPOS_CLIENT_CONFIGURATION=$SLAPOS_CONFIGURATION export SLAPOS_CLIENT_CONFIGURATION=$SLAPOS_CONFIGURATION
...@@ -411,6 +416,7 @@ mode = 0700 ...@@ -411,6 +416,7 @@ mode = 0700
template = template =
inline:#!/bin/sh inline:#!/bin/sh
. $${common-environment:rendered} . $${common-environment:rendered}
#XXX find out where the extra nodejs in theia's PATH comes from
export PATH=${nodejs:location}/bin/:$PATH export PATH=${nodejs:location}/bin/:$PATH
. $${slapos-standalone-activate:rendered} . $${slapos-standalone-activate:rendered}
exec ${slapos-standalone:script-path} \ exec ${slapos-standalone:script-path} \
......
...@@ -310,7 +310,7 @@ template = ...@@ -310,7 +310,7 @@ template =
inline: inline:
#!/bin/sh #!/bin/sh
cd ${theia:location} cd ${theia:location}
exec ${yarn:location}/bin/yarn theia start $@ exec ${yarn:location}/bin/yarn theia start "$@"
[instance] [instance]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment