SYSTEM-RELATIVE-PATHNAME has counterintuitive behavior on systems with PATHNAME
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ASDF |
New
|
Undecided
|
Unassigned |
Bug Description
Here's a system definition I have:
(defsystem shop2/openstacks
:depends-on (:shop2)
:serial t
:pathname "examples/
:components ((:file "package")
Here's what ASDF system-
SHOP-REPLAN-TESTS> (asdf:system-
#P"/Users/
What I expected it to return:
#P"/Users/
So the semantics of this function are what I would expect from
SYSTEM-
not
SYSTEM-
I.e., it's
(defun* (system-
"Given a SYSTEM, and a (Unix-style relative path) NAME of a file (or directory) of given TYPE,
return the absolute pathname of a corresponding file under that system's source code pathname."
(subpathname (system-
Note that the docstring is ambiguous because "system's source code" could mean "the source code that defines the system object" [which is what is done here] or "the source code that defines the system"
This definition gives the behavior I expect:
(defun system-
"Given a SYSTEM, and a (Unix-style relative path) NAME of a file (or directory) of given TYPE,
return the absolute pathname of a corresponding file under that system's source code pathname."
(subpathname (component-pathname (find-system system)) name :type type))
I think it would be best to make this modification, although I concede it could cause some breakage.
I believe the behavior was chosen for backward compatibility with common idioms that were merging pathnames with system- source- directory or such.
I have no opinion on what "should" be the behavior, except that if you change the current semantics (as opposed to the current docstring), then you should check that this doesn't cause any bad surprise with systems currently in Quicklisp.