Open fapdash opened 1 year ago
This error might mean that the package was unable to successfully set the language server binary as executable. O
Can you try executing the file?
~/.emacs.d/codeium/codeium_language_server
I don't know how it happens but somehow Emacs botches the language server file. The file exists but bash also claims that there is no such file when I tell it to execute the file. Permissions are set correctly.
File downloaded by Emacs:
$ ~/.emacs.d/codeium/codeium_language_server
bash: /home/fap/.emacs.d/codeium/codeium_language_server: No such file or directory
$ file ~/.emacs.d/codeium/codeium_language_server
/home/fap/.emacs.d/codeium/codeium_language_server: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, interpreter /ld-linux-x86-64.so.2, missing section headers
~$ ls -lh ~/.emacs.d/codeium/codeium_language_server
-rwxr--r-- 1 fap fap 50M Feb 21 10:20 /home/fap/.emacs.d/codeium/codeium_language_server
Manually downloaded language server file:
$ ls -lh language_server_linux_x64
-rwxrwxr-x 1 fap fap 51M Feb 22 10:53 language_server_linux_x64
$ file language_server_linux_x64
language_server_linux_x64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, Go BuildID=redacted, BuildID[md5/uuid]=2d79362e1058d0c0a41609019c05f0f9, stripped
After replacing the language server file with the file I manually downloaded the problem went away.
So what is causing this / which step is failing? It looks like the downloaded file is corrupt.
I modified the codeium.el code to remove the decompression step:
(defun codeium-install-process-url-res (state url url-buf filename)
(make-directory (file-name-directory filename) t)
(with-temp-file filename
(set-buffer-multibyte nil)
(url-insert-buffer-contents url-buf url))
(chmod filename #o744)
(kill-buffer url-buf)
(message "successfully installed codeium local language server"))
$ file language_server_linux_x64.gz
language_server_linux_x64.gz: gzip compressed data, was "language_server_linux_x64", last modified: Thu Feb 16 23:23:24 2023, max compression, from Unix, original size modulo 2^32 52498072
Decompression with gzip works fine for this file.
$ file codeium_language_server
codeium_language_server: gzip compressed data, was "language_server_linux_x64", last modified: Sat Feb 11 02:29:49 2023, max compression, from Unix, original size modulo 2^32 51448632
$ mv codeium_language_server codeium_language_server.gz
$ gzip -d codeium_language_server.gz
gzip: codeium_language_server.gz: invalid compressed data--format violated
Is this fetched from the same version? (at the url of codeium-download-url
)
This somehow doesn't load codeium, I had to explicitly require it:
This has to do with :defer
of use-package
, basically it only loads a fake function (an autoload) for the entrypoints, the fake function will load the library and run the function. I should probably remove it from readme
Is this fetched from the same version? (at the url of
codeium-download-url
)
Yes, the file is downloaded from https://github.com/Exafunction/codeium/releases/download/language-server-v1.1.38/language_server_linux_x64.gz and codeium-download-url
is set to the same url.
Is this a one-time issue where the download just got interrupted or does this happen every time? (For example if you deleted the language server binary and retried M-x codeium-install
?
Try url-insert
instead of url-insert-buffer-contents
and bind file-name-handler-alist
to nil
around the with-temp-file
?
This is my config:
This somehow doesn't load codeium, I had to explicitly require it:
Afterwards I ran
M-x codeium-init
andM-x codeium-install
. I never was asked for an API key or was redirected to a URL. I don't get any completions anymore. Editing a file is incredibly slow, my input is delayed very noticeably.This error gets printed into
*codeium-log*
several times per second:But the file exists:
Output of
codeium-diagnose
:Emacs Version:
Let me know if you need any other information.