Re: db-sockets.asd patch and asdf question

John DeSoi <[email protected]>
Newsgroups gmane.lisp.cclan.general
Message-ID <a05100300b92d1a9dc318@[192.168.1.6]>
>
>>  Am I correct in observing that asdf verifies that every component of a
>>  system is built and up to date before loading the system?  If so, is
>>  this ultimately going to scale badly to large systems with lots of
>>  files?  Would it make any sense to explicitly distinguish build and
>>  load operations and make the default load op a quicker op that assumes
>>  the system is built?
>
>Yes, it does.  I'm not sure how big a system has to be before this
>really starts breaking down, but it basically means a stat() call on
>each file in the system.  The implementation may or may not be doing
>another stat() call of its own as part of LOAD so that it can warn
>about source file being newer than object file.


I am also in need of a load-only solution, not because of system size 
but in the case where sources cannot be distributed for everything. I 
mucked around with this yesterday and came up with the solution 
below. I just started looking at asdf, so I'm sure there are a lot of 
issues I have not covered. But it at least allows the binaries to be 
loaded without the sources and gives an error if a binary file is not 
found.

Is component-depends-on correct? This is more or less a copy/edit of 
the load-op. Any other problems with it?

Thanks,


John DeSoi, Ph.D.



====

(defclass load-compiled-op (operation) ())

(export 'load-compiled-op)

(defmethod perform ((o load-compiled-op) (c cl-source-file))
   (let* ((output-files (output-files o c))
          (result (map nil #'load output-files)))
     (setf (component-property c 'last-loaded) (file-write-date (car 
output-files)))
     result))

(defmethod perform ((operation load-compiled-op) (c static-file))
   nil)

;this is a local customization to keep bin files separate by lisp compiler
(defmethod output-files ((operation load-compiled-op) (c cl-source-file))
   (let* ((c-path (component-pathname c)))
     (list (make-pathname
            :host (pathname-host c-path)
            :directory (append (list :absolute "bin" 
(lisp-implementation-type)) (rest (pathname-directory c-path)))
            :defaults (compile-file-pathname c-path)))))

(defmethod component-depends-on ((operation load-compiled-op) (c component))
   (call-next-method))


(defmethod operation-done-p ((o load-compiled-op) (c source-file))
   (if (component-property c 'last-loaded) t nil))

_______________________________________________________________

Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.