Reputation: 783
I'm using ASDF
load cl-ppcre
in a script file. The issue is (progn (require :asdf) (require :cl-ppcre))
is perfectly fine in a top level, but if the same codes wrapped in a handler-case
, a system-out-of-date
condition will be caught by handler-case
and the whole evaluation stops, and required packages won't be loaded. I just confirm the same issue also happens in a REPL. No matter what library I try to load, the same issue just happen in a handler-case
. The following is a complete session:
; SLIME 2.27
CL-USER> (require :asdf)
NIL
CL-USER> (find-package :cl-ppcre)
NIL
CL-USER> (handler-case (require :cl-ppcre) (t (c) (format t "~a: ~a~%" (type-of c) c)))
SYSTEM-OUT-OF-DATE: system cl-ppcre is out of date
NIL
CL-USER> (find-package :cl-ppcre)
NIL
CL-USER> (require :cl-ppcre)
NIL
CL-USER> (find-package :cl-ppcre)
#<PACKAGE "CL-PPCRE">
CL-USER> (handler-case (require :cl-ppcre) (t (c) (format t "~a: ~a~%" (type-of c) c)))
NIL
CL-USER> (list (lisp-implementation-type) (lisp-implementation-version))
("SBCL" "2.2.4")
CL-USER> (asdf:asdf-version)
"3.3.1"
CL-USER> (directory "/home/pxie/common-lisp/*" :resolve-symlinks nil)
(#P"/home/pxie/common-lisp/alexandria/" #P"/home/pxie/common-lisp/cl-ppcre/")
According to ASDF manual, I put my libraries in ~/common-lisp directory
, and the libraries already compiled and saved in the ~/.cache/common-lisp directory
.
Any insight of what is going on in ASDF?
Upvotes: 3
Views: 119
Reputation: 9252
If you ask handler-case
to catch any condition that is signalled, as you have done, it will do that, whether or not the condition is an error. You almost never want to do that.
In particular if you look at plan.lisp
in the ASDF sources you will find
;; NB: This is not an error, not a warning, but a normal expected condition,
;; to be to signaled by FIND-SYSTEM when it detects an out-of-date system,
;; *before* it tries to replace it with a new definition.
(define-condition system-out-of-date (condition)
...)
Upvotes: 5