SYSTEM-DEFINITION-PATHNAME returns nil for second of two defsystems in same .asd file
Bug #498277 reported by
Tobias C. Rittweiler
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ASDF |
Fix Released
|
Medium
|
Unassigned |
Bug Description
;;; foo.asd
(in-package :cl-user)
(asdf:defsystem :foo)
(asdf:defsystem :foo-test)
;;; linked into registry
CL-USER> (asdf:load-system :foo)
; loading system definition from /home/tcr/
; #<PACKAGE "ASDF0">
; registering #<SYSTEM :FOO {B043A99}> as FOO
; registering #<SYSTEM :FOO-TEST {B1737F9}> as FOO-TEST
NIL
CL-USER> (asdf:load-system :foo-test)
NIL
CL-USER> (asdf:system-
#P"/home/
CL-USER> (asdf:system-
NIL
CL-USER>
Why does the last form return NIL?
On related note: Are the circumstances documented when SYS-DEF-PATHNAME
may return NIL?
Changed in asdf: | |
status: | New → Confirmed |
Changed in asdf: | |
importance: | Undecided → Medium |
Changed in asdf: | |
milestone: | none → version2 |
To post a comment you must log in.
Some asdf archaeology:
The *defined-systems* hash table has values that are pairs, reading through register-system:
the first element of which is a universal-time and the second element of which is a system object (I will submit a patch that adds a docstring for this table; this information should be available proximally to the variable definition).
AFAICT, when system- definition- pathname is called, it first tries to find a system definition through the search functions. That will fail for the system that is not the one that corresponds to the file name. The next thing it does is find the entry in *defined-systems*.
OK, this means that either it's not finding the foo-test system in the *defined-systems* table, or it's finding it, and the system-source-file is nil.
I'm not sure why this should be happening. When I look at my copy of the defsystem macro, there's a call to %set-system- source- file that should be recordingin this information. However, there is something funny going on in defsystem where it looks almost like that first system definition will be thrown away and destroyed in favor of a new object created by parse-component -form.. ..
I don't claim to understand what's going on inside defsystem.