bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20330: Do not capture build-time $PATH in 'emacs' binary


From: Ludovic Courtès
Subject: bug#20330: Do not capture build-time $PATH in 'emacs' binary
Date: Tue, 14 Apr 2015 13:51:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

The attached patch makes sure that the ‘emacs’ executable does not
capture the value of the build-time $PATH (which notably includes the
build directory, which may or may not exist afterwards.)

(FWIW, the added motivation in the context of Guix and Nix is that the
garbage collector would see those references and assume that Emacs needs
all these items at run time.  See
<http://git.savannah.gnu.org/cgit/guix.git/commit/?id=1bef37ee2e0a6ba9048eb8087651c8dbd2c6c796>.)

Ludo’.

--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -64,6 +64,11 @@
                           (expand-file-name "textmodes" dir)
                           (expand-file-name "vc" dir)))))
 
+;; Reset 'exec-path' so we don't capture the build-time $PATH in the
+;; 'emacs' executable.
+(setq-default exec-path nil)
+(setq exec-path nil)
+
 (if (eq t purify-flag)
     ;; Hash consing saved around 11% of pure space in my tests.
     (setq purify-flag (make-hash-table :test 'equal :size 70000)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]