unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 67292@debbugs.gnu.org
Cc: Mekeor Melire <mekeor@posteo.de>,
	Maxime Devos <maximedevos@telenet.be>,
	Suhail Singh <suhailsingh247@gmail.com>,
	Simon Tournier <zimon.toutoune@gmail.com>,
	andrew@trop.in, cox.katherine.e+guix@gmail.com,
	liliana.prikler@gmail.com
Subject: bug#67292: [PATCH v2 2/2] profiles: emacs-subdirs: Also expand native-comp-eln-load-path.
Date: Fri, 20 Dec 2024 21:10:47 +0100	[thread overview]
Message-ID: <5b28731e904eed2909946cccedb27d1a1bdd7558.1734726526.git.liliana.prikler@gmail.com> (raw)
In-Reply-To: <01f9481f9ab86a21bc85e82a6f2a7e3457d2709e.1734726526.git.liliana.prikler@gmail.com>

This patch ensures that the pinned natively compiled Emacs packages can
actually be found in the respective load path.  The rationale for expanding it
mimics the rationale previously applied to load-path for byte compilation: We
want to be able to `guix upgrade' emacs (or similar) without yanking compiled
packages from underneath.

* guix/profiles.scm (emacs-subdirs): Write an additional “line” of code to
deal with ‘native-comp-eln-load-path’.
---
 guix/profiles.scm | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index a28cf872cf..87b9543ac0 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1206,7 +1206,15 @@ (define* (emacs-subdirs manifest #:optional system)
                           (scandir dir (negate (cute member <> '("." "..")))))))
                   (filter file-exists?
                           (map (cute string-append <> "/share/emacs/site-lisp")
-                               '#$(manifest-inputs manifest))))))
+                               '#$(manifest-inputs manifest)))))
+                (native-comp-needle
+                 ;; Dynamically find native-site-lisp relative to profile.
+                 ;; We can not hard-code the path here, because the output
+                 ;; isn't known yet.
+                 '(expand-file-name "../../../lib/emacs/native-site-lisp"))
+                (native-comp-dirs
+                 (search-path-as-list '("lib/emacs/native-site-lisp")
+                                      '#$(manifest-inputs manifest))))
             (mkdir-p destdir)
             (with-directory-excursion destdir
               (call-with-output-file "subdirs.el"
@@ -1216,6 +1224,18 @@ (define* (emacs-subdirs manifest #:optional system)
                      (list ,@(delete-duplicates subdirs)))
                    port)
                   (newline port)
+                  (write
+                   `(when (boundp 'native-comp-eln-load-path)
+                      (let ((needle ,native-comp-needle))
+                        (setq native-comp-eln-load-path
+                              (mapcan (lambda (dir)
+                                        (if (equal dir needle)
+                                            (nconc ',native-comp-dirs
+                                                   (list dir))
+                                            (list dir)))
+                                      native-comp-eln-load-path))))
+                   port)
+                  (newline port)
                   #t)))))))
   (gexp->derivation "emacs-subdirs" build
                     #:system system
-- 
2.46.0





  reply	other threads:[~2024-12-20 20:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-19 22:44 bug#67292: emacs / emacs-transient collisions and bundling Maxime Devos
2023-11-20 10:22 ` Simon Tournier
2023-11-20 12:39   ` Maxime Devos
2023-11-20 12:42     ` Maxime Devos
2023-11-20 13:46     ` Simon Tournier
2023-11-21 18:01       ` Maxime Devos
2023-11-22 20:53         ` Simon Tournier
2023-11-28  1:47           ` Maxime Devos
2023-11-28  9:45             ` Simon Tournier
2023-11-28 11:15             ` Mekeor Melire
2023-11-23 14:17     ` Mekeor Melire
2023-11-28  0:58       ` Maxime Devos
2023-11-28 11:12         ` Mekeor Melire
2024-12-08 17:30 ` bug#67292: [PATCH] gnu: emacs: Pin natively compiled packages Liliana Marie Prikler
2024-12-09  7:45   ` Andrew Tropin via Bug reports for GNU Guix
2024-12-17 20:10   ` bug#67292: emacs / emacs-transient collisions and bundling Suhail Singh
2024-12-17 21:36     ` Liliana Marie Prikler
2024-12-08 17:30 ` bug#67292: [PATCH v2 1/2] gnu: emacs: Pin natively compiled packages Liliana Marie Prikler
2024-12-20 20:10   ` Liliana Marie Prikler [this message]
2024-12-21  1:23   ` bug#67292: emacs / emacs-transient collisions and bundling Suhail Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b28731e904eed2909946cccedb27d1a1bdd7558.1734726526.git.liliana.prikler@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=67292@debbugs.gnu.org \
    --cc=andrew@trop.in \
    --cc=cox.katherine.e+guix@gmail.com \
    --cc=maximedevos@telenet.be \
    --cc=mekeor@posteo.de \
    --cc=suhailsingh247@gmail.com \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).