I've made still more progress on getting asdf-dependency-grovel running. At this point most of the unit tests are successful; there are only a couple of failed tests, both having to do with DEFTYPE.
Here's what I'm getting now. I am working on an ancient Ubuntu (14.04) system. In the interest of clarity I've suppressed the SBCL banner.
$ sbcl --no-userinit --script tests/run-tests.lisp This is SBCL 2.1.6, an implementation of ANSI Common Lisp. [...] WARNING: :SB-EVAL is no longer present in *FEATURES* ;;; TESTS failed: ;; u-deftype.satisfies should have: ("p-deftype"), has NIL ;; u-deftype.bar should have: ("p-deftype"), has NIL
The warning about :SB-EVAL is coming from loading ASDF.
The failed test cases are, respectively,
(in-package :asdf-dependency-grovel-test) (deftype uses-satisfies () `(satisfies satisfies-something))
and
(in-package :asdf-dependency-grovel-test) (deftype uses-bar () `(or (not bar) (and bar rational)))
while the corresponding provider is
(in-package :asdf-dependency-grovel-test)
(deftype foo () 'string) (deftype bar () 'integer) (defun satisfies-something (#1=#:a) (declare (ignore #1#)) t)
I wonder why the appropriate dependency wasn't detected, but I'm not too worried about it. ADG is still useful even if it misses these.
Here is the content of tests/run-tests.lisp, which I concocted after tinkering a bit.
(load "/home/robert/by-others/asdf-3.1.5/build/asdf.lisp") (push "/home/robert/by-others/asdf-dependency-grovel-master/" asdf:*central-registry*) (push "/home/robert/by-others/asdf-dependency-grovel-master/tests/" asdf:*central-registry*) (load "tests/grovel-tests.lisp") (load "handlers/00-standard-handlers.lisp") (asdf-dependency-grovel-tester:test-result)
There are various questionable aspects of that, which I'll point out, although they don't really bother me too much -- I'm not responsible for ADG.
(1) I was able to get ADG working only with this particular combination of SBCL (2.1.6) and ASDF (3.1.5). There might be other workable combinations, however, some or all later versions of ASDF trigger errors in ADG.
(2) Use of ASDF:*CENTRAL-REGISTRY* is terrible. Okay, well, it works.
(3) It appears the handlers file is supposed to be loaded by ASDF, which, I guess, is supposed to scan the handlers directory, but something in that process didn't work, so it's loaded by hand.
ADG constructs a new .asd file from the inferred dependencies (and writes it into the ASDF output cache -- maybe that could be mentioned in a readme or something) and I present it here as a kind of trophy.
All the best,
Robert Dodier
PS. groveled-components.lisp:
;;; This file contains -*- lisp -*- expressions. ;;; AUTO-GENERATED file from system definition of system (test-serial-system). Instead of directly editing this file, please edit the system definition and re-generate this file. ( ("test-serial-system" :components ( (:file "package" :encoding :utf-8) (:file "p-defmacro" :depends-on ("package") :encoding :utf-8) (:file "p-define-method-combination" :depends-on ("package") :encoding :utf-8) (:file "p-feature" :depends-on ("package") :encoding :utf-8) (:file "p-defvar" :depends-on ("package") :encoding :utf-8) (:file "p-define-setf-expander" :depends-on ("package") :encoding :utf-8) (:file "p-defsetf" :depends-on ("package") :encoding :utf-8) (:file "p-defclass" :depends-on ("package") :encoding :utf-8) (:file "p-defstruct" :depends-on ("package") :encoding :utf-8) (:file "p-defgeneric" :depends-on ("package") :encoding :utf-8) (:file "p-defmethod" :depends-on ("package") :encoding :utf-8) (:file "p-define-condition" :depends-on ("package") :encoding :utf-8) (:file "p-defpackage" :depends-on ("package") :encoding :utf-8) (:file "p-defun" :depends-on ("package") :encoding :utf-8) (:file "p-define-symbol-macro" :depends-on ("package") :encoding :utf-8) (:file "p-defconstant" :depends-on ("package") :encoding :utf-8) (:file "p-deftype" :depends-on ("package") :encoding :utf-8) (:file "u-defmacro" :depends-on ("p-defmacro" "package") :encoding :utf-8) (:file "u-defmacro.indirect" :depends-on ("p-defmacro" "package") :encoding :utf-8) (:file "u-define-method-combination" :depends-on ("p-define-method-combination" "package") :encoding :utf-8) (:file "u-feature" :depends-on ("p-feature" "package") :encoding :utf-8) (:file "u-defvar" :depends-on ("p-defvar" "package") :encoding :utf-8) (:file "u-defvar.vector" :depends-on ("p-defvar" "package") :encoding :utf-8) (:file "u-defvar.setf" :depends-on ("p-defvar" "package") :encoding :utf-8) (:file "u-defvar.push" :depends-on ("p-defvar" "package") :encoding :utf-8) (:file "u-define-setf-expander" :depends-on ("p-define-setf-expander" "package") :encoding :utf-8) (:file "u-defsetf" :depends-on ("p-defsetf" "package") :encoding :utf-8) (:file "u-defclass.defclass" :depends-on ("p-defclass" "package") :encoding :utf-8) (:file "u-defclass.defmethod" :depends-on ("p-defclass" "package") :encoding :utf-8) (:file "u-defgeneric" :depends-on ("p-defgeneric" "package") :encoding :utf-8) (:file "u-defmethod" :depends-on ("p-defmethod" "package") :encoding :utf-8) (:file "u-define-condition" :depends-on ("p-define-condition" "package") :encoding :utf-8) (:file "u-defstruct" :depends-on ("p-defstruct" "package") :encoding :utf-8) (:file "u-defstruct.type" :depends-on ("p-defstruct" "package") :encoding :utf-8) (:file "u-defstruct.defmethod" :depends-on ("p-defstruct" "package") :encoding :utf-8) (:file "u-defstruct.functions" :depends-on ("p-defstruct" "package") :encoding :utf-8) (:file "u-defstruct.functions.sharpquote" :depends-on ("p-defstruct" "package") :encoding :utf-8) (:file "u-defstruct.include" :depends-on ("p-defstruct" "package") :encoding :utf-8) (:file "u-defpackage" :depends-on ("p-defpackage") :encoding :utf-8) (:file "u-defpackage.1" :depends-on ("p-defpackage") :encoding :utf-8) (:file "u-defpackage.2" :depends-on ("p-defpackage") :encoding :utf-8) (:file "u-defpackage.3" :depends-on ("p-defpackage") :encoding :utf-8) (:file "u-defun" :depends-on ("p-defun" "package") :encoding :utf-8) (:file "u-defun.sharpquote" :depends-on ("p-defun" "package") :encoding :utf-8) (:file "u-define-symbol-macro" :depends-on ("p-define-symbol-macro" "package") :encoding :utf-8) (:file "u-defconstant" :depends-on ("p-defconstant" "package") :encoding :utf-8) (:file "u-deftype.foo" :depends-on ("p-deftype" "package") :encoding :utf-8) (:file "u-deftype.bar" :depends-on ("package") :encoding :utf-8) (:file "u-deftype.satisfies" :depends-on ("package") :encoding :utf-8) (:file "u-deftype.etypecase" :depends-on ("p-deftype" "package") :encoding :utf-8) (:file "u-deftype.typecase" :depends-on ("p-deftype" "package") :encoding :utf-8))) )
Congratulations for resurrecting ADG.
I wonder why the appropriate dependency wasn't detected, but I'm not too worried about it. ADG is still useful even if it misses these.
There is no guarantee when the types defined by deftype are or aren't going to be expanded and checked, unless you explicitly (eval-when (:compile-toplevel :load-toplevel :execute) ... (typep my-value my-type) ...) Implementation-dependent optimization settings might affect type checks.
There are various questionable aspects of that, which I'll point out, although they don't really bother me too much -- I'm not responsible for ADG.
You've been the most responsible person for ADG in the last 10 years.
(1) I was able to get ADG working only with this particular combination of SBCL (2.1.6) and ASDF (3.1.5). There might be other workable combinations, however, some or all later versions of ASDF trigger errors in ADG.
It *should* work all the way to ASDF 3.2.1. For 3.3.0 and later, you'll need to refactor things to support DEFINE-OP or probably, a way to instrument OPERATE rather than modify either operation or component classes.
(3) It appears the handlers file is supposed to be loaded by ASDF, which, I guess, is supposed to scan the handlers directory, but something in that process didn't work, so it's loaded by hand.
The code in ADG hails from the ASDF 1 era. It might be possible to fix the grovel-handlers code—but it's probably best to junk it.
ADG constructs a new .asd file from the inferred dependencies (and writes it into the ASDF output cache -- maybe that could be mentioned in a readme or something) and I present it here as a kind of trophy.
Making ASDF work with the output from ADG on a thousand-file project is what started me fixing significant ASDF bugs and ultimately becoming ASDF maintainer and writing ASDF 2 and 3. Notably: ASDF 1 running time was cubic in the number of components, leading to minutes to process the generated file, instead of a fraction of a second.
—♯ƒ • François-René Rideau • Co-Founder and President, MuKn.io “Time is really the only capital that any human being has and the thing that he can least afford to waste or lose.” — Thomas A. Edison (1847–1931)