unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* package.el: bytecode portability across emacs versions
@ 2007-05-21 13:47 Trent Buck
  2007-05-21 18:10 ` David Kastrup
  0 siblings, 1 reply; 20+ messages in thread
From: Trent Buck @ 2007-05-21 13:47 UTC (permalink / raw)
  To: elpa; +Cc: emacs-devel


[-- Attachment #1.1: Type: text/plain, Size: 2269 bytes --]

Arbitrary emacs lisp cannot be byte-compiled in one version of Emacs
and loaded in another, as the following transcript shows:

| $ emacs-snapshot-nox --version
| GNU Emacs 22.1.50.1
| Copyright (C) 2007 Free Software Foundation, Inc.
| GNU Emacs comes with ABSOLUTELY NO WARRANTY.
| You may redistribute copies of Emacs
| under the terms of the GNU General Public License.
| For more information about these matters, see the file named COPYING.
| $ emacs-unicode-2 --version
| GNU Emacs 23.0.0.1
| Copyright (C) 2007 Free Software Foundation, Inc.
| GNU Emacs comes with ABSOLUTELY NO WARRANTY.
| You may redistribute copies of Emacs
| under the terms of the GNU General Public License.
| For more information about these matters, see the file named COPYING.
| $ cat >tmp.el
| (unless (= (eval-when-compile emacs-major-version)
|            emacs-major-version)
|   (error "bytecode is not portable!"))
| $ emacs-snapshot-nox -batch -Q -eval '(load (expand-file-name "tmp"))'
| Loading /home/twb/Desktop/tmp.el (source)...
| $ emacs-unicode-2-nox -batch -Q -eval '(load (expand-file-name "tmp"))'
| Loading /home/twb/Desktop/tmp.el (source)...
| $ emacs-snapshot-nox -batch -Q -f batch-byte-compile tmp.el
| Wrote /home/twb/Desktop/tmp.elc
| $ emacs-snapshot-nox -batch -Q -eval '(load (expand-file-name "tmp"))'
| Loading /home/twb/Desktop/tmp...
| $ emacs-unicode-2-nox -batch -Q -eval '(load (expand-file-name "tmp"))'
| Loading /home/twb/Desktop/tmp...
| bytecode is not portable!

This is most obvious in the wild in emacs-w3m, but I've had problems
with other packages also.

package.el appears to create bytecode in a common directory.  Unless
code is carefully audited, any time .emacs.d is shared between
multiple emacsen packages errors can be expected.

Recommendation: either 0) tell users not to run more than one emacs;
1) don't byte-compile; or 2) place bytecode in path(s) local to the
current emacs-version.

Debian's elisp package framework adopts (2), that might be a source of
inspiration.  Through rampant lethargy I have historically used (1)
for my .emacs.d/lisp/.  It may also be worth looking at how
Debian's/Gentoo's common-lisp-controller package handles "local" fasl
files.
-- 
Trent Buck

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2007-05-30 15:44 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-21 13:47 package.el: bytecode portability across emacs versions Trent Buck
2007-05-21 18:10 ` David Kastrup
2007-05-21 23:01   ` Kevin Ryde
2007-05-22  0:11   ` Trent Buck
2007-05-25 16:00     ` Tom Tromey
2007-05-26  1:32       ` Michael Olson
2007-05-26  6:34         ` David Kastrup
2007-05-26 10:34           ` Eli Zaretskii
2007-05-26 10:40             ` David Kastrup
2007-05-26  5:33       ` Trent Buck
2007-05-26  6:02         ` Eli Zaretskii
2007-05-27  1:00       ` Richard Stallman
2007-05-27  3:54         ` Trent Buck
2007-05-27  5:41         ` David Kastrup
2007-05-27 23:21           ` Richard Stallman
2007-05-28  6:33             ` David Kastrup
2007-05-29  0:02               ` Richard Stallman
2007-05-30  0:44           ` Michael Olson
2007-05-30 15:44             ` Richard Stallman
2007-05-28 21:35       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).