1

I'm trying to build an executable with ECL. I looked at the doc and this other SO question, where we learn that with ECL v <= 16.1.3 we must add a

(require 'adsf)

Then I push my project to the asdf registry:

(pushnew "~/projects/my-project/" asdf:*central-registry* :test #'equal)

I load it:

(load "my-project.asd")

My program obviously has Quicklisp dependencies.

I copied the initialization of Quicklisp from my .sbclrc to ~/.eclrc:

#-quicklisp
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
                                       (user-homedir-pathname))))
  (when (probe-file quicklisp-init)
    (load quicklisp-init)))

So than I can Quickload my project: (this step does not appear in the doc but this allows to find the project dependencies)

(ql:quickload "my-project")

I also

(use-package :my-project)

but now, as I want to build the executable with

(asdf:make-build :my-project
                 :type :program
                 :move-here #P"./"
                 :epilogue-code '(progn (my-project:main)
                                        (si:exit)))

I get the error

Cannot find the external symbol MAKE-BUILD in #<"ASDF/INTERFACE" package>.

Can someone help ? Thanks !

ECL 16.1.3

ps: and it seems that, in the REPL, to enter a restart nb has no effect.


My makefile:

ecl-build:
    ~/.roswell/impls/x86-64/linux/ecl/16.1.3/bin/ecl \
        --eval "(require 'asdf)" \
        --eval '(format t "--- ASDF version: ~a~&" (asdf:asdf-version))' \

        --eval "(pushnew \"~/projets/cl-torrents/\" asdf:*central-registry* :test 'equal)" \
        --eval '(load "cl-torrents.asd")' \
        --eval '(asdf:make-build :cl-torrents :type :program :move-here #P"./" :epilogue-code "(progn (torrents "matrix") (si:exit))")'

Result:

;;; Loading "/home/vince/quicklisp/setup.lisp"
;;; Loading #P"/home/vince/.roswell/impls/x86-64/linux/ecl/16.1.3/lib/ecl-16.1.3/asdf.fas"
--- ASDF version: 3.2.1
An error occurred during initialization:
Cannot find the external symbol MAKE-BUILD in #<"ASDF/INTERFACE" package>..
Makefile:22: recipe for target 'ecl-build' failed
make: *** [ecl-build] Error 1

edit 27, oct - progress

The simplest path now seems to unsure to use ASDF bundled into ECL, which will have the make-build command.

I had a newer ASDF version because of my Quicklisp's initialization code into ~/.eclrc. I removed it and now I have ASDF v3.1.8.2, which is ok. But now, ECL doesn't know any dependencies:

Component :DEXADOR not found, required by #.

Indeed, because there is no Quicklisp any more.

ECL doc says to include all libraries path into asdf:*central-registry*. By chance, Quicklisp installed all libraries into ~/quicklisp/dists/quicklisp/software/.

First, I wonder how this will work in a CI pipeline where Quicklisp has not run before…

Then I see that adding only this directory is not enough, Dexador's dependencies will in turn not be found, I had to add dexador's directory precisely:

    --eval "(pushnew \"~/quicklisp/dists/quicklisp/software/dexador-20170830-git/\" asdf:*central-registry* :test 'equal)" \

So do I really have to write code to include every directory here ?

How to make this work when Quicklisp has not run once before ?

update: With Ecl installed with Roswell: requireing asdf before everything in my .eclrc gives the version 3.1.8.2, after Quicklisp initialization 3.2.1 and make-build symbol unknown.

With Debian's Ecl: first v2.33.10 and then v3.2.1 likewise.

Looks like a dead end.

update november: I waited for the release of ASDF 3.3.0 to manually update. It was buggy. Message on the mailing list: waiting for 3.3.1: buggy again.

