Re: [PATCH] add a RETRY restart to the MISSING-DEPENDENCY error
Luis Oliveira <[email protected]> Sun, 15 Apr 2007 21:42:22 +0100
| Newsgroups | gmane.lisp.cclan.general |
|---|---|
| Message-ID | <[email protected]> |
"Thomas F. Burdick" <[email protected]> writes: > The restart should include a :test that checks to see if it really has > a missing-dependency condition, and if the required-component matches > the one it's offering to retry. Thanks for your comments. I've attached a modified patch that adds a restart :test like the one you describe. For the record, I'm not sure if offering to retry the load of the parent components in the dependency chain is a completely bad idea. For instance, with the original patch, if system A depends on system B and ASDF fails to find system B, two RETRY restarts, one for reloading A the other for B, would be available. If A's dependency on B was bogus, the former restart might be useful. -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/ ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ cclan-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cclan-list
component-load-retry-v2.patch
(text/x-patch, 2.4 KB)
Index: asdf.lisp =================================================================== RCS file: /cvsroot/cclan/asdf/asdf.lisp,v retrieving revision 1.107 diff -u -r1.107 asdf.lisp --- asdf.lisp 21 Mar 2007 22:08:33 -0000 1.107 +++ asdf.lisp 15 Apr 2007 20:23:20 -0000 @@ -652,18 +652,30 @@ (defgeneric traverse (operation component)) (defmethod traverse ((operation operation) (c component)) (let ((forced nil)) - (labels ((do-one-dep (required-op required-c required-v) - (let* ((dep-c (or (find-component - (component-parent c) - ;; XXX tacky. really we should build the - ;; in-order-to slot with canonicalized - ;; names instead of coercing this late - (coerce-name required-c) required-v) - (error 'missing-dependency :required-by c - :version required-v - :requires required-c))) - (op (make-sub-operation c operation dep-c required-op))) - (traverse op dep-c))) + (labels ((%do-one-dep (required-op required-c required-v) + (let* ((dep-c (or (find-component + (component-parent c) + ;; XXX tacky. really we should build the + ;; in-order-to slot with canonicalized + ;; names instead of coercing this late + (coerce-name required-c) required-v) + (error 'missing-dependency :required-by c + :version required-v + :requires required-c))) + (op (make-sub-operation c operation dep-c required-op))) + (traverse op dep-c))) + (do-one-dep (required-op required-c required-v) + (loop + (restart-case + (progn (%do-one-dep required-op required-c required-v) + (return)) + (retry () + :report (lambda (s) + (format s "~@<Retry loading component ~S.~@:>" + required-c)) + :test (lambda (c) + (and (typep c 'missing-dependency) + (eql (missing-requires c) required-c))))))) (do-dep (op dep) (cond ((eq op 'feature) (or (member (car dep) *features*)