GNU bug report logs - #62734
Always fully rebuild autoloads in package-generate-autoloads

Previous Next

Package: emacs;

Reported by: Leo Georg Gaskin <leo.gaskin <at> le0.gs>

Date: Sun, 9 Apr 2023 04:12:02 UTC

Severity: normal

Tags: patch

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Philip Kaludercic <philipk <at> posteo.net>
Cc: 62734 <at> debbugs.gnu.org, leo.gaskin <at> le0.gs
Subject: bug#62734: Always fully rebuild autoloads in package-generate-autoloads
Date: Fri, 28 Apr 2023 21:11:15 +0300
> From: Philip Kaludercic <philipk <at> posteo.net>
> Cc: leo.gaskin <at> le0.gs,  62734 <at> debbugs.gnu.org
> Date: Fri, 28 Apr 2023 18:00:14 +0000
> 
> > I don't understand the original problem (what does package-vc.el have
> > to do with rebuilding local packages? 
> 
> When package updates a package, it deletes the old code and downloads
> the new stuff.  package-vc keeps the same code, but pulls the new
> revisions, so it is necessary to re-generate the loaddef files for the
> same files.

What is meant by "building the package"?  Is it just compiling the
Lisp files?

> >                                       and why is a newly generated
> > loaddefs file incomplete or empty?), and I certainly don't think I
> > understand the effects of this change on the other usage scenarios.
> 
> >From what I get, this is an issue in `loaddefs-generate'.  If we do not
> force updating the file, and
> 
> --8<---------------cut here---------------start------------->8---
> (time-less-p output-time
>   (file-attribute-modification-time
>   (file-attributes file)))
> --8<---------------cut here---------------end--------------->8---
> 
> does not hold

Why would it not hold?  Updating from VCS should update the timestamp
of the updated files.

> Another idea is just to get rid of this faulty optimisation.  From my
> tests this would also resolve the bug.

I don't yet understand what optimization is that, but getting rid of
it should not alter what the code does for the loaddefs files inside
the Emacs tree, because there it does work, and I don't want to touch
that.

> > Why would we want to unconditionally rebuild all the loaddefs files
> > every time package-generate-autoloads is invoked?  OTOH, that function
> > is not really documented, so maybe I don't understand what is it
> > supposed to do and in which conditions.
> 
> The matter was that for regular packages, it was already rebuilt every
> time `loaddefs-generate' was invoked, since there were never any old
> loaddefs to update.

This is only true as long as updating a package removes the previous
version entirely, including the generated files.  This is not
something I'd like us to assume in every corner of package.el, since
some day it can become false.




This bug report was last modified 2 years and 24 days ago.

Previous Next


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