Went with the lisp-devel Docker image, shipping ECL 16.1.3. (I don't want to compile ECL myself on each and every VPS). I could build an executable (52Mo in weight), but got a runtime error:

Condition of type: SIMPLE-ERROR Package ((UIOP/STREAM . #)) referenced in > compiled file NIL but has not been created

Ehvince
  • 17,274
  • 7
  • 58
  • 79

3 Answers3

2

It seems a problem with comtibility with ASDF and ECL this is solved in last commit take a look here,

Add back make-build on ECL

This provides for backward compatibility with ECL, whose current maintainer Daniel K. has decided to keep supporting the make-build interface and has forked ASDF for that.

you can install/use the last ASDF from this repo

anquegi
  • 11,125
  • 4
  • 51
  • 67
  • Thanks. I cloned asdf into `~/.local/share/common-lisp/source/asdf/`, ran `make` as says its readme, and I still have the same message. Do I miss a step ? How to specifically use the new asdf ? (I uptated my question to show my makefile) I added `(pushnew "~/.local/share/common-lisp/source/asdf/" asdf:*central-registry* :test 'equal)` into my .eclrc with no success. – Ehvince Oct 04 '17 at 16:27
  • 1
    This feature is back in [ASDF 3.3.0](https://github.com/fare/asdf/releases/tag/3.3.0), release a few days later. – Ehvince Oct 19 '17 at 22:41
1

You may use either bundled ASDF (which is a frozen 3.1.7 version with some fixes backported) – then you load ASDF with (require asdf), or you may use upstream 3.3 version.

If you are interested in using upstream ASDF, download asdf.lisp file and call: (load (compile-file "/path/to/asdf.lisp")) instead of (require 'asdf).

  • This seems doable but I'm not there just yet… How can I use the bundled asdf ? This seems like the most solid solution. I see it in `contrib/asdf/asdf.lisp` in ECL's repository. In the contrary I don't see an `asdf.lisp` file on ASDF's repository, only `tools/[load,install]-asdf.lisp`. – Ehvince Oct 19 '17 at 23:02
  • To use bundled ASDF it is enough to type (require 'asdf) in your REPL or file. Note, that this is what Quicklisp does by default, so if you have quicklisp, you already have bundled ASDF. – Daniel Kochmański Oct 21 '17 at 07:07
  • Really ? I do this since the beginning because it's explained in ECL's doc, but `(asdf:asdf-version)` still is 3.2.1 instead of 3.1.7. I slightly edited my Makefile target to show the version. – Ehvince Oct 21 '17 at 17:10
  • you may verify, that in contrib/asdf/asdf.lisp tehre is version from 3.1.x branch. it is installed in dest_dir/lib/ecl-x.x.x/ and ECL should pick it first unless you load ASDF from some other location. Are you sure you use ECL from it's project homepage (i.e something what is not patched)? – Daniel Kochmański Oct 22 '17 at 14:01
  • I got it, the newer ASDF version was given by Quicklisp, that I initialized in my `~/.eclrc` in order to build dependencies. Because now, how to load *all* of them ? I can `(pushnew \"~/quicklisp/dists/quicklisp/software/\" asdf:*central-registry* :test 'equal)` but it doesn't find libraries, we must be more precise like this: `(pushnew \"~/quicklisp/dists/quicklisp/software/dexador-20170830-git/\" asdf:*central-registry* :test 'equal)`, but this in turn doesn't find Dexador's deps. Do we have to write custom code or is there a better way ? Largely edited my question. Mind to have a look ? – Ehvince Oct 27 '17 at 21:13
  • It is not Quicklisp fault but Roswell customizations I think. QL doesn't update ASDF automatically unless it is older than 2.x.something afair. You may try to put (require 'asdf) in your .eclrc *before* anything else. Then loading Quicklisp shouldn't replace it. – Daniel Kochmański Oct 29 '17 at 07:22
  • Same result with Debian's Ecl (13.5.1), with a `require 'asdf` as the first line in `.eclrc` before QL init: I get ASDF v2.33.10, and after QL init v3.2.1. Looks like this is a dead end and that I should look at how to install the newest ASDF (which I tried without success once). – Ehvince Nov 06 '17 at 17:33
  • Current ECL version is 16.1.3. Please try it. – Daniel Kochmański Nov 07 '17 at 19:55
1

I Went with the lisp-devel Docker image, shipping ECL 16.1.3. (I don't want to compile ECL myself on each and every VPS). I could build an executable (52Mo in weight VS 78Mo with SBCL), so I was able to deliver it with Gitlab CI.

For reference, to launch Docker and mount your sources:

service docker start
docker run --rm -it -v /home/you/projets/project:/usr/local/share/common-lisp/source  daewok/lisp-devel:latest bash

Unfortunately I got a runtime error:

Condition of type: SIMPLE-ERROR Package ((UIOP/STREAM . #)) referenced in > compiled file NIL but has not been created

It also seems I had to ql:quickload :closer-mop manually before loading my app.

I won't investigate this.

Ehvince
  • 17,274
  • 7
  • 58
  • 79