Skip to content

Commit

Permalink
common-lisp: fix build with sbcl 2.0.1.debian
Browse files Browse the repository at this point in the history
The update from ubuntu:vivid to ubuntu:20.04 update the version of sbcl
from 1.2.4.debian to 2.0.1.debian. This resulted in the cl-launch based
build process no longer working: dependencies were not resolved (but
running it several times would eventually resolve them. So use an sbcl
build command directly when building for sbcl.

Note: updating the image to ubuntu:24.04 upgrades the version of sbcl to
2.2.9.debian. Something about that version breaks how we do hash-maps.
They become temperamental: hash-map creation often results in a nil
object returned and doing (get hm key) usually results in nil returned
even if the key shows as being present.
  • Loading branch information
kanaka committed Aug 6, 2024
1 parent 448d26a commit 062fb6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion impls/common-lisp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN apt-get -y install curl git libreadline-dev libedit-dev
RUN apt-get -y install sbcl

# Install cl-asdf (CLISP does not seem to come with it)
RUN apt-get -y install cl-launch cl-asdf
RUN apt-get -y install cl-launch cl-asdf cl-ppcre

RUN cd /tmp && \
git clone https://gitlab.common-lisp.net/xcvb/cl-launch.git && \
Expand Down
7 changes: 5 additions & 2 deletions impls/common-lisp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ LISP ?= sbcl
ABCL ?= abcl
MKCL ?= mkcl

BINS = step0_repl step1_read_print step2_eval step3_env step4_if_fn_do \
step5_tco step6_file step7_quote step8_macros step9_try stepA_mal

# TODO: In theory cl-launch should be able to build standalone executable using
# MKCL unfortunately the executable crashes on startup
STANDALONE_EXE = sbcl clisp ccl ecl cmucl
Expand All @@ -28,7 +31,7 @@ $(foreach step, $(call steps), $(call record_lisp,$(patsubst step%,%,$(step)),$(

.PRECIOUS: hist/%_impl

all : stepA_mal
all : $(BINS)

hist/%_impl: ;

Expand All @@ -47,7 +50,7 @@ ifeq ($(LISP),clisp)
endif

ifneq ($(filter $(LISP),$(STANDALONE_EXE)),)
cl-launch --wrap 'if [ -z "$$CL_LAUNCH_VERSION" ] ; then cd "$$(dirname $$CL_LAUNCH_FILE)" ; fi' --verbose --lisp $(LISP) --source-registry $(ROOT_DIR) --system $@ --dump '!' -o $@ --entry 'mal:main'
sbcl --eval '(load "~/quicklisp/setup.lisp")' --eval '(asdf:initialize-source-registry `(:source-registry (:tree "$(ROOT_DIR)") :inherit-configuration))' --eval '(ql:quickload :uiop)' --eval '(ql:quickload :cl-readline)' --eval '(ql:quickload :genhash)' --eval '(asdf:load-system "$@")' --eval '(asdf:operate :build-op "$@")' --eval "(save-lisp-and-die \"$@\" :executable t :toplevel #'(lambda () (mal:main)))" --quit
else ifeq ($(LISP),abcl)
echo -n '#!/bin/sh\ncd `dirname $$0` ; $(ABCL) --noinform --noinit --nosystem --load run-abcl.lisp -- $@ $$@' > $@
chmod +x $@
Expand Down

0 comments on commit 062fb6f

Please sign in to comment.