On 15 Dec 2022, at 1:07, Robert Dodier wrote:
Hi, I'm interested in analyzing dependencies among a collection of Lisp files, or analyzing dependencies stated in a .asd file, or both.
(1) Towards the goal of analyzing dependencies among Lisp files, I'm trying to load asdf-dependency-grovel, and I'm not having any luck. I obtained a tar.gz of the current version from Gitlab, from the project https://gitlab.common-lisp.net/xcvb/asdf-dependency-grovel. I found it necessary to patch tests/run-tests.sh to get anywhere (patch below) and I get the following error at this point:
$ sh tests/run-tests.sh This is SBCL 2.1.6, an implementation of ANSI Common Lisp.
WARNING: redefining UIOP/UTILITY:PARSE-BODY in DEFUN WARNING: Deprecated recursive use of (ASDF/OPERATE:OPERATE 'ASDF/LISP-ACTION:LOAD-OP '("test-serial-system")) while visiting (ASDF-DEPENDENCY-GROVEL:DEPENDENCY-OP "test-serial" "asdf-dependency-grovel-test/serial")
- please use proper dependencies instead
debugger invoked on a SIMPLE-ERROR in thread #<THREAD "main thread" RUNNING {988AB081}>: Just performed compiling #<INSTRUMENTED-CL-SOURCE-FILE "test-serial-system" "package"> but failed to mark it done
Can anyone offer any advice about the "failed to mark it done" error? or the bit about "deprecated recursive use"?
It would help to get a backtrace here. I can't tell from this if the error is happening in ASDF or in ASDF-DEPENDENCY-GROVEL (which probably isn't maintained).
Also whose `run-tests.sh` are these? ASDF's tests or ASDF-dependency-grovel's?
(2) About looking at dependencies stated in a .asd file, I have a .asd file which ASDF is refusing to load because it has a circular dependency. Is there a way to get ASDF to tell me what that circular dependency is? Failing that, can someone suggest any tools to extract a directed graph from a .asd file? I suppose it wouldn't be too hard to do it myself but no need to reinvent the wheel.
I'm thinking I could find a graph analysis library to extract any cycles, if I had a directed graph in hand. I don't suppose someone has already automated looking for cycles in .asd files?
Thanks in advance for any advice, I appreciate your help.
Again, it would help to have a backtrace from this circular dependency to help us get started (if you can share it -- I suppose your system could be private/proprietary).
I just looked up the definition of the `circular-dependency` condition (in `asdf/action.lisp` around line 142) and it has a slot that contains the actions that create the cycle. Does that not give you enough information to isolate the problem? What are you seeing? The report function for this condition should be printing the set of actions in the loop (or at least I think so, that's some hairy `format` string there!).
I wonder if we should adopt `asdf-dependency-grovel` into the ASDF group on cl.net's GitLab? There's no guarantee that would result in active maintenance, though -- it should be obvious that I don't have a lot of cycles to spare...
R