Open Rconybea opened 2 years ago
I'm experiencing a similar issue on latest Ubuntu LTS, wrt to installing clangd.
It fails to install, and then when it has failed, it tries again and repeats and repeats until aborted.
jostein@dev-jostein:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
I'm seeing the following error in emacs when lsp-mode tries to install clangd:
The argument 'Expand-Archive' is not recognized as the name of a script file. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Usage: pwsh[.exe] [-Login] [[-File] <filePath> [args]]
[-Command { - | <script-block> [-args <arg-array>]
| <string> [<CommandParameters>] } ]
[-ConfigurationName <string>] [-ConfigurationFile <filePath>]
[-CustomPipeName <string>] [-EncodedCommand <Base64EncodedCommand>]
[-ExecutionPolicy <ExecutionPolicy>] [-InputFormat {Text | XML}]
[-Interactive] [-MTA] [-NoExit] [-NoLogo] [-NonInteractive] [-NoProfile]
[-NoProfileLoadTime] [-OutputFormat {Text | XML}]
[-SettingsFile <filePath>] [-SSHServerMode] [-STA]
[-Version] [-WindowStyle <style>]
[-WorkingDirectory <directoryPath>]
pwsh[.exe] -h | -Help | -? | /?
PowerShell Online Help https://aka.ms/powershell-docs
All parameters are case-insensitive.
Checking Expand-Archive
interactively in powershell, it works:
jostein@dev-jostein:~$ powershell --version
PowerShell 7.3.0
jostein@dev-jostein:~$ pwsh
PowerShell 7.3.0
PS /home/jostein> Expand-Archive
cmdlet Expand-Archive at command pipeline position 1
Supply values for the following parameters:
Path:
So even if we are using PowerShell, this should work.
But... uh why is PowerShell preferred over plain, native unzip
when on Linux? I do have unzip installed! Honestly! :smile:
jostein@dev-jostein:~$ which unzip
/usr/bin/unzip
Thank you for the bug report
lsp-mode
related packages.M-x lsp-start-plain
Bug description
If host cannot run language server (bad config / can't run executable), errors may be swallowed instead of being reported to lsp-log.
Background:
/lib
,/lib64
,/usr/lib
etc as givenwith minimal lsp install:
Attempting
M-x lsp
would loop forever:clangd
:github.com:443
...)~/.emacs.d/.cache/lsp/clangd_13.0.0/bin/clangd
Note that the lsp-log
Steps to reproduce
lsp-clients-clangd-args
:(setq lsp-clients-clangd-args "--header-insertion-decorators=0") ;; <--- should have been a list
M-x lsp
in a.cpp
bufferExpected behavior
error on modeline or
*lsp-log*
:Wrong type argument: listp, "--header-insertion-decorators=0"
orunable to execute: /path/to/clangd, error: ...
Which Language Server did you use?
lsp-clangd
OS
Linux
Error callstack
Anything else?
I believe the error-swallowing code is here (from
lsp_mode.el
):In my case the original problem was triggered by downloaded
clangd
failing to run because it expectslibc.so.6
to have symbolGLIBC_2.18
. After I managed to diagnose this, tried fixing the config by pointing at differentclangd
executable (for example on my host/usr/bin/clangd
runs without incident). Unfortunately I'd produced a malformed config withwhich causes the same infinite-loop symptom.
Can demonstrate with elisp in scratch buffer like:
if problem caused by bad config, then maybe:
without enclosing
condition-case
gives useful error like "do-seq: Wrong type argument: listp, ..." however afaict if problem caused by not being able to runclangd
executable at all, I don't see error being reported anywhere.Suggest it would be helpful to:
*lsp-log*
earlier, before attempting(lsp--server-binary-present?)
(lsp--server-binary-present?)
to*lsp-log*