Commit 0e3bdbb2 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 a61bd35e
......@@ -53,14 +53,17 @@
(if-let ((action (first (visiting-action-list *asdf-session*))))
(let ((parent-operation (action-operation action))
(parent-component (action-component action)))
(unless (and (typep parent-operation 'define-op) (typep parent-component 'system))
(error "Invalid recursive use of (OPERATE ~S ~S) while visiting ~S ~
- please use proper dependencies instead."
operation component action))
(let ((action (cons operation component)))
(unless (gethash action (definition-dependency-set parent-component))
(push (cons operation component) (definition-dependency-list parent-component))
(setf (gethash action (definition-dependency-set parent-component)) t)))))))
(cond
((and (typep parent-operation 'define-op)
(typep parent-component 'system))
(let ((action (cons operation component)))
(unless (gethash action (definition-dependency-set parent-component))
(push (cons operation component) (definition-dependency-list parent-component))
(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))
`(;;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