[Fedora-packaging] package without .elc files and emacs guidelines

Ville Skyttä ville.skytta at iki.fi
Thu Oct 23 21:24:26 UTC 2008

On Wednesday 22 October 2008, Jonathan Underwood wrote:
> 2008/10/17 Patrice Dumas <pertusus at free.fr>:
> > Hello,
> >
> > In the librep there are some .el files, and Michal Jaegermann explained
> > in
> > https://bugzilla.redhat.com/show_bug.cgi?id=431250#c23
> > that the .elc files are not needed (and sometimes harmful). This is not
> > very consistent with the Emacs guidelines. Maybe the guidelines could be
> > amended for this case?
> I think he's wrong. If something doesn't work when byte compiled
> (.elc), then that's a bug.

Strictly speaking, I don't think it's always quite that black and white.

Depending on the .el, byte compilation in one configuration may end 
up "optimizing away" things that are not needed in that configuration, but 
might be needed in other configurations where the .elc is supposed to be 
used.  Or the other way around, it may end up byte compiling things that are 
needed in the build configuration but are not needed and can cause duplicate 
definitions or other weirdness in others.  For example detecting availability 
of some features - typically .el that supports multiple *Emacs versions by 
providing internal replacements for some things not found in the build 
configuration - and conditionally byte compiling them.

Reviewing eval-when-compile's in the .el might reveal some but not all 
potential problems.  defmacro's are another thing that could be useful to 
check (AFAIU, IIRC, but then again I don't have that deep knowledge about 
these things).

In practice this is rarely a problem in Fedora as the .elc are quite likely to 
be used in pretty much the same configuration (Emacs version, other lisp libs 
loaded from load-path) as with what they were built with.  But if 
configurations differ enough such as .elc byte compiled with Emacs ending up 
in XEmacs' load path or vice versa, or .elc byte compiled with one *Emacs 
version and run with another, breakage is not at all unlikely.  Granted, the 
best fix for these situations is not omitting byte-compilation altogether, 
but rather ensuring incompatible *emacs don't mess around with .elcs in each 
others' load paths, and using strict enough rpm level dependency versioning 
on the target *emacs.

More information about the Fedora-packaging mailing list