automake-patches
[Top][All Lists]
Advanced

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

[FYI 2/2] {maint} vala: avoid potential useless remakes (minor bugfix)


From: Stefano Lattarini
Subject: [FYI 2/2] {maint} vala: avoid potential useless remakes (minor bugfix)
Date: Mon, 16 Jan 2012 16:52:32 +0100

* automake.in (lang_vala_finish_target): Ensure the timestamp file
from which the C files generated from Vala sources depend on gets
created with a modification time that is truly older than those of
said generated C files.  This prevents make from attempting useless
rebuilds (which were bound to happen deterministically on systems
with sub-second timestamp resolutions).  It is worth noting that,
luckily, those useless rebuild ended up being a no-op, since the
Vala compiler is careful not to update the timestamp of an output
file if its content has not changed from the previous version.
Still, the useless rebuilds messed up "make -q" and "make -n"
invocations, and were technically incorrect (despite being, as
noted, inoffensive in practice).

Problem revealed by failure of tests vala-mix.test and vala5.test
on a fast Solaris 10 system whose filesystem had a sub-second
timestamp resolution.
---
 automake.in |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/automake.in b/automake.in
index eb859e2..50a9d87 100644
--- a/automake.in
+++ b/automake.in
@@ -6077,8 +6077,15 @@ sub lang_vala_finish_target ($$)
 
   $output_rules .=
     "\$(srcdir)/${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
+# Since the C files generated from the vala sources depend on the
+# ${derived}_vala.stamp file, we must ensure its timestamp is older than
+# those of the C files generated by the valac invocation below (this is
+# especially important on systems with sub-second timestamp resolution).
+# Thus we need to create the stamp file *before* invoking valac, and to
+# move it to its final location only after valac has been invoked.
+    "\t${silent}rm -f \$@ && echo stamp > address@hidden".
     "\t${verbose}\$(am__cd) \$(srcdir) && ${compile} \$(${derived}_SOURCES)\n".
-    "\t${silent}touch address@hidden";
+    "\t${silent}mv -f address@hidden address@hidden";
 
   push_dist_common ("${derived}_vala.stamp");
 
-- 
1.7.7.3




reply via email to

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