-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible launch.sh for Almquist Shell (default on Alpine) #981
Comments
So far only zsh and bash shells are supported (fish shell support is coming up). I don't have knowledge of ash nor resources to support it.
Please send a PR. Splitting is probably a good idea and fish script is already extracted |
Done - i have the feeling that the handling of Let me know what you think. |
I found and commented on a related issue over at elixir-lsp/vscode-elixir-ls#374. I installed my entire Elixir & Erlang environment fresh as of yesterday. There is something moderately weird going on that I haven't figured out yet. If we try to run under |
Thanks a lot @emk - i guess the shell detection is not very robust since it relys on the existence and correctness of the It would probably be more robust stick with a process-based approach here, f.e.:
This would be also a good point to add smoke tests for different shells (see #987). |
@florianb It's weirder than that, because first the script does: preferred_shell=$(basename "$SHELL") Then it does the following twice: if [ "$preferred_shell" = "bash" ]; then
So either someone has clobbered Anyway, VS Code users can work around it by changing the first line to |
@emk thanks a lot - i didn't dabble a lot with fish. I guess (sorry i didn't make that clear in my previous post) that the I don't actually know why there's a relaunch at all, but probably it has something to do with preserving the current users environment and having the elixir-ls polluting a dedicated one. However, because of the wrongly set You also state in the referenced issue that the launch script prints:
If that's the case we also have an issue with the variable substitution. Con you verify the contents of your I think about a way to make the launch-procedure more robust in general. |
Version 0.17.0 with support for fish and fixes for other shells has been released |
Running into the exact same problem with version elixir_ls 0.18 in launch.sh Running FreeBSD 13.2 with fish, version 3.6.1. Changing the script to use /usr/local/bin/bash instead of bourne shell solves the problem for me. Is there a commit related to this issue that I can look at? |
@drobban commit history of scripts directory? |
Took a look again. I now noticed the code change - thanks and awesome! Just so weird, trying to figure out how the old version of the scripts ended up on my system. |
Precheck
Environment
Current behavior
After the update to 0.16.0 the ElixirLS server fails to start:
See the reproduction steps at the end of the issue.
Expected behavior
I'd expect the LS just starts without errors.
Cause for the problem?
The startup of the LS is interrupted by the syntax error thrown by ash.
I assume (i was not able to verify that behaviour) that the ash-parser starts parsing the final if-statement of the
launch.sh
it then stumbles over the bash redirection<<<
in line 102 which is parsed as subsequent redirection due to missing support in ash (see this SO post).Possible solution
I think the safest (in the awareness that there might be n other shells using different parsers) way to handle this is either move shell specific commands into dedicated shell-files. I immediately ran into the next syntax error (for the zsh section).
I would have offered a quick fix but splitting up into different files might touch objections.. 🙂
I use Docker to work with the ElixirLS, i tried to condense our Dockerfile:
Building & Starting the container using
Launching the LS in the container
Steps to reproduce
The text was updated successfully, but these errors were encountered: