From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Trent Buck" Newsgroups: gmane.emacs.devel Subject: package.el: bytecode portability across emacs versions Date: Mon, 21 May 2007 23:47:47 +1000 Message-ID: <20070521134747.GA14137@baal.lan> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1674046386==" X-Trace: sea.gmane.org 1179768124 24399 80.91.229.12 (21 May 2007 17:22:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 May 2007 17:22:04 +0000 (UTC) Cc: emacs-devel@gnu.org To: elpa@tromey.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 21 19:22:03 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HqBa6-0000AJ-SI for ged-emacs-devel@m.gmane.org; Mon, 21 May 2007 19:22:03 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HqBa6-0008Dz-EX for ged-emacs-devel@m.gmane.org; Mon, 21 May 2007 13:22:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hq8Er-0001ZI-Ka for emacs-devel@gnu.org; Mon, 21 May 2007 09:47:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hq8Eq-0001Yn-Qd for emacs-devel@gnu.org; Mon, 21 May 2007 09:47:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hq8Eq-0001Yk-JW for emacs-devel@gnu.org; Mon, 21 May 2007 09:47:52 -0400 Original-Received: from omta05ps.mx.bigpond.com ([144.140.83.195]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hq8Ep-0000mj-UJ for emacs-devel@gnu.org; Mon, 21 May 2007 09:47:52 -0400 Original-Received: from oaamta07ps.mx.bigpond.com ([155.143.223.85]) by omta05ps.mx.bigpond.com with ESMTP id <20070521134749.EEXQ23363.omta05ps.mx.bigpond.com@oaamta07ps.mx.bigpond.com>; Mon, 21 May 2007 13:47:49 +0000 Original-Received: from ares.lan ([155.143.223.85]) by oaamta07ps.mx.bigpond.com with ESMTP id <20070521134748.ZTAM16304.oaamta07ps.mx.bigpond.com@ares.lan>; Mon, 21 May 2007 13:47:48 +0000 Original-Received: from baal.lan (baal.lan [192.168.1.3]) by ares.lan (Postfix) with SMTP id 7473DBB494; Mon, 21 May 2007 23:47:47 +1000 (EST) Original-Received: by baal.lan (sSMTP sendmail emulation); Mon, 21 May 2007 23:47:47 +1000 User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: Solaris 8 (2) X-Mailman-Approved-At: Mon, 21 May 2007 13:21:58 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:71531 Archived-At: --===============1674046386== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLDf9lqlvOQaIe6s" Content-Disposition: inline --SLDf9lqlvOQaIe6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 (=3D (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. --=20 Trent Buck --SLDf9lqlvOQaIe6s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGUaMDLpef9iTtxAYRAq6vAKCAUVWVdRl2/Wp1scIzOmAL6+XQZQCePIeF 2RkbWxXIKqancAydD0wkZCY= =/Me6 -----END PGP SIGNATURE----- --SLDf9lqlvOQaIe6s-- --===============1674046386== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --===============1674046386==--