Reputation: 5831
I am currently building a project in Common Lisp and am using the ASDF. However, I am experiencing some difficulties. Namely, when I run asdf:compile-system
, it seems to compile. I can then do asdf:load-system
successfully. However, some functions located in some of the files remain undefined. To make them known, I have to manually navigate to that file and compile it.
Here is the declaration for the system. Could someone tell me what I am doing incorrectly?
(defsystem "xxx-xxxx"
:version "0.1.0"
:author ""
:license ""
:depends-on ("cl-mongo" "hunchentoot" "clack" "ningle" "cl-json" "hermetic" "lack-middleware-session" "cl-markup")
:components ((:module "src"
:components
((:file "packages")
(:file "lisp-utils")
(:file "xxx-xxxx" :depends-on ("packages"))
(:file "database" :depends-on ("packages"))
(:file "database-config" :depends-on ("packages"))
(:file "server" :depends-on ("packages"))
(:file "clack" :depends-on ("packages"))
(:file "routes/activities" :depends-on ("packages"))
(:file "route-processors" :depends-on ("packages")))))
:description ""
:long-description
#.(read-file-string
(subpathname *load-pathname* "README.markdown"))
:in-order-to ((test-op (test-op "xxx-xxxx-test"))))
In particular, I am having an issue with the file routes/activities
and possibly route-processors
.
Upvotes: 0
Views: 534
Reputation: 4184
Given my experience with asdf the only off thing of your system definition is the "routes/activities" file as subfolders are defined as modules. This file should fix your problem:
(defsystem "xxx-xxxx"
:version "0.1.0"
:author ""
:license ""
:depends-on ("cl-mongo"
"hunchentoot"
"clack"
"ningle"
"cl-json"
"hermetic"
"lack-middleware-session"
"cl-markup")
:components ((:module "src"
:components
((:file "packages")
(:file "lisp-utils")
(:file "xxx-xxxx"
:depends-on ("packages"))
(:file "database"
:depends-on ("packages"))
(:file "database-config"
:depends-on ("packages"))
(:file "server"
:depends-on ("packages"))
(:file "clack"
:depends-on ("packages"))
(:module "routes"
:components ((:file "activities"))
:depends-on ("packages"))
(:file "route-processors"
:depends-on ("packages")))))
:description ""
:long-description
#.(read-file-string
(subpathname *load-pathname* "README.markdown"))
:in-order-to ((test-op (test-op "xxx-xxxx-test"))))
Addressing your last comment. The reason for the exception is that dependencies are resolved within the list the parent of the dependency resides in. So if you say that "activities" depends on "packages" but have "activities" in a module asdf will search for packages in that module/subfolder and due to its non-existance not find it. Whether it is presumptuous or not is irrelevant, this is how it works. It also makes sense as a module usually describes a logical coherent unit and thus dependencies are expected to be similar for that unit, else you might want to rethink your project structure.
Upvotes: 5