Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
On 2018/07/15 07:44:32, trueroad wrote: 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 10:21:51, Dan Eble wrote: > On 2018/07/14 08:22:49, trueroad wrote: > > Unfortunately, we cannnot specify an output filename for LaTeX. > I'm fine with the current solution of a different directory, but I think one can specify an output filename for LaTeX. At least in my makefiles I do with the --jobname option Thanks, Carl https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
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 10:21:51, Dan Eble wrote: On 2018/07/14 08:22:49, trueroad wrote: > Unfortunately, we cannnot specify an output filename for LaTeX. How about creating the intermediate file in a different directory? Would that solve the problem? Done. https://codereview.appspot.com/357760043/diff/20001/stepmake/stepmake/texinfo-rules.make File stepmake/stepmake/texinfo-rules.make (right): https://codereview.appspot.com/357760043/diff/20001/stepmake/stepmake/texinfo-rules.make#newcode70 stepmake/stepmake/texinfo-rules.make:70: ifeq ($(WEB_VERSION),yes) On 2018/07/14 10:31:33, Dan Eble wrote: Is the only difference between the two long commands in these alternatives "-D web_version"? How about something like the following? TEXI2PDF_WEB_VERSION_FLAGS := ifeq ($(WEB_VERSION),yes) TEXI2PDF_WEB_VERSION_FLAGS += -D web_version endif $(outdir)/%.pdf: $(outdir)/%.texi [...] [...] $(TEXI2PDF_FLAGS) $(TEXI2PDF_WEB_VERSION_FLAGS) [...] Done. https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
https://codereview.appspot.com/357760043/diff/20001/stepmake/stepmake/texinfo-rules.make File stepmake/stepmake/texinfo-rules.make (right): https://codereview.appspot.com/357760043/diff/20001/stepmake/stepmake/texinfo-rules.make#newcode70 stepmake/stepmake/texinfo-rules.make:70: ifeq ($(WEB_VERSION),yes) Is the only difference between the two long commands in these alternatives "-D web_version"? How about something like the following? TEXI2PDF_WEB_VERSION_FLAGS := ifeq ($(WEB_VERSION),yes) TEXI2PDF_WEB_VERSION_FLAGS += -D web_version endif $(outdir)/%.pdf: $(outdir)/%.texi [...] [...] $(TEXI2PDF_FLAGS) $(TEXI2PDF_WEB_VERSION_FLAGS) [...] https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
On 2018/07/14 08:22:49, trueroad wrote: Unfortunately, we cannnot specify an output filename for LaTeX. I thought -jobname works for that. It also affects all temporary files, however. https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
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 08:22:49, trueroad wrote: Unfortunately, we cannnot specify an output filename for LaTeX. How about creating the intermediate file in a different directory? Would that solve the problem? https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
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
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
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 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. https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
Thank you for your reviewing. On 2018/07/14 06:49:26, lemzwerg wrote: LGTM, thanks! Two minor suggestions: s/intermediate/tmp/, since this is shorter. Please wrap the extremely long lines in the makefiles for improved readability. Done. https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Issue 5381: Change intermediate PDF filename (issue 357760043 by truer...@gmail.com)
LGTM, thanks! Two minor suggestions: s/intermediate/tmp/, since this is shorter. Please wrap the extremely long lines in the makefiles for improved readability. https://codereview.appspot.com/357760043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel