Commit 4e5cccf2 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Only warn in recursive calls to operate

Don't error out but only warn when operate is recursively called.
Too much legacy code uses load-system or require inside lisp files
and/or perform methods.
parent 2cdd7104
...@@ -53,14 +53,17 @@ ...@@ -53,14 +53,17 @@
(if-let ((action (first (visiting-action-list *asdf-session*)))) (if-let ((action (first (visiting-action-list *asdf-session*))))
(let ((parent-operation (action-operation action)) (let ((parent-operation (action-operation action))
(parent-component (action-component action))) (parent-component (action-component action)))
(unless (and (typep parent-operation 'define-op) (typep parent-component 'system)) (cond
(error "Invalid recursive use of (OPERATE ~S ~S) while visiting ~S ~ ((and (typep parent-operation 'define-op)
- please use proper dependencies instead." (typep parent-component 'system))
operation component action)) (let ((action (cons operation component)))
(let ((action (cons operation component))) (unless (gethash action (definition-dependency-set parent-component))
(unless (gethash action (definition-dependency-set parent-component)) (push (cons operation component) (definition-dependency-list parent-component))
(push (cons operation component) (definition-dependency-list parent-component)) (setf (gethash action (definition-dependency-set parent-component)) t))))
(setf (gethash action (definition-dependency-set parent-component)) t))))))) (t
(warn (compatfmt "~@<Deprecated recursive use of (~S '~S '~S) while visiting ~S ~
- please use proper dependencies instead~@:>")
'operate (type-of operation) (component-find-path component) (action-path action))))))))
(defmethod component-depends-on ((o define-op) (s system)) (defmethod component-depends-on ((o define-op) (s system))
`(;;NB: 1- ,@(system-defsystem-depends-on s)) ; Should be already included in the below. `(;;NB: 1- ,@(system-defsystem-depends-on s)) ; Should be already included in the below.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment