From 062fb6f66ebed857c1d7c3636410557803f35fbf Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 6 Aug 2024 12:02:16 -0500 Subject: [PATCH] common-lisp: fix build with sbcl 2.0.1.debian 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. --- impls/common-lisp/Dockerfile | 2 +- impls/common-lisp/Makefile | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/impls/common-lisp/Dockerfile b/impls/common-lisp/Dockerfile index 549a96227c..36019b78b4 100644 --- a/impls/common-lisp/Dockerfile +++ b/impls/common-lisp/Dockerfile @@ -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 && \ diff --git a/impls/common-lisp/Makefile b/impls/common-lisp/Makefile index 7572f4f878..cdcf59f63a 100644 --- a/impls/common-lisp/Makefile +++ b/impls/common-lisp/Makefile @@ -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 @@ -28,7 +31,7 @@ $(foreach step, $(call steps), $(call record_lisp,$(patsubst step%,%,$(step)),$( .PRECIOUS: hist/%_impl -all : stepA_mal +all : $(BINS) hist/%_impl: ; @@ -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 $@