<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 14 Apr 2021, at 18:38, Attila Lendvai wrote:</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">FTR, i have managed to solve it with this:<br>
<br>
(defclass generate-lisp-op (selfward-operation)<br>
  ((selfward-operation :initform '()))) ; we will specify it in our own<br>
COMPONENT-DEPENDS-ON<br>
<br>
(defmethod component-depends-on ((op generate-lisp-op) (c c2ffi-file))<br>
  `((load-op ,(find-system "cffi/c2ffi-generator"))<br>
    ;; Regenerating the spec file is a lot of headache, so we ignore<br>
    ;; the file modification times, and only communicate the<br>
    ;; dependency to ASDF if the spec file is missing.<br>
    ,@(let ((spec-file (input-file op c))) ; TODO is it legal to call<br>
ASDF:INPUT-FILES here?<br>
        (when (or (not (probe-file spec-file))<br>
                  (zerop (with-input-from-file (s spec-file)<br>
                           (file-length s))))<br>
          `((generate-spec-op ,c))))<br>
    ,@(call-next-method)))<br>
<br>
the commit:<br>
<a href="https://github.com/cffi/cffi/commit/46975c644aeb0a832cd170e953cc8ec3cbdc78df" style="color:#777">https://github.com/cffi/cffi/commit/46975c644aeb0a832cd170e953cc8ec3cbdc78df</a></p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">I was wondering why it was important to avoid the build when the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.h</code> file is newer than the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.spec</code> file.  This shouldn't happen very often, should it?  Is it because:</p>

<ol>
<li value="1"><p dir="auto">The <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.h</code> file is getting refreshed too often by something upstream of ASDF?  E.g., is <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">make</code> being too eager about rewriting the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.h</code> file?</p></li>
<li value="2"><p dir="auto">There is something wrong in the ASDF dependencies?  Is it possible that there was an extraneous dependency on the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.spec</code> file that was causing it to mistakenly think it needed refreshing when some component upstream in the ASDF system was modified?  E.g., was this in a <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">:serial</code> system so that other changes were causing ASDF to be too eager about re-generating the spec file?</p></li>
</ol>

<p dir="auto">I don't have any great ideas about fixing the problem if it's caused by something outside ASDF, but if the second explanation is the case, it would be worth investigating further so that you don't need to make this change (and can regenerate the spec file when the header file is updated without causing lots of wasted work).  I hate to see this kind of spoofing, because it can so easily lead to confusing and hard-to-debug issues later on when the <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.h</code> file really <em>does</em> change and ASDF ignores the change.</p>

<p dir="auto">If it is something outside ASDF that's rewriting the header file when it's not necessary then you could do something more sophisticated and squirrel away a copy of the old <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">.h</code> file and use <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">diff</code> or <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">cmp</code> in <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">operation-done-p</code>.</p>

<p dir="auto">Best,<br>
R</p>

</div>
<div style="white-space:normal"><blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px"><p dir="auto">- attila<br>
<br>
PS: sorry for the double send, i have cleaned up my mail settings.</p>
</blockquote></div>
<div style="white-space:normal">

<p dir="auto">Don't worry about the double send: you are now cleared to submit emails from either of your email accounts, so even if you send from the wrong account, it should turn up OK.</p>
</div>
</div>
</body>
</html>