diff mbox

Timestamps in ...-autoloads.el files

Message ID 87h9du1n6a.fsf@gmail.com
State New
Headers show

Commit Message

Alex Kost May 19, 2016, 8:12 a.m. UTC
Ludovic Courtès (2016-05-16 15:45 +0300) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> To recap: we use "gnu/packages/patches/emacs-source-date-epoch.patch" to
>> modify 'autoload-insert-section-header' function, and it should work,
>> but it doesn't.  IIUC this happens because "autoload.elc" file was
>> compiled using the unpatched "autoload.el", but first things first.  Try
>> the following recipe in Emacs (installed with Guix):
[...]
> Ideally, we
> should remove all the .elc files and rebuild them, but maybe there are
> bootstrapping issues.

The attached patch does this.  Happily there were no any issues.  Now
emacs packages will honor SOURCE_DATE_EPOCH.  Even autoloads that comes
with emacs itself (loaddefs.el, cl-loaddefs.el, etc.) will have a proper
timestamp.

Comments

Ludovic Courtès May 19, 2016, 12:56 p.m. UTC | #1
Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2016-05-16 15:45 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> To recap: we use "gnu/packages/patches/emacs-source-date-epoch.patch" to
>>> modify 'autoload-insert-section-header' function, and it should work,
>>> but it doesn't.  IIUC this happens because "autoload.elc" file was
>>> compiled using the unpatched "autoload.el", but first things first.  Try
>>> the following recipe in Emacs (installed with Guix):
> [...]
>> Ideally, we
>> should remove all the .elc files and rebuild them, but maybe there are
>> bootstrapping issues.
>
> The attached patch does this.  Happily there were no any issues.  Now
> emacs packages will honor SOURCE_DATE_EPOCH.  Even autoloads that comes
> with emacs itself (loaddefs.el, cl-loaddefs.el, etc.) will have a proper
> timestamp.

Awesome!

> From ca571f7631bf77ddc8ad6257fe165b4ff0ef5e6b Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Thu, 19 May 2016 11:01:40 +0300
> Subject: [PATCH] gnu: emacs: Remove *.elc from the release tarball.
>
> * gnu/packages/emacs.scm (emacs)[arguments]: Add 'remove-compiled-elisp'
>   phase.
> ---
>  gnu/packages/emacs.scm | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
> index 32ed722..0c15f63 100644
> --- a/gnu/packages/emacs.scm
> +++ b/gnu/packages/emacs.scm
> @@ -91,6 +91,15 @@
>               (substitute* (find-files "." "^Makefile\\.in$")
>                 (("/bin/pwd")
>                  "pwd"))))
> +         (add-after 'configure 'remove-compiled-elisp
> +           (lambda _
> +             ;; Emacs comes with compiled elisp (*.elc) and generated
> +             ;; autoloads (*loaddefs.el) files.  This does not allow us to use
> +             ;; "emacs-source-date-epoch.patch" effectively, so remove these
> +             ;; files (using 'make bootstrap-clean'), as 'make' will recreate
> +             ;; them.
> +             (with-directory-excursion "lisp"
> +               (zero? (system* "make" "bootstrap-clean")))))

I would rather do it in a ‘snippet’ so that ‘guix build -S emacs’
returns the cleaned-up source.

However, the snippet would have to duplicate the logic of this makefile
rule, which might not be desirable (depends on how complex this rule
is).  If you think it’s best to keep this way, please push!

Thanks,
Ludo’.
diff mbox

Patch

From ca571f7631bf77ddc8ad6257fe165b4ff0ef5e6b Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Thu, 19 May 2016 11:01:40 +0300
Subject: [PATCH] gnu: emacs: Remove *.elc from the release tarball.

* gnu/packages/emacs.scm (emacs)[arguments]: Add 'remove-compiled-elisp'
  phase.
---
 gnu/packages/emacs.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 32ed722..0c15f63 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -91,6 +91,15 @@ 
              (substitute* (find-files "." "^Makefile\\.in$")
                (("/bin/pwd")
                 "pwd"))))
+         (add-after 'configure 'remove-compiled-elisp
+           (lambda _
+             ;; Emacs comes with compiled elisp (*.elc) and generated
+             ;; autoloads (*loaddefs.el) files.  This does not allow us to use
+             ;; "emacs-source-date-epoch.patch" effectively, so remove these
+             ;; files (using 'make bootstrap-clean'), as 'make' will recreate
+             ;; them.
+             (with-directory-excursion "lisp"
+               (zero? (system* "make" "bootstrap-clean")))))
          (add-after 'install 'remove-info.info
            (lambda* (#:key outputs #:allow-other-keys)
              ;; Remove 'info.info', which is provided by Texinfo <= 6.0.
-- 
2.7.3