At Fri, 30 Nov 2007 08:11:17 +0000,
Christophe Rhodes wrote:
> My feeling is that rebinding *break-on-signals* in application code is
> unlikely ever to be a good idea.
I can see that.
Actually I've had another solution, introducing a monotonically
increasing counter for the purposes of temporary package generation
inside ASDF, but then I've remembered somebody handholding me into the
rebind-*b-o-s* solution, and the reasons which determined that choice
-- concurrent package loading might still trigger *b-o-s*, in the absence
of multithreading synchronisation being dealt with.
However, I can see your point about rebinding *break-on-signals* in
application code, so, perhaps we can reformulate the aim to be reduction,
instead of elimination, of package collisions.
So, will the other patch be acceptable instead?
> (If you get hit by that signal too
> often, you could run ASDF:FIND-SYSTEM on systems you care about before
> setting *BREAK-ON-SIGNALS*).
Either I'm misunderstanding what you imply here, or I'm in need to
make a clarification of the actual source of the problem.
One of the issues this patch fixes was an actual annoyance I encountered
on the wild -- namely a constituent source file of an ASDF system calling
REQUIRE, which triggered a detached ASDF package loading pass, with the
temp package counter set to zero, resulting in a collision and a signal.
That, I think, illustrates why ASDF:FIND-SYSTEM won't help much.
regards, Samium Gromoff
diff --git a/contrib/asdf/asdf.lisp b/contrib/asdf/asdf.lisp
@@ -351,6 +351,8 @@ and NIL NAME and TYPE components"
+(defvar *package-generation-counter* 0)
(defun sysdef-central-registry-search (system)
(let ((name (coerce-name system)))
@@ -368,8 +370,9 @@ and NIL NAME and TYPE components"
(make-package (format nil "ASDF~D" counter)
:use '(:cl :asdf)))))
- (do* ((counter 0 (+ counter 1))
- (package (try counter) (try counter)))
+ (declare (special *package-generation-counter*))
+ (do* ((*package-generation-counter* (incf *package-generation-counter*))
+ (package (try *package-generation-counter*) (try *package-generation-counter*)))
(defun find-system (name &optional (error-p t))