Robert Goldman wrote:
Robert Goldman wrote:
I see the following when I try to load an asdf system now:
Error loading #P"/Users/rpg/clinit.cl": While searching for system `asdf-context`: `(MERGE-PATHNAMES systems/ /Users/rpg/lisp/asdf-install-systems/)` evaluated to `/Users/rpg/lisp/asdf-install-systems/systems/` which is not a directory.
The problem with this error is that, in fact, that IS a directory:
CL-USER(2): (probe-file "/Users/rpg/lisp/asdf-install-systems/systems/") #P"/Users/rpg/lisp/asdf-install-systems/systems/"
I'm looking in sysdef-central-registry-search and the logic seems to be completely borked. It looks for a system definition and, if it doesn't find one, it assumes that the directory name is bad. I believe the logic should be:
Look at the directory and ensure that it exists.
If it does not exist, push it onto the bad list
Else merge in the system name and look for the system definition.
The current logic merges in the system name first, so misdiagnoses.
[I will now proceed to wrestle with git, which I am coming to loathe with a consuming hatred, in order to attempt to verify that my diagnosis is correct, and then send a patch. More soon.]
OK, I /have/ misdiagnosed this. The logic seems actually busted in directory-pathname-p. The problem is that, at least on allegro, you can get a valid directory pathname whose name component is neither NIL, nor :unspecific, but "" (the empty string).
This seems like a place where wrestling with CL pathnames is very unpleasant.... What I'd really like to do here is resolve the pathname and just ask the bloody OS if this is a directory or not, instead of do these kind of seemingly random flailings with the pathname object:
(defun directory-pathname-p (pathname) (and (member (pathname-name pathname) (list nil :unspecific)) (member (pathname-type pathname) (list nil :unspecific))))
This will now have to be
(member (pathname-name pathname) (list nil "" :unspecific) :test 'equal)
which seems like it's metastasizing complexity...
Yet worse. On the #lisp IRC antifuchs and Xach point out more possible problems:
antifuchs: actually, a :name component of "." with :type nil/:unspecific would make sense in posix
Xach: antifuchs: or :name nil and :type "" :-)
This suggests that fixing directory-pathname-p may be sufficiently horrible that we should back out this attempted helpfulness.
The only alternative seems to me to be to figure out a way to ask the OS whether a file name denotes a directory, which seems like such an expensive thing that we may not want ASDF to do it inside an inner loop like sysdef-central-registry-search.
Every time I look deeply into CL pathnames I regret them more....