[Top][All Lists]

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

[PATCH] maint: avoid spurious "make distcheck" failure

From: Jim Meyering
Subject: [PATCH] maint: avoid spurious "make distcheck" failure
Date: Tue, 20 Jun 2017 13:49:11 -0700

I've been annoyed by this subtle bug more than a few times over the
years, so have finally diagnosed it.  Here's one way to fix it:

>From a05ba352d39a6e6a0c58d57f4b7acbb1e4f11f8b Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Tue, 20 Jun 2017 07:53:17 -0700
Subject: [PATCH] maint: avoid spurious "make distcheck" failure

When the generated file, doc/constants.texi, happens to be older than
doc/, it will not be updated until/unless its generated
contents change.  This is due to way that rule is careful to update
the file, to avoid provoking a pointless rerunning of makeinfo.

Note that this does not happen when one first runs "make distclean",
as recommended in README-release.  However, I sometimes run it as
a more-rigorous "make check", and shouldn't have to manually run
"make distclean" first, in that case.

Before this change, one could reproduce the failure by running
`touch -dyesterday doc/constants.texi && make distcheck`.  It would
fail with "makeinfo: could not open ../../doc/
for writing: Permission denied"
* (dist-hook): Touch the two generated files, so that
they are cannot be out of date wrt doc/coreutils.texi.
--- | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ b/
index 68f537cef..396112f0c 100644
--- a/
+++ b/
@@ -90,11 +90,14 @@ BUILT_SOURCES = .version
 # Have .timestamp based dates only in tarball builds.
 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
 # See the rm_subst comment for details.
+# The touch avoids a subtle, spurious "make distcheck" failure.
 dist-hook: gen-ChangeLog
        $(AM_V_GEN)chmod -R +rw $(distdir)
        $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
        $(AM_V_GEN)date +%s > $(distdir)/.timestamp
        $(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/
+       $(AM_V_at)touch $(distdir)/doc/constants.texi \
+         $(distdir)/doc/

 gen_start_ver = 8.15
 .PHONY: gen-ChangeLog

reply via email to

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