[MacPorts] #57528: dvisvgm: parallel builds hang, during execution of 'touch -r'

MacPorts noreply at macports.org
Fri Dec 24 15:47:45 UTC 2021


#57528: dvisvgm: parallel builds hang, during execution of 'touch -r'
----------------------+----------------------------------
  Reporter:  dershow  |      Owner:  mascguy
      Type:  defect   |     Status:  reopened
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:
Resolution:           |   Keywords:  local-testing-needed
      Port:  dvisvgm  |
----------------------+----------------------------------

Comment (by ballapete):

 `doc/Makefile.am` has this block:

 {{{
 dvisvgm.1: dvisvgm-man.xml $(CONF_DBLATEX_MAN)
         xmlto -m $(CONF_DBLATEX_MAN) $(addprefix --stringparam ,
 $(DB_VARS)) man $<

 dvisvgm.pdf: dvisvgm-man.xml dvisvgm.sty $(CONF_DBLATEX_PDF)
 $(TWEAK_DBLATEX_PDF) $(TWEAK_DBLATEX_TEX)
         mv $< $<.tmp
         xsltproc -o $< $(TWEAK_DBLATEX_PDF) $<.tmp
         dblatex -bxetex --texstyle=./dvisvgm.sty -p $(CONF_DBLATEX_PDF) -r
 plugin:$(basename $(TWEAK_DBLATEX_TEX)) $<
         mv $<.tmp $<
         mv $(basename $<).pdf $@

 dvi-pdf: dvisvgm.dvi
         dvipdfm $<
         rm -f $<

 dvisvgm.dvi: dvisvgm.1
         groff -Tdvi -mandoc ./$< >$@

 dvisvgm.html: dvisvgm-man.xml db2html.xsl
         xsltproc -o $@ db2html.xsl $<

 dvisvgm.md: dvisvgm-man.xml db2md.xsl
         xsltproc -o $@ db2md.xsl $<

 dvisvgm.epub: dvisvgm-article.xml
         a2x -darticle -fepub -L --icons --icons-dir=. $<
         mv $(basename $<).epub $@

 .SECONDARY: dvisvgm-article.xml dvisvgm-man.xml dvisvgm.sty

 dvisvgm-man.xml: dvisvgm.txt $(TWEAK_DB_REFENTRY)
         asciidoc -a icons -a 'iconsdir=.' -a badges -a
 'revnumber=@VERSION@' --unsafe -bdocbook -dmanpage -o $@.tmp $<
         xsltproc -o $@ $(TWEAK_DB_REFENTRY) $@.tmp
         rm $@.tmp

 dvisvgm-article.xml: dvisvgm.txt $(TWEAK_DB_ARTICLE)
         asciidoc -a icons -a 'iconsdir=.' -a badges -a
 'revnumber=@VERSION@' --unsafe -bdocbook -darticle -o $@.tmp $<
         xsltproc -o $@ $(TWEAK_DB_ARTICLE) $@.tmp
         rm $@.tmp
         sed -i "s/{VERSION}/@VERSION@/" $@

 dvisvgm.sty: dvisvgm-man.xml $(GEN_DBLATEX_STY)
         xsltproc -o dvisvgm.sty $(GEN_DBLATEX_STY) $<

 dvisvgm.txt: dvisvgm.txt.in ../configure.ac
         sed -e 's/@VERSION[@]/@VERSION@/g' -e
 's/@PACKAGE_BUGREPORT[@]/@PACKAGE_BUGREPORT@/g' $< >$@
         if [ $< -nt ../configure.ac ]; \
         then gtouch -r $< $@; \
         else gtouch -r ../configure.ac $@; \
         fi
 }}}

 Obviously `make` understands that target `dvisvgm.1` depends on `dvisvgm-
 man.xml` which depends on `dvisvgm.txt`, so it tries to build this target
 first. It executes the `sed` command and then compares the two files to
 find out which of them is newer (`if [ dvisvgm.txt.in -nt ../configure.ac
 ];`). In the beginning these two files exist:

 {{{
 -rw-r--r-- 1 macports  8409 2021-08-16 12:07:38.000000000 +0200
 doc/../configure.ac
 -rw-r--r-- 1 macports 61026 2021-08-16 12:07:38.000000000 +0200
 doc/dvisvgm.txt.in
 }}}

 and have exactly the same date, IMO. Hard to decide which path to go – but
 this is not the thing that is making `/usr/bin/make` fall into the
 infinite loop. Because both `make` and `gmake` adjust the `sed` produced
 `dvisvgm.txt` file to become the same date as the other two:

 {{{
 -rw-r--r-- 1 macports  8409 2021-08-16 12:07:38.000000000 +0200
 doc/../configure.ac
 -rw-r--r-- 1 macports 61026 2021-08-16 12:07:38.000000000 +0200
 doc/dvisvgm.txt.in
 -rw-r--r-- 1 macports 61025 2021-08-16 12:07:38.000000000 +0200
 doc/dvisvgm.txt
 }}}

 `gmake` leaves here the doc directory

 {{{
 gmake[2]: Entering directory
 '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_dvisvgm/dvisvgm/work
 /mgieseki-dvisvgm-2e94568/doc'
 sed -e 's/@VERSION[@]/2.12/g' -e
 's/@PACKAGE_BUGREPORT[@]/martin.gieseking at uos.de/g' dvisvgm.txt.in
 >dvisvgm.txt
 if [ dvisvgm.txt.in -nt ../configure.ac ]; \
 then gtouch -r dvisvgm.txt.in dvisvgm.txt; \
 else gtouch -r ../configure.ac dvisvgm.txt; \
 fi
 gmake[2]: Leaving directory
 '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_dvisvgm/dvisvgm/work
 /mgieseki-dvisvgm-2e94568/doc'
 gmake[2]: Entering directory
 '/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_graphics_dvisvgm/dvisvgm/work
 /mgieseki-dvisvgm-2e94568'
 }}}

 while `make` hangs.

 {{{
 In the beginning all files in doc have exactly the same date:
 And with `gmake` and `make`, when I kill it, quite the same (even
 Makefile*):
 -rw-r--r-- 1 macports 21971 2021-12-24 16:15:09.881157339 +0100 Makefile
 -rw-r--r-- 1 macports 21100 2021-12-24 16:14:55.851002661 +0100
 Makefile.in
 -rw-r--r-- 1 macports  3680 2021-12-24 16:09:26.290946965 +0100
 Makefile.am
 -rw-r--r-- 1 macports  2554 2021-08-16 12:07:38.000000000 +0200
 caution.png                     -rw-r--r-- 1 macports  2554 2021-08-16
 12:07:38.000000000 +0200 caution.png
 -rw-r--r-- 1 macports   718 2021-08-16 12:07:38.000000000 +0200 conf-
 dblatex-man.xsl            -rw-r--r-- 1 macports   718 2021-08-16
 12:07:38.000000000 +0200 conf-dblatex-man.xsl
 -rw-r--r-- 1 macports  2618 2021-08-16 12:07:38.000000000 +0200 conf-
 dblatex-pdf.xsl            -rw-r--r-- 1 macports  2618 2021-08-16
 12:07:38.000000000 +0200 conf-dblatex-pdf.xsl
 -rw-r--r-- 1 macports  5855 2021-08-16 12:07:38.000000000 +0200
 db2html.xsl                     -rw-r--r-- 1 macports  5855 2021-08-16
 12:07:38.000000000 +0200 db2html.xsl
 -rw-r--r-- 1 macports 67474 2021-08-16 12:07:38.000000000 +0200 dvisvgm.1
 -rw-r--r-- 1 macports 67474 2021-08-16 12:07:38.000000000 +0200 dvisvgm.1
 -rw-r--r-- 1 macports   497 2021-08-16 12:07:38.000000000 +0200
 dvisvgm.css                     -rw-r--r-- 1 macports   497 2021-08-16
 12:07:38.000000000 +0200 dvisvgm.css
 -rw-r--r-- 1 macports 61025 2021-08-16 12:07:38.000000000 +0200
 dvisvgm.txt
 -rw-r--r-- 1 macports 61026 2021-08-16 12:07:38.000000000 +0200
 dvisvgm.txt.in                  -rw-r--r-- 1 macports 61026 2021-08-16
 12:07:38.000000000 +0200 dvisvgm.txt.in
 -rw-r--r-- 1 macports   963 2021-08-16 12:07:38.000000000 +0200
 dvisvgm.xpr                     -rw-r--r-- 1 macports   963 2021-08-16
 12:07:38.000000000 +0200 dvisvgm.xpr
 -rw-r--r-- 1 macports   840 2021-08-16 12:07:38.000000000 +0200 generate-
 dvisvgm-sty.xsl        -rw-r--r-- 1 macports   840 2021-08-16
 12:07:38.000000000 +0200 generate-dvisvgm-sty.xsl
 -rw-r--r-- 1 macports  2730 2021-08-16 12:07:38.000000000 +0200 note.png
 -rw-r--r-- 1 macports  2730 2021-08-16 12:07:38.000000000 +0200 note.png
 -rw-r--r-- 1 macports  1013 2021-08-16 12:07:38.000000000 +0200 tweak-db-
 article.xsl            -rw-r--r-- 1 macports  1013 2021-08-16
 12:07:38.000000000 +0200 tweak-db-article.xsl
 -rw-r--r-- 1 macports  1698 2021-08-16 12:07:38.000000000 +0200 tweak-db-
 refentry.xsl           -rw-r--r-- 1 macports  1698 2021-08-16
 12:07:38.000000000 +0200 tweak-db-refentry.xsl
 -rw-r--r-- 1 macports  1041 2021-08-16 12:07:38.000000000 +0200 tweak-
 dblatex-pdf.xsl           -rw-r--r-- 1 macports  1041 2021-08-16
 12:07:38.000000000 +0200 tweak-dblatex-pdf.xsl
 -rw-r--r-- 1 macports   717 2021-08-16 12:07:38.000000000 +0200 tweak-
 dblatex-tex.py            -rw-r--r-- 1 macports   717 2021-08-16
 12:07:38.000000000 +0200 tweak-dblatex-tex.py
 }}}

 So all make's make only one file, `dvisvgm.txt` (because nothing more that
 does not exist yet is needed by any make target), and give it the `date of
 dvisvgm.txt.in or ../configure.ac`, which is essentially the same. `gmake`
 now leaves successfuly the doc directory while `make` obviously stays
 there and goes mad therefore.

 The problem might not be due to a parallel build…

-- 
Ticket URL: <https://trac.macports.org/ticket/57528#comment:34>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list