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

Re: Trouble with byte-compiling .el files on Emacs update



On 2008-07-26 23:00 +0200, Hilko Bengen wrote:

> An emacs22 upgrade that was recently installed broke when it tried to
> byte-compile a part of sepia (for which I maintain the Debian
> package). This is the output I got when I tried to reinstall the
> emacs22-gtk package:
>
> $ sudo apt-get --reinstall install emacs22-gtk
> [...]
> emacs-install emacs22
> install/a2ps: Handling install for emacsen flavor emacs22
> Wrote /usr/share/emacs22/site-lisp/a2ps/a2ps.elc
> Wrote /usr/share/emacs22/site-lisp/a2ps/a2ps-print.elc
> [...]
> Wrote /usr/share/emacs22/site-lisp/sepia/sepia-cpan.elc
> Wrote /usr/share/emacs22/site-lisp/sepia/sepia.elc
> Wrote /usr/share/emacs22/site-lisp/sepia/sepia-ido.elc
> Source file `/usr/share/emacs22/site-lisp/sepia/snippet.el' newer than byte-compiled file

Not related to your problem, but this looks strange.  Why does the
byte-compiled file exist and why is the source newer?

> Wrote /usr/share/emacs22/site-lisp/sepia/sepia-snippet.elc
> Wrote /usr/share/emacs22/site-lisp/sepia/sepia-tree.elc
>
> In toplevel form:
> sepia-w3m.el:37:13:Error: Cannot open load file: w3m-perldoc
> Wrote /usr/share/emacs22/site-lisp/sepia/snippet.elc
> emacs-install: /usr/lib/emacsen-common/packages/install/sepia emacs22 failed at /usr/lib/emacsen-common/emacs-install line 28, <TSORT> line 56.
> dpkg: error processing emacs22-gtk (--configure):
>  subprocess post-installation script returned error exit status 1
> Errors were encountered while processing:
>  emacs22-gtk
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
>
> w3m-perldoc is part of the w3m-el package, but that hasn't been
> through the byte-compilation process at this point.
>
> I first suspected that
>
> 	(eval-when-compile
> 	  (require 'w3m-perldoc))
>
> was causing the error, so I changed that to
>
> 	(require 'w3m-perldoc)
>
> but this doesn't help because byte-compiling executes any `require'
> calls at top level.
>
> Is there any way to ensure that the files from w3m-el are handled
> before the files from sepia? A dependency on w3m-el is declared in the
> package of course, but that obviously doesn't help since the error
> happens in the postinst of the emacs package.

Probably emacs-install would need to be changed to take package
dependencies into account, but the emacsen-common package does not seem
to be maintained currently.

I think you can work around this by specifying the path to w3m-perldoc
in the require call, like this:

(eval-when-compile
  (require 'w3m-perldoc "w3m/w3m-perldoc"))

This will load the file from /usr/share/emacs/site-lisp, if no
byte-compiled file from /usr/share/emacs22/site-lisp exists yet.

Sven


Reply to: