Re: PATCH Error message for broken asd file links
Gary King <[email protected]> Sun, 7 Oct 2007 11:39:28 -0400
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
This looks like a good thing to me; if there are no objections, I'm happy to apply it... Thanks Andreas, On Oct 6, 2007, at 8:37 AM, Andreas Fuchs wrote: > There's a strange interaction in ASDF on SBCL: if a user has defined a > system by manually loading a system definition, for example a file > containing this: > > (asdf:defsystem "foo") > > and has a broken link in one of the directories in the > asdf:*central-registry*, he'll get an error like the one in > http://paste.lisp.org/display/48735 when anything uses (asdf:find- > system > "foo"). > > This is caused by PROBE-FILE on SBCL returning the symlink's pathname > for broken symlinks, and FILE-WRITE-DATE returning NIL for these > broken > symlinks. I don't consider this a bug (the spec states that the file > must exist, not that OPEN of that file must not fail), so asdf > needs to > be fixed (-: > > IMO, as the system is already in memory, any error message from > find-system is inappropriate. It may still cause confusion for users > once they reload their lisp and get an error that the system isn't > found, so the attached patch warns that it can't compare the found > system defn to the one in memory. Maybe silent success would be a > better > option. If the maintainers think so, please correct. > > Cheers, > -- > Andreas Fuchs, (http://|im:asf@|mailto:asf@)boinkor.net, antifuchs > diff --git a/contrib/asdf/asdf.lisp b/contrib/asdf/asdf.lisp > index 4005dc8..fa695a0 100644 > --- a/contrib/asdf/asdf.lisp > +++ b/contrib/asdf/asdf.lisp > @@ -376,9 +376,14 @@ and NIL NAME and TYPE components" > (let* ((name (coerce-name name)) > (in-memory (gethash name *defined-systems*)) > (on-disk (system-definition-pathname name))) > + (when (and in-memory (null (file-write-date on-disk))) > + (warn "~@<Can't check whether ~A is newer than the > definition for ~A ~ > + that is already loaded.~@:>" > + on-disk name)) > (when (and on-disk > (or (not in-memory) > - (< (car in-memory) (file-write-date on-disk)))) > + (and (file-write-date on-disk) > + (< (car in-memory) (file-write-date on- > disk))))) > (let ((package (make-temporary-package))) > (unwind-protect > (let ((*package* package)) > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > cclan-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/cclan-list -- Gary Warren King, metabang.com Cell: (413) 559 8738 Fax: (206) 338-4052 gwkkwg on Skype * garethsan on AIM ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/