GNU bug report logs - #10125
24.0.91; package.el (org): Macros in tar packages & order of byte compilation

Previous Next

Package: emacs;

Reported by: Jambunathan K <kjambunathan <at> gmail.com>

Date: Thu, 24 Nov 2011 12:15:02 UTC

Severity: normal

Merged with 18443, 18448, 21267

Found in versions 24.0.91, 24.3.93, 25.0.50

Full log


Message #122 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Achim Gratz <Stromeko <at> nexgo.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#10125: RFE: require and load-path-shadowing
Date: Sun, 13 Jan 2013 08:46:59 +0100
Glenn Morris writes:
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10125#50
>
>    Turns out I was looking for invocation-directory and invocation-name.

Indeed, thanks.  So using your earlier patch as a template, this should
be good for emacs-24:

--8<---------------cut here---------------start------------->8---
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6059f03..df194b8 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -632,11 +632,20 @@ untar into a directory named DIR; otherwise, signal an error."
   "Generate autoloads and do byte-compilation for package named NAME.
 PKG-DIR is the name of the package directory."
   (package-generate-autoloads name pkg-dir)
-  (let ((load-path (cons pkg-dir load-path)))
-    ;; We must load the autoloads file before byte compiling, in
-    ;; case there are magic cookies to set up non-trivial paths.
-    (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
-    (byte-recompile-directory pkg-dir 0 t)))
+  (with-current-buffer (get-buffer-create "*package-compile*")
+    (goto-char (point-max))
+    (pop-to-buffer (current-buffer))
+    (or (zerop (call-process
+               (concat invocation-directory invocation-name)
+               nil t t "--batch" "-Q" "--eval"
+               (format
+                "(let ((pkg-dir \"%s\")(name \"%s\"))
+                    (progn (setq load-path (cons pkg-dir load-path))
+                    (load (expand-file-name (concat name \"-autoloads\") pkg-dir) nil t)
+                    (batch-byte-recompile-directory 0)))"
+                pkg-dir name)
+               pkg-dir))
+       (error "Compiling the package gave an error"))))
 
 (defun package--write-file-no-coding (file-name)
   (let ((buffer-file-coding-system 'no-conversion))
--8<---------------cut here---------------end--------------->8---

I've confirmed that Emacs 24.2 fails to install current Org from ELPA
without that patch when trying to install after having opened an Org
file.  It installs Org correctly in that same situation with the patch
that does the package compilation in an external Emacs process.


Regards
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds





This bug report was last modified 9 years and 304 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.