Hi Rob,

Rob Browning <[email protected]> skribis:

> To fix this, we can change compiled_is_fresh in load.c to require the
> .go to be strictly newer than the corresponding .scm, i.e. change the <=
> to < here:
>
>   if (source_mtime.tv_sec < compiled_mtime.tv_sec
>       || (source_mtime.tv_sec == compiled_mtime.tv_sec
>           && source_mtime.tv_nsec <= compiled_mtime.tv_nsec))
>     compiled_is_newer = 1;
>   ...
>
> and in more-recent? in boot-9.scm, change >= to > here:
>
>         (and (= (stat:mtime stat1) (stat:mtime stat2))
>              (>= (stat:mtimensec stat1)
>                  (stat:mtimensec stat2)))))

While this change is justified by the examples you gave, I think it
would cause problems you wouldn’t expect.

In particular, in Guix and Nix, timestamps on build artifacts are reset
to the Epoch + 1 second, for reproducibility purposes.  This means that
.scm and .go files have the exact same timestamp.

With the change above, all .go files would be considered stale and Guile
would end up auto-recompiling everything.

So I think we’ll have to leave that unchanged.

Now, I would hope that the problem you describe is rare enough in
practice that this is not too much of a problem?

Thanks,
Ludo’.



Reply via email to