Commit 06bcb1f2 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

Add test case for spurious rebuild in ddo

I noticed that some systems, e.g. fast-io, will cause UIOP, CFFI, and
everything that depends on it, to be constantly recompiled.
Interestingly, this doesn't happen with any of the systems that fast-io
directly depends on: alexandria, trivial-gray-streams, and static-vectors.
And interestingly, the test case, once reduced, is exactly isomorphic to
the test case already in test-defsystem-depends-on-phase-overlap.script:
fast-io => main-system, alexandria => overlapping-dependency,
static-vectors => intermediate-dependency, bazel => defsystem-dependency
And indeed, adding a test for it detects the failure.
parent f62e6fe0
...@@ -3,3 +3,9 @@ ...@@ -3,3 +3,9 @@
(incf *dd*) (incf *dd*)
(format t "Loaded defsystem-dependency.lisp ~d time~(~:*~p~)~%" *dd*) (format t "Loaded defsystem-dependency.lisp ~d time~(~:*~p~)~%" *dd*)
(setf (find-class 'asdf::my-cl-source-file) (find-class 'cl-source-file)) (setf (find-class 'asdf::my-cl-source-file) (find-class 'cl-source-file))
(eval-when (:compile-toplevel :load-toplevel :execute)
(defvar *cdd* 0))
(eval-when (:compile-toplevel :execute)
(incf *cdd*))
(in-package :asdf-test) (in-package :asdf-test)
(defvar *od* 0) (defvar *od* 0)
(incf *od*) (incf *od*)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defvar *cod* 0))
(eval-when (:compile-toplevel :execute)
(incf *cod*))
...@@ -8,14 +8,16 @@ ...@@ -8,14 +8,16 @@
(defvar *dd* 0) (defvar *dd* 0)
(defvar *id* 0) (defvar *id* 0)
(defvar *ms* 0) (defvar *ms* 0)
(defvar *cod* 0)
(defvar *cdd* 0)
(defun reset-vars (&optional (x 0)) (defun reset-vars (&optional (x 0))
(setf *od* x *dd* x *id* x *ms* x)) (setf *od* x *dd* x *id* x *ms* x *cod* x *cdd* x))
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0)) (assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(DBG "Finding main-system doesn't load defsystem-dependency") (DBG "Finding main-system doesn't load defsystem-dependency")
(reset-vars) (reset-vars)
(find-system "main-system") (find-system "main-system")
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0)) (assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(DBG "Finding intermediate-dependency does load defsystem-dependency") (DBG "Finding intermediate-dependency does load defsystem-dependency")
(reset-vars) (reset-vars)
...@@ -25,12 +27,18 @@ ...@@ -25,12 +27,18 @@
(DBG "Loading main-system doesn't reload defsystem-dependency or overlapping-dependency") (DBG "Loading main-system doesn't reload defsystem-dependency or overlapping-dependency")
(reset-vars) (reset-vars)
(load-system "main-system") (load-system "main-system")
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 1 1)) (assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 1 1 0 0))
(DBG "Loading main-system a second time doesn't reload anything") (DBG "Loading main-system a second time doesn't reload anything")
(reset-vars) (reset-vars)
(load-system "main-system") (load-system "main-system")
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0)) (assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(DBG "Loading main-system in a different session loads but doesn't recompile")
(reset-vars)
(asdf::clear-registered-systems)
(load-system "main-system")
(assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(1 1 1 1 0 0))
(DBG :foo (DBG :foo
(component-sideway-dependencies (find-system "intermediate-dependency")) (component-sideway-dependencies (find-system "intermediate-dependency"))
...@@ -55,3 +63,4 @@ ...@@ -55,3 +63,4 @@
;; This is what causes an issue without phase escalation: ;; This is what causes an issue without phase escalation:
(test-system "defsystem-dependency")) (test-system "defsystem-dependency"))
(assert-equal *dd* 10) (assert-equal *dd* 10)
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