Commit db28c77f authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Add copious comments to the main plan traversal functions.

Also update comments in TODO file, manual.
Make the Makefile test result checking less uselessly verbose.
parent 86d20de0
......@@ -152,10 +152,10 @@ test-all-upgrade-no-stop:
@for lisp in ${lisps} ; do ${MAKE} test-upgrade l=$$lisp ; done ; :
test-all-no-upgrade-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop
make check-all-test-results
make --quiet check-all-test-results
test-all-no-stop: doc test-load-systems test-all-clean-load test-all-lisp-no-stop test-all-upgrade-no-stop
make check-all-results
make --quiet check-all-results
check-all-test-results:
@A="`grep -L '[5-9][0-9] passing and 0 failing' build/results/*-test.text`" ; \
......
......@@ -74,6 +74,8 @@
rather than nil. This is probably a bug in #+ processing.
Unhappily, debian creates such a file in
/etc/common-lisp/asdf-output-translations.conf.d/01-common-lisp-controller.conf
* Tests that try to catch an error fail (but catching a warning succeeds),
which suggests brokenness in handler-bind and/or error.
* Some out-of-line configuration mechanism for various options?
i.e. let configuration files override some variables around compilation of some systems.
......@@ -136,6 +138,33 @@
* operation cleanup?
** Kill backward-compat functions after all clients have moved on.
** Kill original-initargs -- BEWARE, it currently has clients!
** To allow semantically distinct operations of the same class:
You'd need to have a protocol to canonicalize them
in the *OPERATIONS* memoization table, not by class name,
but by CONS of the class name and some CANONICAL-OPERATION-INITARGS.
The latter would be a generic function called on the initargs,
where any parasite initargs such as FORCE and FORCE-NOT have been removed,
since they below to the PLAN, not the OPERATION:
the OPERATE protocol would be refined to explicit split
arguments to be passed to MAKE-PLAN or to MAKE-OPERATION.
The default method for CANONICAL-OPERATION-INITARGS
would SORT (a plist->alist of) the initargs,
and that would replace the current ORIGINAL-INITARGS slot.
For this scheme to work even in presence of undisciplined users
using MAKE-INSTANCE on an operation class,
the OPERATION class would have an extra slot EFFECTIVE-OPERATION,
uninitialized by default (nil or unbound), whose accessor initializes it
if it's uninitialized, by looking up a canonical instance in *OPERATIONS*,
and if unfound registering the current operation as canonical.
Then, each component's COMPONENT-OPERATION-TIME hash-table
would be indexed by canonicalized operation object
rather than by operation class,
and POIU would have to be changed accordingly.
Of course, this entire cleanup is incompatible
with how SWANK and GBBopen currently abuse slots of operation,
so these would have to be fixed first.
And that's why I didn't do it.
It looks like SWANK can be fixed soon, though, so we'll see.
* Get rid of component-properties
** directly use component-properties:
......@@ -214,3 +243,5 @@
* ASDF4: search for this tag, rename things (incompatibly, thus) and cleanup code.
* See message from 2014-01-27 05:26:44 GMT for stuff to document.
http://thread.gmane.org/gmane.lisp.asdf.devel/3675/focus=3695
......@@ -35,11 +35,11 @@ for Common Lisp programs and libraries.
You can find the latest version of this manual at
@url{http://common-lisp.net/project/asdf/asdf.html}.
ASDF Copyright @copyright{} 2001-2013 Daniel Barlow and contributors.
ASDF Copyright @copyright{} 2001-2014 Daniel Barlow and contributors.
This manual Copyright @copyright{} 2001-2013 Daniel Barlow and contributors.
This manual Copyright @copyright{} 2001-2014 Daniel Barlow and contributors.
This manual revised @copyright{} 2009-2013 Robert P. Goldman and Francois-Rene Rideau.
This manual revised @copyright{} 2009-2014 Robert P. Goldman and Francois-Rene Rideau.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
......@@ -173,7 +173,7 @@ the ASDF internals and how to extend ASDF.
@emph{Nota Bene}:
We have released ASDF 2.000 on May 31st 2010,
and ASDF 3.0 on January 31st 2013.
and ASDF 3.0.0 on May 15th 2013.
Releases of ASDF 2 and later have since then been included
in all actively maintained CL implementations that used to bundle ASDF 1,
plus some implementations that didn't use to,
......
......@@ -181,6 +181,12 @@ the action of OPERATION on COMPONENT in the PLAN"))
(defun direct-dependencies (operation component)
(reduce-direct-dependencies operation component #'acons nil))
;; In a distant future, get-file-stamp, component-operation-time and latest-stamp
;; shall also be parametrized by the plan, or by a second model object,
;; so they need not refer to the state of the filesystem,
;; and the stamps could be cryptographic checksums rather than timestamps.
;; Such a change remarkably would only affect VISIT-DEPENDENCIES and COMPUTE-ACTION-STAMP.
(defun visit-dependencies (plan operation component dependency-stamper &aux stamp)
(map-direct-dependencies
operation component
......@@ -200,11 +206,6 @@ the action of OPERATION on COMPONENT in the PLAN"))
;; Note that if e.g. LOAD-OP only depends on up-to-date files, but
;; hasn't been done in the current image yet, then it can have a non-T timestamp,
;; yet a NIL done-in-image-p flag.
;;
;; In a distant future, get-file-stamp, component-operation-time and latest-stamp
;; shall also be parametrized by the plan, or by a second model object,
;; so they need not refer to the state of the filesystem,
;; and the stamps could be cryptographic checksums rather than timestamps.
(let* ((stamp-lookup #'(lambda (o c)
(if-let (it (plan-action-status plan o c)) (action-stamp it) t)))
(out-files (output-files o c))
......@@ -313,43 +314,47 @@ the action of OPERATION on COMPONENT in the PLAN"))
;; For actions that are up-to-date, it returns a STAMP identifying the state of the action
;; (that's timestamp, but it could be a cryptographic digest in some ASDF extension),
;; or T if the action needs to be done again.
;;
;; Note that for an XCVB-like plan with one-image-per-file-outputting-action,
;; the below method would be insufficient, since it assumes a single image
;; to traverse each node at most twice; non-niip actions would be traversed only once,
;; but niip nodes could be traversed once per image, i.e. once plus once per non-niip action.
(defmethod traverse-action (plan operation component needed-in-image-p)
(block nil
(unless (action-valid-p plan operation component) (return nil))
(plan-record-dependency plan operation component)
(let* ((aniip (needed-in-image-p operation component))
(eniip (and aniip needed-in-image-p))
(status (plan-action-status plan operation component)))
(unless (action-valid-p plan operation component) (return nil)) ; if-feature, forced-not...
(plan-record-dependency plan operation component) ; hook to maintain complete graph (POIU)
(let* ((aniip (needed-in-image-p operation component)) ; does it side-effect the image?
(eniip (and aniip needed-in-image-p)) ; does it side-effect the *current* image?
(status (plan-action-status plan operation component))) ; status of action so far
(when (and status (or (action-done-p status) (action-planned-p status) (not eniip)))
;; Already visited with sufficient need-in-image level: just return the stamp.
(return (action-stamp status)))
(labels ((visit-action (niip)
(visit-dependencies plan operation component
(return (action-stamp status))) ; Already visited with sufficient need-in-image level!
(labels ((visit-action (niip) ; We may visit the action twice, once with niip NIL, then T
(visit-dependencies plan operation component ; recursively traverse dependencies
#'(lambda (o c) (traverse-action plan o c niip)))
(multiple-value-bind (stamp done-p)
(compute-action-stamp plan operation component)
(multiple-value-bind (stamp done-p) ; AFTER dependencies have been traversed,
(compute-action-stamp plan operation component) ; compute action stamp
(let ((add-to-plan-p (or (eql stamp t) (and niip (not done-p)))))
(cond
((and add-to-plan-p (not niip)) ;; if we need to do it,
(visit-action t)) ;; then we need to do it in the image!
(cond ; it needs be done if it's out of date or needed in image but absent
((and add-to-plan-p (not niip)) ; if we need to do it,
(visit-action t)) ; then we need to do it *in the (current) image*!
(t
(setf (plan-action-status plan operation component)
(setf (plan-action-status plan operation component) ; update status:
(make-instance
'planned-action-status
:stamp stamp
:done-p (and done-p (not add-to-plan-p))
:planned-p add-to-plan-p
:index (if status
(action-index status)
(incf (plan-total-action-count plan)))))
(when add-to-plan-p
(incf (plan-planned-action-count plan))
(unless aniip
(incf (plan-planned-output-action-count plan))))
stamp))))))
:stamp stamp ; computed stamp
:done-p (and done-p (not add-to-plan-p)) ; done *and* up-to-date?
:planned-p add-to-plan-p ; included in list of things to be done?
:index (if status ; index of action amongst all nodes in traversal
(action-index status) ;; if already visited, keep index
(incf (plan-total-action-count plan))))) ; else new index
(when add-to-plan-p ; if it needs to be added to the plan,
(incf (plan-planned-action-count plan)) ; count it
(unless aniip ; if it's output-producing,
(incf (plan-planned-output-action-count plan)))) ; count it
stamp)))))) ; return the stamp
(while-visiting-action (plan operation component) ; maintain context, handle circularity.
(visit-action eniip)))))))
(visit-action eniip))))))) ; visit the action
;;;; Sequential plans (the default)
......
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