From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: emacs-dev: 'unpack' phase does not seem to preserve timestamps Date: Thu, 17 May 2018 17:14:38 +0200 Message-ID: <874lj6iaap.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44044) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJKcC-0001ej-MW for help-guix@gnu.org; Thu, 17 May 2018 11:14:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJKc6-00035Q-MP for help-guix@gnu.org; Thu, 17 May 2018 11:14:48 -0400 Received: from mail-wr0-x22d.google.com ([2a00:1450:400c:c0c::22d]:37480) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJKc6-00034X-FW for help-guix@gnu.org; Thu, 17 May 2018 11:14:42 -0400 Received: by mail-wr0-x22d.google.com with SMTP id h5-v6so6085062wrm.4 for ; Thu, 17 May 2018 08:14:42 -0700 (PDT) Received: from mimimi (2a01cb040a37a0005adf9a0845f647b3.ipv6.abo.wanadoo.fr. [2a01:cb04:a37:a000:5adf:9a08:45f6:47b3]) by smtp.gmail.com with ESMTPSA id c21-v6sm7276321wre.81.2018.05.17.08.14.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 May 2018 08:14:40 -0700 (PDT) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable I'm trying to build an Emacs package of my local git checkout: =2D-8<---------------cut here---------------start------------->8--- (define-public emacs-dev (package (inherit emacs) (name "emacs-dev") (version "27.0.0") (source (local-file "/home/ambrevar/projects/emacs" #:recursive? #t)) (arguments `(#:tests? #f ; TODO: Enable tests? Need to fix tramp f= irst. #:phases (modify-phases %standard-phases (delete 'reset-gzip-timestamps) ; TODO: Why does this fai= l? (delete 'build)))) (synopsis "Emacs (development version)") (license license:lgpl3+))) =2D-8<---------------cut here---------------end--------------->8--- The above declaration works on a clean checkout (e.g. after a `make clean`). When developing and building locally multiple times, it is more efficient to only run the install phase during Guix packaging. Emacs is based on the GNU build system which on Guix uses a separate "source" and "build" folder. Unfortunately, some Emacs files are generated during the build phase inside the "source" folder no matter what. (Am I wrong about that?) Since all file timestamps are set to Epoch by 'unpack', the build phase tries to rebuild everything. And since the files unpacked to "source" are read-only, `make` fails to regenerate the files that go in "source". Excerpt from the build log: =2D-8<---------------cut here---------------start------------->8--- make -C ../admin/charsets all make[2]: Entering directory '/tmp/guix-build-emacs-dev-27.0.0.drv-0/build/a= dmin/charsets' GEN ../../../source/etc/charsets/JISX2131.map /gnu/store/icz3hd36aqpjz5slyp4hhr8wsfbgiml1-bash-minimal-4.4.12/bin/bash: l= ine 2: ../../../source/etc/charsets/JISX2131.map: Permission denied =2D-8<---------------cut here---------------end--------------->8--- And the offending files details (notice the permissions and the mtime): =2D Source /home/ambrevar/projects/emacs/etc/charsets/JISX2131.map: =2Drw-r--r-- 1 ambrevar users 120k 2018-05-17 15:08 JISX2131.map =2D Destination /tmp/guix-build-emacs-dev-27.0.0.drv-0/source/etc/charsets/= JISX2131.map: =2Dr--r--r-- 1 ambrevar users 120k 1970-01-01 1970 JISX2131.map The same error occurs for all the generated files (mostly .map files and stamp files). From=20the source, 'unpack' is supposed to preserve the timestamp: =2D-8<---------------cut here---------------start------------->8--- (define* (unpack #:key source #:allow-other-keys) "Unpack SOURCE in the working directory, and change directory within the source. When SOURCE is a directory, copy it in a sub-directory of the curr= ent working directory." (if (file-is-directory? source) (begin (mkdir "source") (chdir "source") ;; Preserve timestamps (set to the Epoch) on the copied tree so that ;; things work deterministically. (copy-recursively source "." #:keep-mtime? #t) #t) (and (if (string-suffix? ".zip" source) (zero? (system* "unzip" source)) (zero? (system* "tar" "xvf" source))) (chdir (first-subdirectory "."))))) =2D-8<---------------cut here---------------end--------------->8--- Bug? =2D- Pierre Neidhardt --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlr9nF4ACgkQm9z0l6S7 zH94iQf/bzQQKoA3CwNrEZ2CnDPhEtWJulasv2DYZ5CDTSCrdiLmW6kGFU/OEH/4 Njofv78LYZiKRLs/PhBD9qfHG9Esn8claP+HSDdL4Oxw5EB7TfAvIFPTko2CoYI5 5pHrB96yRtAqyFTJtpooUjP6e9H0zS88CkTHUVsLYLW3ty70axs9dxuDII8zvYzo Qfm7Iz4xR9IOdj8TDZ6PI6D6bALepC66jWm5cz+ESmesMGJVyrft9O8lCijymSzd 9VXTsrWtcfhb+qtMbFwY2YZ7FUTp/qBy3K8WvavuWA8EGUFd3y3A5oxXhHmsH/js rUiCS7z9cSsw4oLsUi6b8dGDbI/0Gg== =m99q -----END PGP SIGNATURE----- --=-=-=--