Commit 4ed76c32 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 b7651034
......@@ -3,3 +3,9 @@
(incf *dd*)
(format t "Loaded defsystem-dependency.lisp ~d time~(~:*~p~)~%" *dd*)
(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)
(defvar *od* 0)
(incf *od*)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defvar *cod* 0))
(eval-when (:compile-toplevel :execute)
(incf *cod*))
......@@ -8,14 +8,16 @@
(defvar *dd* 0)
(defvar *id* 0)
(defvar *ms* 0)
(defvar *cod* 0)
(defvar *cdd* 0)
(defun reset-vars (&optional (x 0))
(setf *od* x *dd* x *id* x *ms* x))
(assert-equal (list *od* *dd* *id* *ms*) '(0 0 0 0))
(setf *od* x *dd* x *id* x *ms* x *cod* x *cdd* x))
(assert-equal (list *od* *dd* *id* *ms* *cod* *cdd*) '(0 0 0 0 0 0))
(DBG "Finding main-system doesn't load defsystem-dependency")
(reset-vars)
(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")
(reset-vars)
......@@ -25,12 +27,18 @@
(DBG "Loading main-system doesn't reload defsystem-dependency or overlapping-dependency")
(reset-vars)
(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")
(reset-vars)
(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
(component-sideway-dependencies (find-system "intermediate-dependency"))
......@@ -55,3 +63,4 @@
;; This is what causes an issue without phase escalation:
(test-system "defsystem-dependency"))
(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