[Omake] Set of changed files

Aleksey Nogin nogin at metaprl.org
Tue May 6 14:06:22 PDT 2008


Luis,

Yes, LaTeX fixpoints require some additional mechanisms and we still 
have not figured out what the best way would be. But I think that we 
have two separate issues here:

- The "fixpoint" dependency "a.dvi ::: b.aux" - see 
http://bugzilla.metaprl.org/show_bug.cgi?id=86 on that one.

- The normal dependency chain "a.dvi: a.bbl: x.bib a.aux", but with a 
few twists:
    - The "a.dvi: a.bbl" and "a.bbl: x.bib" dependencies are not always 
present, so that need to be detected by a scanner rule (no need for a 
new OMake mechanism, though).
    - The "a.bbl: a.aux: a.tex" is a normal dependency chain, but the 
"soft" dependencies mechanism ought to be able to interact correctly 
with it.

In other words, I believe that the latex and the bibtex rules ought to 
be separate:

%.dvi %.aux: %.tex :scanner: latex-%.tex
     latex $<

%.bbl: %.tex :scanner: latex-%.tex
     bibtex $*

.SCANNER: latex-%.tex: %.tex
     latex -recorder %<
     ...
     if "%.aux refers to x.bib"
        println($"%.dvi %.aux: %.bbl")
        println($"%.bbl: %.aux x.bib")

%.dvi %.aux ::: %.aux # The bug 86 "soft dependency".

Aleksey

On 06.05.2008 13:31, Luis O'Shea wrote:

> Aleksey Nogin wrote:
>> On 05.05.2008 18:51, Luis O'Shea wrote:
>>
>>> Is there a way for a rule to find out which of its dependencies have
>>> changed?  (This is not idle curiosity -- I actually need it.)
>>
>> I believe that this information is not readily available in current 
>> OMake. How do you need to use this information - perhaps there is some 
>> alternative way to do what you need?
> 
> I would like to implement a simple fixed point build within omake (see 
> http://lists.metaprl.org/pipermail/omake/2007-March/001505.html) to aid 
> in compiling LaTeX documents.
> 
> Suppose you have a document a.tex and a bibliography x.bib, then a 
> typical run to produce the final DVI would look like
> 
>   latex a
>   bibtex a
>   latex a
>   latex a
> 
> Things can get more complicated than the above, of course.
> 
> The current approach (as implemented in LaTeX.om) has the following issues:
>  1) It does not detect changes to x.bib
>  2) It decides whether to rerun latex by regexing for certain output 
> from latex.  This means that it will not work properly with biblatex 
> (since it produces different output).
> 
> One possible solution is to build a latex document using a rule that 
> computes the digests of its dependencies and then keeps running latex 
> until the digests stabilize.  This solves (2).
> 
> Bibtex complicates things because we would like to only re-latex if 
> necessary.  For example, if an additional and irrelevant entry is added 
> to x.bib it would be nice if it would result in "bibtex a" being 
> executed, but no further runs of latex.  It seems to me that if a rule 
> could determine which dependencies caused it run, then it could do this. 
>  The logic, in terms of a new omake function "changed", would go 
> something like this (I'm sure my code has bugs, though):
> 
> # pseudo omake
> a.dvi: a.tex x.bib a.aux
>   d1 = $(digest-optional a.aux)
>   if $(changed a.tex) or $(changed a.aux)
>     latex a
>   d2 = $(digest-optional a.aux)
>   if $(changed x.bib) or $(changed a.aux) or d1 != d2
>     bibtex a
>     d2 = $(digest-optional a.aux)
>     latex a
>     export d2
>   d3 = $(digest-optional a.aux)
>   if d2 != d3
>     latex a
>     d4 = $(digest-optional a.aux)
>     if d3 != d4
>       latex a
> 
> Thanks,
> 
> Luis
> _______________________________________________
> Omake mailing list
> Omake at metaprl.org
> https://lists.metaprl.org/mailman/listinfo/omake
> 



More information about the Omake mailing list