diff mbox series

[bug#65478,emacs-team,v2] build: emacs-utils: Adjust `emacs-compile-directory' for Emacs 29.

Message ID ba16b540f92b7ae6ad50bc98cf5deebb43ee85bc.1693272362.git.hako@ultrarare.space
State New
Headers show
Series [bug#65478,emacs-team,v2] build: emacs-utils: Adjust `emacs-compile-directory' for Emacs 29. | expand

Commit Message

Hilton Chain Aug. 29, 2023, 1:33 a.m. UTC
* guix/build/emacs-utils.scm (emacs-compile-directory): After native
compilation, write the bytecode file with `comp-write-bytecode-file' when
using Emacs 29.
---
 guix/build/emacs-utils.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


base-commit: 9d074e16c7a9879d67c348c7b2d70b725adfbdfa

Comments

Liliana Marie Prikler Aug. 30, 2023, 7:40 p.m. UTC | #1
Am Dienstag, dem 29.08.2023 um 09:33 +0800 schrieb Hilton Chain:
> * guix/build/emacs-utils.scm (emacs-compile-directory): After native
> compilation, write the bytecode file with `comp-write-bytecode-file'
> when using Emacs 29.
> ---
Is this meant for the master branch or for emacs-team?  I don't think
we need to keep backwards compatibility on emacs-team.


Cheers
Hilton Chain Sept. 1, 2023, 4:14 p.m. UTC | #2
On Thu, 31 Aug 2023 03:40:01 +0800,
Liliana Marie Prikler wrote:
>
> Am Dienstag, dem 29.08.2023 um 09:33 +0800 schrieb Hilton Chain:
> > * guix/build/emacs-utils.scm (emacs-compile-directory): After native
> > compilation, write the bytecode file with `comp-write-bytecode-file'
> > when using Emacs 29.
> > ---
> Is this meant for the master branch or for emacs-team?  I don't think
> we need to keep backwards compatibility on emacs-team.

It's for emacs-team, I kept the part for Emacs 28 since there might
still be use cases for it and changing the Emacs package to use is
easier than adjusting the build system.  But currently there's no
direct configuration to replace Emacs so it's not a necessity, and I
don't have a preference for it.  I'll send v3 without that part.
diff mbox series

Patch

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index ac3dac57d1..f4c18af388 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -140,6 +140,7 @@  (define* (emacs-compile-directory dir)
        (mapc
         (lambda (file)
           (let (byte-to-native-output-file
+                byte-to-native-output-buffer-file
                 ;; First entry is the eln-cache of the homeless shelter,
                 ;; second entry is the install directory.
                 (eln-dir (and (native-comp-available-p)
@@ -148,13 +149,18 @@  (define* (emacs-compile-directory dir)
                 (native-compile file
                                 (comp-el-to-eln-filename file eln-dir))
                 (byte-compile-file file))
+            ;; After native compilation, write the bytecode file.
+            ;; (For Emacs 28)
             ;; Sadly, we can't use pcase because quasiquote works different in
             ;; Emacs.  See `batch-byte+native-compile' in comp.el for the
             ;; actual shape of byte-to-native-output-file.
             (unless (null byte-to-native-output-file)
               (rename-file (car byte-to-native-output-file)
                            (cdr byte-to-native-output-file)
-                           t))))
+                           t))
+            ;; (For Emacs 29)
+            (unless (null byte-to-native-output-buffer-file)
+              (comp-write-bytecode-file nil))))
        files))
     #:dynamic? #t))