[asdf-devel] Small ASDF extension to show dependency DAG
fahree at gmail.com
Sat Jul 9 20:01:05 UTC 2011
On 9 July 2011 15:48, Scott L. Burson <Scott at ergy.com> wrote:
> Hi Faré!
> Here's a little hack I just wrote because I wanted to see the
> dependency DAG for a system I'm working on:
> (in-package :asdf)
> (defun* show-dependencies (system-name &key descriptions?)
> (let ((seen (make-hash-table :test #'equal)))
> (labels ((rec (system-name depth)
> (let ((nm (if (and (listp system-name) (eq (car system-name) ':version))
> (coerce-name (cadr system-name))
> (coerce-name system-name))))
> (if (gethash nm seen)
> (format t "~v at T[~A]~%" (* depth 2) nm)
> (let ((sys (cdr (gethash nm *defined-systems*))))
> (if (null sys)
> (format t "~v at T~A??~%" (* depth 2) nm)
> (format t "~v at T~A~@[: ~A~]~%" (* depth 2) nm
> (and descriptions?
> (slot-boundp sys 'description)
> (slot-value sys 'description)))
> (setf (gethash nm seen) t)
> (dolist (dep (component-load-dependencies sys))
> (rec dep (1+ depth)))))))))))
> (rec system-name 0))))
> I thought you might want to include this in asdf.lisp. Sample output
> is below. When a name is in brackets, that means the system and its
> dependencies have already appeared earlier in the listing.
(Adding asdf-devel as destination.)
It is cool. I think it deserves to be published.
But I don't think the already way too big asdf.lisp is the right place.
Our goal is to keep asdf.lisp itself minimal, and move anything not
strictly needed for system bootstrap into extensions.
At the same time, we don't yet have an "official" repository for such
Maybe it's time to start one.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
> -- Scott
More information about the asdf-devel