Thank you for your reviewing.
https://codereview.appspot.com/357760043/diff/20001/make/lilypond-book-rules.make File make/lilypond-book-rules.make (right): https://codereview.appspot.com/357760043/diff/20001/make/lilypond-book-rules.make#newcode33 make/lilypond-book-rules.make:33: mv $@ $(outdir)/$*.tmp.pdf On 2018/07/14 07:43:14, dak wrote:
This appears to change the output name after the fact. It would still
create
the output under the final name and when a) some parallel Make goes looking for it, it will find it existing
and new
b) the script aborts while the file is still there the problem, if any, would likely persist, possibly with a smaller
time window
for causing trouble.
I think that any solution predicated on USE_EXTRACTPDFMARK would
require an
if/then/else construct rather than an if/then construct in order not
to have
this kind of race condition built-in by producing a file with the
final name,
then doing additional actions on it.
If I understand correctly, GNU make deletes a target file that the recipe was supposed to update when aborted. https://www.gnu.org/software/make/manual/html_node/Interrupts.html#Interrupts Unfortunately, we cannnot specify an output filename for LaTeX. So the patch uses `mv` after outputting the target filename. I have another idea like following. ``` $(outdir)/%.pdf_tmp: $(outdir)/%.tex pdflatex $< mv $(outdir)/$*.pdf $@ $(outdir)/%.pdf: $(outdir)/%.pdf_tmp ifeq ($(USE_EXTRACTPDFMARK),yes) extractpdfmark -o $(outdir)/$*.pdfmark $< gs -sOutputFile=$@ $(outdir)/$*.pdfmark $< else cp $< $@ endif ``` How about this? https://codereview.appspot.com/357760043/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel