bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] po: fix a race in dist2 targets


From: Lubomir Rintel
Subject: [PATCH] po: fix a race in dist2 targets
Date: Mon, 27 Jun 2022 15:07:13 +0200

With parallel make, it is possible that $(GMOFILES) are remade by two
jobs concurrently:

  DISTFILES = ... $(GMOFILES) ...

  dist2: $(srcdir)/stamp-po $(DISTFILES)
          ...

The dist2 target above will cause stamp-po and $(DISTFILES) to be remade
concurrently. $(DISTFILES) contain $(GMOFILES)

  $(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot
          ...
          test ! -f $(srcdir)/$(DOMAIN).pot || \
            test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)

Here $(GMOFILES) are again remade, while the first invocation might be
running.

Note that this race is only hit with DIST_DEPENDS_ON_UPDATE_PO=no,
because the update-po target can remake GMO files prior to start of
dist2 target.

* gettext-runtime/po/Makefile.in.in (dist2): make $(DISTFILES) from
within the dist2 target instead of depending on them.
---
 gettext-runtime/po/Makefile.in.in | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gettext-runtime/po/Makefile.in.in 
b/gettext-runtime/po/Makefile.in.in
index 6b25f0d91..d4d20093c 100644
--- a/gettext-runtime/po/Makefile.in.in
+++ b/gettext-runtime/po/Makefile.in.in
@@ -414,7 +414,8 @@ dist distdir:
        test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
        @$(MAKE) dist2
 # This is a separate target because 'update-po' must be executed before.
-dist2: $(srcdir)/stamp-po $(DISTFILES)
+dist2: $(srcdir)/stamp-po
+       $(MAKE) $(DISTFILES)
        @dists="$(DISTFILES)"; \
        if test "$(PACKAGE)" = "gettext-tools"; then \
          dists="$$dists Makevars.template"; \
-- 
2.36.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]