Comment 0 for bug 1889491

Revision history for this message
Ilya Perminov (iperminov) wrote :

I notice a problem with osicat - every time the system is loaded, wrappers.lisp (and everything that depends on it) gets recompiled. It looks like the problem is caused by a cffi bug: compile-op's input file posix/wrappers.processed-wrapper-file is generated after some compile-op's output files:

CL-USER> (asdf:input-files 'asdf:compile-op (asdf:find-component :osicat '(:posix "wrappers")))

(#P"/quicklisp/dists/quicklisp/software/osicat-20180228-git/posix/wrappers.processed-wrapper-file")

CL-USER> (asdf:output-files 'asdf:compile-op (asdf:find-component :osicat '(:posix "wrappers")))

(#P"/quicklisp/dists/quicklisp/software/osicat-20180228-git/posix/wrappers.fasl"
 #P"/quicklisp/dists/quicklisp/software/osicat-20180228-git/posix/libosicat.so"
 #P"/quicklisp/dists/quicklisp/software/osicat-20180228-git/posix/wrappers__wrapper.o")

".processed-wrapper-file", ".o", and ".so" files are all generated by the same process-op, and ".processed-wrapper-file" is generated last. As a result the input of the compile-op is newer than two of its outputs (unless everything happens within the same millisecond).

The .o and .so files are outputs of compile-op, because of
grovel/asdf.lisp:

;;; Declare the .o and .so files as compilation outputs,
;;; so they get picked up by bundle operations.
#.(when (version<= "3.1.6" (asdf-version))
    '(defmethod output-files ((op compile-op) (c wrapper-file))
      (destructuring-bind (generated-lisp lib-file c-file o-file) (output-files 'process-op c)
        (declare (ignore generated-lisp c-file))
        (multiple-value-bind (files translatedp) (call-next-method)
          (values (append files (list lib-file o-file)) translatedp)))))