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

More refactoring of plan

Move action-status wholly to plan, merge it with planned-action-status.
Add a performable-p flag to plans.
Simplify sequential-plan and required-components; have them use a separate
function collect-action-dependencies for traversing the graph.
Add a function action-up-to-date-p to check whether an action is up-to-date,
without adding it to the plan if it wasn't.
parent 604f5422
......@@ -14,7 +14,6 @@
#:non-propagating-operation
#:component-depends-on
#:input-files #:output-files #:output-file #:operation-done-p
#:action-status #:action-stamp #:action-done-p
#:action-operation #:action-component #:make-action
#:component-operation-time #:mark-operation-done #:compute-action-stamp
#:perform #:perform-with-restarts #:retry #:accept #:*action*
......@@ -395,21 +394,6 @@ Returns two values:
* a boolean DONE-P that indicates whether the action has actually been done,
and both its output-files and its in-image side-effects are up to date."))
(defclass action-status ()
((stamp
:initarg :stamp :reader action-stamp
:documentation "STAMP associated with the ACTION if it has been completed already
in some previous image, or T if it needs to be done.")
(done-p
:initarg :done-p :reader action-done-p
:documentation "a boolean, true iff the action was already done (before any planned action)."))
(:documentation "Status of an action"))
(defmethod print-object ((status action-status) stream)
(print-unreadable-object (status stream :type t)
(with-slots (stamp done-p) status
(format stream "~@{~S~^ ~}" :stamp stamp :done-p done-p))))
(defmethod component-operation-time ((o operation) (c component))
(gethash o (component-operation-times c)))
......
......@@ -87,6 +87,8 @@ But do NOT depend on it, for this is deprecated behavior."))
(error 'missing-component-of-version :requires component :version version))
(record-dependency nil operation component))
;; TODO: have plans accept parent plans and delegate force and force-not.
;; Ensure that only the toplevel session plan can specify force and force-not arguments.
(defun ensure-plan (operation component
&rest keys &key plan-class &allow-other-keys)
(declare (ignore operation))
......@@ -97,6 +99,7 @@ But do NOT depend on it, for this is deprecated behavior."))
session-plan)
(t
(let ((new (apply 'make-instance (or plan-class *plan-class*)
:performable-p t
:system (component-system component) keys)))
(setf (session-plan *asdf-session*) new)
new)))))
......
This diff is collapsed.
;;;; -------------------------------------------------------------------------
;;;; Session cache
;;;; Session
(uiop/package:define-package :asdf/session
(:recycle :asdf/session :asdf/cache :asdf/component
......@@ -10,7 +10,7 @@
#:asdf-cache #:set-asdf-cache-entry #:unset-asdf-cache-entry #:consult-asdf-cache
#:do-asdf-cache #:normalize-namestring
#:call-with-asdf-session #:with-asdf-session
#:*asdf-session* #:*asdf-session-class* #:session #:session-plan
#:*asdf-session* #:*asdf-session-class* #:session #:session-cache #:session-plan
#:visited-actions #:visiting-action-set #:visiting-action-list
#:total-action-count #:planned-action-count #:planned-output-action-count
#:clear-configuration-and-retry #:retry
......@@ -36,8 +36,8 @@
;; * Speed and reliability of ASDF, with fewer side-effects from access to the filesystem, and
;; no expensive recomputations of transitive dependencies for input-files or output-files.
;; * Testability of ASDF with the ability to fake timestamps without actually touching files.
(cache
:initform (make-hash-table :test 'equal) :reader session-cache
(session-cache
:initform (make-hash-table :test 'equal) :accessor session-cache
:documentation "Memoize expensive computations")
(plan
:initform nil :accessor session-plan
......
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