From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Subject: bug#26734: Snippets (even empty ones) of tar sources reset the timestamps of all files Date: Mon, 01 May 2017 15:57:00 +0200 Message-ID: <874lx4d6j7.fsf@lassieur.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43025) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Bq3-0006PU-P6 for bug-guix@gnu.org; Mon, 01 May 2017 09:58:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5Bpz-0005nT-6r for bug-guix@gnu.org; Mon, 01 May 2017 09:58:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51466) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d5Bpz-0005nP-2R for bug-guix@gnu.org; Mon, 01 May 2017 09:58:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d5Bpy-0005HS-Ml for bug-guix@gnu.org; Mon, 01 May 2017 09:58:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42912) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d5Bp7-0005s5-3U for bug-guix@gnu.org; Mon, 01 May 2017 09:57:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d5Bp2-0005Rv-NQ for bug-guix@gnu.org; Mon, 01 May 2017 09:57:09 -0400 Received: from mail.lassieur.org ([83.152.10.219]:36656) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d5Bp2-0005RT-9m for bug-guix@gnu.org; Mon, 01 May 2017 09:57:04 -0400 Received: from rodion (80.12.38.192 [80.12.38.192]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id d91abce8 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Mon, 1 May 2017 13:57:01 +0000 (UTC) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 26734@debbugs.gnu.org Please consider the following package: --8<---------------cut here---------------start------------->8--- (define-public hello (package (name "hello") (version "2.10") (source (origin (method url-fetch) (uri (string-append "mirror://gnu/hello/hello-" version ".tar.gz")) (sha256 (base32 "0ssi1wpaf7plaswqqjwigppsg5fyh99vdlb9kzl7c9lng89ndq1i")) (modules '((guix build utils))) (snippet '(begin #t)))) (build-system gnu-build-system) (synopsis "Hello, GNU world: An example GNU package") (description "GNU Hello prints the message \"Hello, world!\" and then exits. It serves as an example of standard GNU coding practices. As such, it supports command-line arguments, multiple languages, and so on.") (home-page "https://www.gnu.org/software/hello/") (license gpl3+))) --8<---------------cut here---------------end--------------->8--- It is the 'hello' package with two extra lines that add an empty snippet. --8<---------------cut here---------------start------------->8--- (modules '((guix build utils))) (snippet '(begin #t)) --8<---------------cut here---------------end--------------->8--- Now here is the output of 'ls -l' within the original (extracted) 'hello': --8<---------------cut here---------------start------------->8--- -rw-r--r-- 1 clement users 93787 Nov 16 2014 ABOUT-NLS -rw-r--r-- 1 clement users 43830 Nov 16 2014 aclocal.m4 -rw-r--r-- 1 clement users 593 Jul 19 2014 AUTHORS drwxr-xr-x 3 clement users 4096 Nov 16 2014 build-aux/ -rw-r--r-- 1 clement users 12988 Nov 16 2014 ChangeLog -rw-r--r-- 1 clement users 30632 Jul 19 2014 ChangeLog.O -rw-r--r-- 1 clement users 32871 Nov 16 2014 config.in -rwxr-xr-x 1 clement users 449922 Nov 16 2014 configure -rw-r--r-- 1 clement users 2408 Oct 5 2014 configure.ac drwxr-xr-x 2 clement users 4096 Nov 16 2014 contrib/ -rw-r--r-- 1 clement users 35147 Dec 12 2013 COPYING drwxr-xr-x 2 clement users 4096 Nov 16 2014 doc/ -rw-r--r-- 1 clement users 4573 Nov 16 2014 GNUmakefile -r--r--r-- 1 clement users 1400 Nov 16 2014 hello.1 -rw-r--r-- 1 clement users 15752 Dec 29 2013 INSTALL drwxr-xr-x 2 clement users 4096 Nov 16 2014 lib/ drwxr-xr-x 2 clement users 4096 Nov 16 2014 m4/ -rw-r--r-- 1 clement users 63223 Nov 16 2014 maint.mk -rw-r--r-- 1 clement users 4367 Aug 5 2014 Makefile.am -rw-r--r-- 1 clement users 143282 Nov 16 2014 Makefile.in drwxr-xr-x 2 clement users 4096 Nov 16 2014 man/ -rw-r--r-- 1 clement users 4023 Nov 16 2014 NEWS drwxr-xr-x 2 clement users 4096 Nov 16 2014 po/ -rw-r--r-- 1 clement users 3582 Jul 19 2014 README -rw-r--r-- 1 clement users 1571 Jul 19 2014 README-dev -rw-r--r-- 1 clement users 3014 Nov 16 2014 README-release drwxr-xr-x 2 clement users 4096 Nov 16 2014 src/ drwxr-xr-x 2 clement users 4096 Nov 16 2014 tests/ -rw-r--r-- 1 clement users 898 Jul 19 2014 THANKS -rw-r--r-- 1 clement users 75 Jul 19 2014 TODO --8<---------------cut here---------------end--------------->8--- And here is the same output within the modified 'hello' (with the empty snippet): --8<---------------cut here---------------start------------->8--- -rw-r--r-- 1 clement users 93787 Jan 1 1970 ABOUT-NLS -rw-r--r-- 1 clement users 43830 Jan 1 1970 aclocal.m4 -rw-r--r-- 1 clement users 593 Jan 1 1970 AUTHORS drwxr-xr-x 3 clement users 4096 Jan 1 1970 build-aux/ -rw-r--r-- 1 clement users 12988 Jan 1 1970 ChangeLog -rw-r--r-- 1 clement users 30632 Jan 1 1970 ChangeLog.O -rw-r--r-- 1 clement users 32871 Jan 1 1970 config.in -rwxr-xr-x 1 clement users 449922 Jan 1 1970 configure -rw-r--r-- 1 clement users 2408 Jan 1 1970 configure.ac drwxr-xr-x 2 clement users 4096 Jan 1 1970 contrib/ -rw-r--r-- 1 clement users 35147 Jan 1 1970 COPYING drwxr-xr-x 2 clement users 4096 Jan 1 1970 doc/ -rw-r--r-- 1 clement users 4573 Jan 1 1970 GNUmakefile -r--r--r-- 1 clement users 1400 Jan 1 1970 hello.1 -rw-r--r-- 1 clement users 15752 Jan 1 1970 INSTALL drwxr-xr-x 2 clement users 4096 Jan 1 1970 lib/ drwxr-xr-x 2 clement users 4096 Jan 1 1970 m4/ -rw-r--r-- 1 clement users 63223 Jan 1 1970 maint.mk -rw-r--r-- 1 clement users 4367 Jan 1 1970 Makefile.am -rw-r--r-- 1 clement users 143282 Jan 1 1970 Makefile.in drwxr-xr-x 2 clement users 4096 Jan 1 1970 man/ -rw-r--r-- 1 clement users 4023 Jan 1 1970 NEWS drwxr-xr-x 2 clement users 4096 Jan 1 1970 po/ -rw-r--r-- 1 clement users 3582 Jan 1 1970 README -rw-r--r-- 1 clement users 1571 Jan 1 1970 README-dev -rw-r--r-- 1 clement users 3014 Jan 1 1970 README-release drwxr-xr-x 2 clement users 4096 Jan 1 1970 src/ drwxr-xr-x 2 clement users 4096 Jan 1 1970 tests/ -rw-r--r-- 1 clement users 898 Jan 1 1970 THANKS -rw-r--r-- 1 clement users 75 Jan 1 1970 TODO --8<---------------cut here---------------end--------------->8--- As you can see, the timestamps are not the same, although there is nothing in the snippet. I think the code is in guix/packages.scm (patch-and-repack). Here is my understanding of what happens: the presence of the snippet leads to 3 things: 1. extraction of the archive, 2. modification of some files (because of patches or snippet), 3. compression of the archive. Step 3 sets all timestamps to zero so to avoid non-determinism in the archive. We obviously don't want archives to depend on the time of their creation. But I believe we should only reset the timestamps of the files we modified in step 2. Unmodified files should stay unmodified. What's the point? Well, while working on the 0ad package, I realized that building with 32 cores would always fail with a snippet (even if it is empty) and always succeed without a snippet. It took me a few hours to understand this, and I put a comment in the 0ad package. Maybe it is a 0ad bug (some tricky race condition that depends of file timestamps), but I believe it is also a Guix bug: an empty snippet should not change in any way the binary output of a package. I tried to patch 'patch-and-repack', but it triggers a full rebuild... WDYT?