From: jakemiles
Subject: asdf woes: asdf:missing-dependency
Date: 
Message-ID: <1164320469.657823.179920@j72g2000cwa.googlegroups.com>
Hi all.  I'm trying to get asdf working and I'm having trouble.  If
anyone could help I'd appreciate it.

The problem is that asdf complains that my :depends-on component
doesn't exist.

I have a packages.lisp and a deftest.lisp, which uses one of the
functions in packages.lisp.  I have both files in a directory
/Users/jake/Library/lisp/util.  I have an asdf central registry set up,
and I've created symlinks in that directory pointing to deftest.asd and
packages.asd.  I'm able to load the "packages" component just fine
through asdf.

deftest.asd looks like this:
;;;;
(in-package :cl-user)

(defpackage :deftest-asd
  (:use :cl :asdf))

(in-package :deftest-asd)

(defsystem "deftest"
  :components ((:file "deftest" :depends-on ("packages"))))
;;;;

packages.asd looks like this:
;;;;
(in-package :cl-user)

(defpackage :packages-asd
  (:use :cl :asdf))

(in-package :packages-asd)

(defsystem "packages"
  :components ((:file "packages")))
;;;;

My .cmucl-init.lisp looks like this: (I'm running cmucl through SLIME):

(load "/Users/jake/Library/lisp/asdf/asdf.lisp")

(setf asdf:*central-registry*
  '(#p"/Users/jake/Library/lisp/asdf-central-registry/"))

(defun asdf-load (system)
  (asdf:operate 'asdf:load-op system))

In /Users/jake/Library/lisp/asdf-central-registry, I have the following
symlinks:

packages.asd -> /Users/jake/Library/lisp/util/packages.asd
deftest.asd -> /Users/jake/Library/lisp/util/deftest.asd

When I say (asdf-load "packages"), I get the following output, which I
believe means it loaded it successfully:

; loading system definition from
; /Users/jake/Library/lisp/asdf-central-registry/packages.asd into
; #<The ASDF0 package>
; Loading #P"/Users/jake/Library/lisp/util/packages.asd".
; registering #<SYSTEM "packages" {60D19B35}> as packages

; Python version 1.1, VM version PowerPC on 23 NOV 06 04:57:13 pm.
; Compiling: /Users/jake/Library/lisp/util/packages.lisp 22 NOV 06
11:56:07 pm

; Converted PACKAGE-SYMBOLS.
; Compiling DEFUN PACKAGE-SYMBOLS:
; Converted PACKAGE-SYMBOL-ACCESS-PAIRS.
; Compiling DEFUN PACKAGE-SYMBOL-ACCESS-PAIRS:
; Converted ALL-PACKAGE-SYMBOL-ACCESS-PAIRS.
; Compiling DEFUN ALL-PACKAGE-SYMBOL-ACCESS-PAIRS:
; Byte Compiling Top-Level Form:

; /Users/jake/Library/lisp/util/packages.ppcf written.
; Compilation finished in 0:00:01.
; Loading #P"/Users/jake/Library/lisp/util/packages.ppcf".


But when I say (asdf-load "deftest"), I get the following in the
debugger:

component "packages" not found, required by
#<CL-SOURCE-FILE "deftest" {60007145}>
   [Condition of type ASDF:MISSING-DEPENDENCY]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [ABORT] Return to Top-Level.

Backtrace:
  0: ((PCL:FAST-METHOD ASDF::TRAVERSE (ASDF:OPERATION ASDF:COMPONENT))
(#(3 5 9 10) . #(# # # # #)) #<unused-arg> #<ASDF:COMPILE-OP NIL
{60F6C3DD}> #<ASDF:SYSTEM "deftest" {6000672D}>)
  1: ((LABELS ASDF::DO-DEP (PCL:FAST-METHOD ASDF::TRAVERSE #))
ASDF:COMPILE-OP ("deftest"))
  2: ((PCL:FAST-METHOD ASDF::TRAVERSE (ASDF:OPERATION ASDF:COMPONENT))
(#(3 5 9 10) . #(# # # # #)) #<unused-arg> #<ASDF:LOAD-OP NIL
{60F6965D}> #<ASDF:SYSTEM "deftest" {6000672D}>)
  3: (ASDF:OPERATE ASDF:LOAD-OP "deftest")[:OPTIONAL]
  4: (SWANK::EVAL-REGION "(asdf-load \"deftest\")

Does anyone see what I'm doing wrong?  And hey, thanks for reading this
entire post.

- Jake

P.S: Yes, deftest was originally the deftest in Practical Common Lisp,
which I've expanded a bit.  The functionality using packages.lisp lets
me just say (run-test-package :foo-test) to run all the tests in the
foo package and report the number of passed and failed tests.  Very
handy.  Now I'd just like to get everything loading easily with asdf.

From: Zach Beane
Subject: Re: asdf woes: asdf:missing-dependency
Date: 
Message-ID: <m3hcwpegp3.fsf@unnamed.xach.com>
"jakemiles" <···········@gmail.com> writes:

> Hi all.  I'm trying to get asdf working and I'm having trouble.  If
> anyone could help I'd appreciate it.
> 
> The problem is that asdf complains that my :depends-on component
> doesn't exist.
[snip]
> (defsystem "deftest"
>   :components ((:file "deftest" :depends-on ("packages"))))

For this to work, "packages" must be a component of "deftest", but
it's not. Rewrite it like so:

  (defsystem "deftest"
    :depends-on ("packages")
    :components ((:file "deftest")))

This indicates the dependency is at the system level, on another
system.

Zach
From: jakemiles
Subject: Re: asdf woes: asdf:missing-dependency
Date: 
Message-ID: <1164345931.204007.212030@45g2000cws.googlegroups.com>
Oh I see - it thought I was declaring an internal dependency between
two files in the deftest system, not a dependency on a separate
packages system.  I didn't realize the :depends-on keyword is
applicable at both the system level and the file level.

Thanks for the help.

Incidentally, is the package level too granular for delineating asdf
systems?  i.e. are there any shortcomings of this approach that others
have discovered with experience?  It seems that I could now easily
define a higher-level "jake-utilities" system or something that
comprised all these lower, package-level systems, and even combine
different overlapping subsets of them into different higher-level
systems with different uses or audiences.  Pretty cool.

- Jake


Zach Beane wrote:
> "jakemiles" <···········@gmail.com> writes:
>
> > Hi all.  I'm trying to get asdf working and I'm having trouble.  If
> > anyone could help I'd appreciate it.
> >
> > The problem is that asdf complains that my :depends-on component
> > doesn't exist.
> [snip]
> > (defsystem "deftest"
> >   :components ((:file "deftest" :depends-on ("packages"))))
>
> For this to work, "packages" must be a component of "deftest", but
> it's not. Rewrite it like so:
>
>   (defsystem "deftest"
>     :depends-on ("packages")
>     :components ((:file "deftest")))
>
> This indicates the dependency is at the system level, on another
> system.
> 
> Zach