Skip to content
Snippets Groups Projects
Commit fe907bbd authored by Robert P. Goldman's avatar Robert P. Goldman
Browse files

Cleaned up a bunch of debugging cruft.

Test still doesn't work, but that seems to be because the testing code
itself establishes an ASDF cache, making the restart I want inaccessible
from test code.
parent 9ee02fc8
No related branches found
No related tags found
No related merge requests found
...@@ -17,37 +17,38 @@ ...@@ -17,37 +17,38 @@
(DBG "Clearing the caches and finding.") (DBG "Clearing the caches and finding.")
(clear-caches-and-search) (clear-caches-and-search)
(assert (not (asdf:find-system "test-asdf/force1" nil))) (assert (not (asdf:find-system "test-asdf/force1" nil)))
(let (tried-once) (DBG "Correctly failed to find system.")
(handler-bind (assert
((asdf:missing-dependency-of-version (let (tried-once)
(lambda (c) (handler-bind
;; Nothing Quicklisp can do to recover from this, so ((asdf:missing-component
;; just resignal #'(lambda (c)
(error c))) (DBG "Caught MISSING-COMPONENT condition.")
(asdf:missing-dependency (if (not tried-once)
(lambda (c) (let ((missing (asdf::missing-requires c)))
(if (not tried-once) (assert (equal missing "test-asdf/force1"))
(let ((missing (asdf::missing-requires c))) (setf tried-once t)
(assert (equal missing "test-asdf/force1")) (setf asdf:*central-registry* *old-registry*)
(setf tried-once t) (invoke-restart 'asdf:reinitialize-source-registry-and-retry)
(DBG "Trying to reset the central registry and retry.") )
(setf asdf:*central-registry* *old-registry*) ;; avoid infinite looping
(asdf:find-system missing)) (error c)))))
;; avoid infinite looping (asdf:find-system "test-asdf/force1" t))))
(error c)))))
(asdf:find-system "test-asdf/force1")))
(DBG "Refinding test successful.") (DBG "Refinding test successful.")
(DBG "Now trying LOAD-SYSTEM with refinding.") (DBG "Now trying LOAD-SYSTEM with refinding.")
(clear-caches-and-search) (clear-caches-and-search)
(trace find-system) (def-test-system test-missing-dependency
(trace find-component) :depends-on ("test-asdf/force1")
(trace asdf::component-find-path) :components ((:file "file2")))
(trace operate) ;; (trace find-system)
;; (trace find-component)
;; (trace asdf::component-find-path)
;; (trace operate)
(let (tried-once) (let (tried-once)
(flet ((handle-missing (c) (flet ((handle-missing (c)
(if (not tried-once) (if (not tried-once)
(let ((missing (asdf::missing-requires c))) (let ((missing (asdf::missing-requires c)))
(assert (equal missing "test-asdf/force1")) (assert (equal missing "test-asdf/force1"))
(setf tried-once t) (setf tried-once t)
...@@ -55,25 +56,25 @@ ...@@ -55,25 +56,25 @@
(setf asdf:*central-registry* *old-registry*) (setf asdf:*central-registry* *old-registry*)
(unless (find-restart 'asdf:reinitialize-source-registry-and-retry) (unless (find-restart 'asdf:reinitialize-source-registry-and-retry)
(error "Expected REINITIALIZE-SOURCE-REGISTRY-AND-RETRY restart not found.")) (error "Expected REINITIALIZE-SOURCE-REGISTRY-AND-RETRY restart not found."))
(DBG "Before invoking restart, CENTRAL-REGISTRY is:~%~T~S" (DBG "Before invoking restart, CENTRAL-REGISTRY is:"
asdf:*central-registry*) asdf:*central-registry*)
(invoke-restart 'asdf:reinitialize-source-registry-and-retry) (invoke-restart 'asdf:reinitialize-source-registry-and-retry)
(DBG "After invoking restart, CENTRAL-REGISTRY is:~%~T~S" (DBG "After invoking restart, CENTRAL-REGISTRY is:"
asdf:*central-registry*)) asdf:*central-registry*))
;; avoid infinite looping ;; avoid infinite looping
(error c)))) (error c))))
(handler-bind (handler-bind
((asdf:missing-dependency-of-version ((asdf:missing-dependency-of-version
(lambda (c) #'(lambda (c)
;; Nothing Quicklisp can do to recover from this, so ;; Nothing Quicklisp can do to recover from this, so
;; just resignal ;; just resignal
(error c))) (error c)))
(asdf:missing-dependency (asdf:missing-dependency
(lambda (c) #'(lambda (c)
(DBG "Catching MISSING-DEPENDENCY condition:" tried-once) (DBG "Catching MISSING-DEPENDENCY condition:" tried-once)
(handle-missing c))) (handle-missing c)))
(asdf:missing-component (asdf:missing-component
(lambda (c) #'(lambda (c)
(DBG "Catching MISSING-COMPONENT condition:" tried-once) (DBG "Catching MISSING-COMPONENT condition:" tried-once)
(handle-missing c)))) (handle-missing c))))
(asdf:load-system "test-asdf/force1")))) (asdf:load-system "test-missing-dependency"))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment