From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.comp.sysutils.automake.bugs,gmane.lisp.guile.devel Subject: Re: mtime of installed files Date: Wed, 21 Jul 2010 18:27:46 +0200 Message-ID: <874ofsztod.fsf@gnu.org> References: <87aapmt8w1.fsf@gnu.org> <20100720181416.GB3669@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1279730934 16558 80.91.229.12 (21 Jul 2010 16:48:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 21 Jul 2010 16:48:54 +0000 (UTC) Cc: guile-devel@gnu.org To: bug-automake@gnu.org Original-X-From: bug-automake-bounces+gnu-bug-automake=m.gmane.org@gnu.org Wed Jul 21 18:48:52 2010 Return-path: Envelope-to: gnu-bug-automake@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ObcTU-0008D7-76 for gnu-bug-automake@m.gmane.org; Wed, 21 Jul 2010 18:48:52 +0200 Original-Received: from localhost ([127.0.0.1]:43139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObcTT-0001M4-B7 for gnu-bug-automake@m.gmane.org; Wed, 21 Jul 2010 12:48:51 -0400 Original-Received: from [140.186.70.92] (port=35561 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Obc9F-00046g-Eu for bug-automake@gnu.org; Wed, 21 Jul 2010 12:27:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Obc9D-0007j5-QT for bug-automake@gnu.org; Wed, 21 Jul 2010 12:27:56 -0400 Original-Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:35236) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Obc99-0007hw-2t; Wed, 21 Jul 2010 12:27:51 -0400 X-IronPort-AV: E=Sophos;i="4.55,239,1278280800"; d="scan'208";a="54580683" Original-Received: from laptop-147-210-128-193.labri.fr (HELO nixey) ([147.210.128.193]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 21 Jul 2010 18:27:49 +0200 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Thermidor an 218 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <20100720181416.GB3669@gmx.de> (Ralf Wildenhues's message of "Tue, 20 Jul 2010 20:14:17 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: bug-automake@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports for Automake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-automake-bounces+gnu-bug-automake=m.gmane.org@gnu.org Errors-To: bug-automake-bounces+gnu-bug-automake=m.gmane.org@gnu.org Xref: news.gmane.org gmane.comp.sysutils.automake.bugs:4948 gmane.lisp.guile.devel:10716 Archived-At: Hi Ralf, Ralf Wildenhues writes: > * Ludovic Court=C3=A8s wrote on Tue, Jul 20, 2010 at 06:28:46PM CEST: >> Background: Guile 1.9/2.0 has an auto-compilation feature whereby if a >> source file has no corresponding object file in the search path, or if >> the object file is older than the source file, then the source file is >> automatically recompiled and stored in ~/.cache/guile/ccache. > > I assume this part has nothing to do with Automake per se, right? Right. >> Packages that use Guile can also choose to pre-compile all their source >> files and install both the source and object files. This saves the need >> for users to auto-compile the source. (This is what Guile does with its >> own source files.) > > I assume this, too, is currently done without help of Automake, or make, > for that matter. Correct. >> For this to work, we need =E2=80=9Cmake install=E2=80=9D to guarantee th= e relation >> mtime(installed-object) >=3D mtime(installed-source), assuming we have >> mtime(builddir-object) >=3D mtime(srcdir-source), which will always be t= he >> case unless the computer=E2=80=99s clock is skewed. >>=20 >> Do Automake-generated makefiles provide such a guarantee? Regardless of >> the =E2=80=98make=E2=80=99 implementation, OS, etc.? > > This is actually a tough question; it has little to do with Automake, > much more with any or all of make, tar, cp, touch, install, libc, file > system, and the kernel. > > `info Autoconf --index timestamp' leads to two nodes describing some of > the problems with time stamps. The gist is that in the worst case, any > of the above tools independently may have full or only limited timestamp > resolution (nowadays that would mostly be either nanosecond or 1 second). > Even well-run software distributions without user-compiled tools > typically can't afford to (or don't) update all of these tools at once. Indeed. Thanks for the pointer. [...] > Anyway, most of the time, these issues can be worked around, for example > by sleeping for a second before building builddir objects, or between > installing sources and installing object files, depending on whether > install -C is used or not. The latter would be faster IIUC (sleep 1 second instead of N seconds, with N the number of source files.) The =E2=80=98install=E2=80=99 command is chosen by Automake or the user-spe= cified $INSTALL, so we can=E2=80=99t really determine whether it uses =E2=80=98-C= =E2=80=99, right? > Hope that helps. It might be a bit tricky or ugly to actually put this > sleep command in a normal automake Makefile.am, so if you know what > exactly you need, we can create an example. A typical Makefile.am looks like this: --8<---------------cut here---------------start------------->8--- dist_foobar_SOURCES =3D foo.scm bar.scm nodist_foobar_DATA =3D foo.go bar.go .scm.go: guile-tools compile -o $@ $< --8<---------------cut here---------------end--------------->8--- Actually we currently have this hook, which Andy added some time ago (here $(moddir) contains installed source files and $(ccachedir) is for installed object files): --8<---------------cut here---------------start------------->8--- install-data-hook: @$(am__vpath_adj_setup) \ list=3D'$(nobase_mod_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=3D; else d=3D"$(srcdir)/"; fi; \ $(am__vpath_adj) \ echo " touch -r '$$d$$p' '$(DESTDIR)$(moddir)/$$f'"; \ touch -r "$$d$$p" "$(DESTDIR)$(moddir)/$$f"; \ done @$(am__vpath_adj_setup) \ list=3D'$(nobase_ccache_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=3D; else d=3D"$(srcdir)/"; fi; \ $(am__vpath_adj) \ echo " touch -r '$$d$$p' '$(DESTDIR)$(ccachedir)/$$f'"; \ touch -r "$$d$$p" "$(DESTDIR)$(ccachedir)/$$f"; \ done --8<---------------cut here---------------end--------------->8--- IIUC it copies timestamps from $(srcdir) and $(builddir) to the corresponding installed files. It looks like this is all we need, right? Problem is, each package that installs Guile object and source files needs this hook... Thanks, Ludo=E2=80=99.