From: Jaroslav Škarvada Date: Tue, 8 Jun 2021 20:43:53 +0000 (+0200) Subject: gv: fixed possible races during docs build X-Git-Tag: 2.47.3~1^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4cbffb7ed25e076b34db69ed664364a8db09ce3;p=graphviz gv: fixed possible races during docs build In tclpkg/gv, the gv_doc_writer.tcl is run multiple times during the build. It is ineffective, but it shouldn't cause any troubles with the serial build. Unfortunately, this is not the case with the parallel builds where multiple parallel runs of the gv_doc_writer.tcl can cause races leading to empty corresponding ps and pdf files. The correct solution would be to use the Rules with Grouped Targets [1], unfortunately this GNU make feature has been introduced quite recently which would break backward compatibility. The proposed hack should cause the gv_doc_writer.tcl to be run only once during the build process and it should work also with the older 'make'. It is inspired by [2]. [1] https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html#Multiple-Targets [2] https://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file Signed-off-by: Jaroslav Škarvada --- diff --git a/tclpkg/gv/Makefile.am b/tclpkg/gv/Makefile.am index 476b0fcfc..14d7221f6 100644 --- a/tclpkg/gv/Makefile.am +++ b/tclpkg/gv/Makefile.am @@ -433,7 +433,10 @@ else pdf = endif -$(man): gv.i gv_doc_writer.tcl gv_doc_template.tcl gv_doc_langs.tcl +$(man): gv_doc_writer.intermediate ; + +.INTERMEDIATE: gv_doc_writer.intermediate +gv_doc_writer.intermediate: gv.i gv_doc_writer.tcl gv_doc_template.tcl gv_doc_langs.tcl $(TCLSH) $(srcdir)/gv_doc_writer.tcl "$(srcdir)" if ENABLE_MAN_PDFS