cl-cookbook icon indicating copy to clipboard operation
cl-cookbook copied to clipboard

Issue building executables

Open contrapunctus-1 opened this issue 4 years ago • 2 comments

The instructions on https://lispcookbook.github.io/cl-cookbook/scripting.html use sbcl --load file.asd ... on at least two occasions. When I tried that, I got warnings and errors which implied that ASDF wasn't loaded, e.g. an error saying that ((:file "src/foo")) (the value of :components) is an illegal function call, and an error saying that defsystem is an undefined function.

To make it work, I had to add --eval "(progn (require :asdf) (in-package :asdf-user))" before the --load. Could anyone recommend a better solution? If there isn't one, should I make a PR correcting these commands?

contrapunctus-1 avatar Dec 24 '20 11:12 contrapunctus-1

and the recipe doesn't show the .asd content, so that leads to issues.

I reckon I got used to add (require "asdf") at the top of my .asd and I also write (asdf:defsystem (and not defsystem alone). How's your .asd ?

Clarifications and checking best practices will be welcome.

vindarel avatar Dec 24 '20 12:12 vindarel

AFAIR when you try to load an ASD file, then the prerequisites are that:

  1. ASDF must be already loaded,
  2. the current package is either asdf-user or any other package that uses both cl and asdf.

In other words, all ASD files are supposed to be loaded from a package that uses asdf - therefore (asdf:defsystem ...) and toplevel (require "asdf") are both superfluous.

phoe avatar Dec 24 '20 12:12 phoe