lem-project / lem

Common Lisp editor/IDE with high expansibility
http://lem-project.github.io/
MIT License
2.21k stars 163 forks source link

install script fails in Ubuntu 22 #1299

Closed louis77 closed 1 month ago

louis77 commented 6 months ago

Running distro based on Ubuntu 22.04, the install script fails SBCL version is 2.1.11.debian.

$ curl -L https://lem-project.github.io/linux_installer.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   293  100   293    0     0   3149      0 --:--:-- --:--:-- --:--:--  3184
--2024-02-16 22:03:45--  https://lem-project.github.io/linux-installer.lisp
Auflösen des Hostnamens lem-project.github.io (lem-project.github.io) … 2606:50c0:8000::153, 2606:50c0:8002::153, 2606:50c0:8001::153, ...
Verbindungsaufbau zu lem-project.github.io (lem-project.github.io)|2606:50c0:8000::153|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 2584 (2.5K) [application/octet-stream]
Wird in ‘linux-installer.lisp.1’ gespeichert.

linux-installer.lisp.1                        100%[=================================================================================================>]   2.52K  --.-KB/s    in 0s      

2024-02-16 22:03:45 (24.7 MB/s) - ‘linux-installer.lisp.1’ gespeichert [2584/2584]

While evaluating the form starting at line 73, column 0
  of #P"/tmp/linux-installer.lisp":
Unhandled SB-KERNEL:CASE-FAILURE in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                              {1001834103}>:
  NIL fell through ECASE expression. Wanted one of (:DEBIAN :ARCH).

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1001834103}>
0: ((LAMBDA NIL :IN "/tmp/linux-installer.lisp"))
1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ECASE (MEMBER-OF *OS-NAME*) (:DEBIAN (TITLE "Installing dependencies...") (UIOP/RUN-PROGRAM:RUN-PROGRAM "sudo apt install -y curl git sbcl libncurses5-dev build-essential" :OUTPUT :INTERACTIVE) (DOT-LINE) (INSTALLING-QLOT) (MAKE-LEM)) (:ARCH)) #<NULL-LEXENV>)
2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (IF (UIOP/OS:GETENV "SUDO_USER") (ECASE (MEMBER-OF *OS-NAME*) (:DEBIAN (TITLE "Installing dependencies...") (UIOP/RUN-PROGRAM:RUN-PROGRAM "sudo apt install -y curl git sbcl libncurses5-dev build-essential" :OUTPUT :INTERACTIVE) (DOT-LINE) (INSTALLING-QLOT) (MAKE-LEM)) (:ARCH)) (FORMAT T "This file need to be run as sudo! ~%")) #<NULL-LEXENV>)
3: (EVAL-TLF (IF (UIOP/OS:GETENV "SUDO_USER") (ECASE (MEMBER-OF *OS-NAME*) (:DEBIAN (TITLE "Installing dependencies...") (UIOP/RUN-PROGRAM:RUN-PROGRAM "sudo apt install -y curl git sbcl libncurses5-dev build-essential" :OUTPUT :INTERACTIVE) (DOT-LINE) (INSTALLING-QLOT) (MAKE-LEM)) (:ARCH)) (FORMAT T "This file need to be run as sudo! ~%")) 10 NIL)
4: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (IF (UIOP/OS:GETENV "SUDO_USER") (ECASE (MEMBER-OF *OS-NAME*) (:DEBIAN (TITLE "Installing dependencies...") (UIOP/RUN-PROGRAM:RUN-PROGRAM "sudo apt install -y curl git sbcl libncurses5-dev build-essential" :OUTPUT :INTERACTIVE) (DOT-LINE) (INSTALLING-QLOT) (MAKE-LEM)) (:ARCH)) (FORMAT T "This file need to be run as sudo! ~%")) 10)
5: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (IF (UIOP/OS:GETENV "SUDO_USER") (ECASE (MEMBER-OF *OS-NAME*) (:DEBIAN (TITLE "Installing dependencies...") (UIOP/RUN-PROGRAM:RUN-PROGRAM "sudo apt install -y curl git sbcl libncurses5-dev build-essential" :OUTPUT :INTERACTIVE) (DOT-LINE) (INSTALLING-QLOT) (MAKE-LEM)) (:ARCH)) (FORMAT T "This file need to be run as sudo! ~%")) :CURRENT-INDEX 10)
6: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {100183679B}> #<SB-C::SOURCE-INFO {1001836763}> SB-C::INPUT-ERROR-IN-LOAD)
7: (SB-INT:LOAD-AS-SOURCE #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/linux-installer.lisp" {10009BF103}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
8: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/linux-installer.lisp" {10009BF103}> NIL)
9: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {757403B2F95B}> #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/linux-installer.lisp" {10009BF103}> NIL #<SB-INT:FORM-TRACKING-STREAM for "file /tmp/linux-installer.lisp" {10009BF103}>)
10: (LOAD #P"/tmp/linux-installer.lisp" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
11: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:LOAD . "/tmp/linux-installer.lisp") (:EVAL . "(exit)") (:QUIT)))
12: (SB-IMPL::TOPLEVEL-INIT)
13: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
14: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
15: (SB-IMPL::START-LISP)

unhandled condition in --disable-debugger mode, quitting
louis77 commented 6 months ago

Did a little more research on this. Obviously, the install script tries to parse the /etc/os-release file and look for the value of the ID field.

This is my config:

$ cat /etc/os-release
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"

Obviously the value "pop" then fails in the MEMBER-OF function.

I think it would be better to parse the ID_LIKE fields instead which contains the distro name the current is based on.

From man os-release:

   ID_LIKE=
       A space-separated list of operating system identifiers in the same syntax as the ID= setting. It should list identifiers of operating systems that are closely related
       to the local operating system in regards to packaging and programming interfaces, ...
garlic0x1 commented 6 months ago

I am not familiar with this install script, but it probably just needs to treat Ubuntu the same as Debian. @Sasanidas I think made the script and should add this.

Can you try installing it this way for now?

# Install Qlot
curl -L https://qlot.tech/installer | sh

# Clone Lem
git clone https://github.com/lem-project/lem.git
cd lem

# Build Lem
make sdl2

# Install to $PATH
cp ./lem /usr/bin/lem

# Run Lem
lem

Replace sdl2 with ncurses if you want a terminal interface.

You may also see dependency errors when building, if you have any trouble figuring those out post the errors here and we can help you.

garlic0x1 commented 6 months ago

Assuming you have GCC and the normal tools already installed, I think the only other dependencies you might need are either ncurses-devel or sdl2-devel or whatever the packages with headers are named in the Ubuntu repos.

vcg3rd commented 6 months ago

I arrived here with the same problem, knowing the script must not be recognizing I am using a Debian based distro (Kaisen-Linux). Thanks to the OP I knew where to look. If one has sudo privileges, it is as simple as editing /etc/os-release to id=debian, rerunning the script, and then changing it back (it you want.) No need to build from source.

Sasanidas commented 1 month ago

Indeed https://github.com/lem-project/lem/issues/1299#issuecomment-1949361495 this appear to be the problem, I would like to know if there's a simpler version to check the distro name :+1:

Sorry about the inconvenience