unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ldefs-boot.el
@ 2005-08-12 19:49 Luc Teirlinck
  2005-08-13  1:10 ` ldefs-boot.el Thien-Thi Nguyen
  2005-08-13 14:40 ` ldefs-boot.el Richard M. Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Luc Teirlinck @ 2005-08-12 19:49 UTC (permalink / raw)


I recently had to update ldefs-boot.el because a new autoload cookie
for a variable had been added.  The autoload made its way into
loaddefs.el but not into ldefs-boot.el.  The strange thing was that when
the autoload was needed and bootstrapping failed because it was not
available, loaddefs.el had already been regenerated and the variable
was already defined in it.  But apparently only ldefs-boot.el and not
the updated loaddefs.el had been loaded at that stage.

Is the moral of this story that each time that somebody adds a new
autoload that is necessary for compilation during bootstrapping (as
opposed to just an autoload that allows the user to call an
interactive function without having to load the file first), one has
to update ldefs-boot by overwriting it with a valid up to date copy of
loaddefs.el?  If so how many people are aware of this?

>From the Changelog, it appears that ldefs-boot.el had to be updated
four times for similar reasons.  But my guess is that in the vast
majority of cases, when people get an error message during bootstrap
saying that a variable or function is not defined, they just add a
require (or a defvar).  There is no telling how many unnecessary
require's have been added in the Emacs code because of this situation.

I am not very familiar at all with the bootstrapping process and the
various Makefile's, but I wonder whether there really is no better way
to handle this.  If not, we could see what could be done to make more
people who contribute to Emacs CVS aware of the ldefs-boot.el
situation; in particular, when it is necessary to update it and how it
should be done.  (I had to figure it out by doing a lot of grepping
through the Makefile's and through the emacs-devel archives.)

The comment in lisp/Makefile.in is less than self-explanatory:

# Build loaddefs.el to make sure it's up-to-date.  If it's not, that
# might lead to errors during the bootstrap because something fails to
# autoload as expected.  If there is no emacs binary, then we can't
# build autoloads yet.  In that case we have to use ldefs-boot.el;
# bootstrap should always work with ldefs-boot.el.

No, it does not always work.  (How could it?)  It only works if you
update ldefs-boot whenever needed.

Sincerely,

Luc.

 LocalWords:  Changelog defvar

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

* Re: ldefs-boot.el
  2005-08-12 19:49 ldefs-boot.el Luc Teirlinck
@ 2005-08-13  1:10 ` Thien-Thi Nguyen
  2005-08-14  0:30   ` ldefs-boot.el Luc Teirlinck
  2005-08-14  0:35   ` ldefs-boot.el Luc Teirlinck
  2005-08-13 14:40 ` ldefs-boot.el Richard M. Stallman
  1 sibling, 2 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2005-08-13  1:10 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> # Build loaddefs.el to make sure it's up-to-date.  If it's not, that
> # might lead to errors during the bootstrap because something fails to
> # autoload as expected.  If there is no emacs binary, then we can't
> # build autoloads yet.  In that case we have to use ldefs-boot.el;
> # bootstrap should always work with ldefs-boot.el.
> 
> No, it does not always work.  (How could it?)  It only works if you
> update ldefs-boot whenever needed.

the "should" in the last sentence of the makefile frag implies the last
sentence you wrote ("it only works...").  perhaps adding that sentence to
the makefile would be sufficient to nudge the implication to explanation?

(you have to sort of read the "should" in the spirit of specification docs
like RFCs, where the text is sometimes both descriptive and presriptive.)

thi

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

* Re: ldefs-boot.el
  2005-08-12 19:49 ldefs-boot.el Luc Teirlinck
  2005-08-13  1:10 ` ldefs-boot.el Thien-Thi Nguyen
@ 2005-08-13 14:40 ` Richard M. Stallman
  1 sibling, 0 replies; 6+ messages in thread
From: Richard M. Stallman @ 2005-08-13 14:40 UTC (permalink / raw)
  Cc: emacs-devel

    I recently had to update ldefs-boot.el because a new autoload cookie
    for a variable had been added.  The autoload made its way into
    loaddefs.el but not into ldefs-boot.el.

That is normal.

      The strange thing was that when
    the autoload was needed and bootstrapping failed because it was not
    available, loaddefs.el had already been regenerated and the variable
    was already defined in it.  But apparently only ldefs-boot.el and not
    the updated loaddefs.el had been loaded at that stage.

I don't see a reason not to change that, but there might be a good
reason that I don't see yet.

    Is the moral of this story that each time that somebody adds a new
    autoload that is necessary for compilation during bootstrapping (as
    opposed to just an autoload that allows the user to call an
    interactive function without having to load the file first), one has
    to update ldefs-boot by overwriting it with a valid up to date copy of
    loaddefs.el?

It seems to be so, with the current design.  Of course, most autoloads
are not necessary for compilation during bootrapping.  As for detecting
those that are, the current system, which is to see that bootstrap fails
and update ldefs-boot.el, might be the most efficient one.

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

* Re: ldefs-boot.el
  2005-08-13  1:10 ` ldefs-boot.el Thien-Thi Nguyen
@ 2005-08-14  0:30   ` Luc Teirlinck
  2005-08-14  0:35   ` ldefs-boot.el Luc Teirlinck
  1 sibling, 0 replies; 6+ messages in thread
From: Luc Teirlinck @ 2005-08-14  0:30 UTC (permalink / raw)
  Cc: emacs-devel

Thien-Thi Nguyen wrote:

   > # bootstrap should always work with ldefs-boot.el.
   > 
   > No, it does not always work.  (How could it?)  It only works if you
   > update ldefs-boot whenever needed.

   the "should" in the last sentence of the makefile frag implies the last
   sentence you wrote ("it only works...").  perhaps adding that sentence to
   the makefile would be sufficient to nudge the implication to explanation?

I suggest the following exoansion of the comment in lisp/Makefile.in.
I can install if it looks OK.

===File ~/lisp-Makefile.in-diff=============================
*** Makefile.in	07 Aug 2005 10:23:06 -0500	1.65
--- Makefile.in	13 Aug 2005 18:29:24 -0500	
***************
*** 218,227 ****
  # Build loaddefs.el to make sure it's up-to-date.  If it's not, that
  # might lead to errors during the bootstrap because something fails to
  # autoload as expected.  If there is no emacs binary, then we can't
! # build autoloads yet.  In that case we have to use ldefs-boot.el;
! # bootstrap should always work with ldefs-boot.el.  (Because
! # loaddefs.el is an automatically generated file, we don't want to
! # store it in the source repository).
  
  bootstrap-prepare:
  	if test -x $(EMACS); then				\
--- 218,230 ----
  # Build loaddefs.el to make sure it's up-to-date.  If it's not, that
  # might lead to errors during the bootstrap because something fails to
  # autoload as expected.  If there is no emacs binary, then we can't
! # build autoloads yet.  In that case we have to use ldefs-boot.el.
! # Bootstrap should always work with ldefs-boot.el.  Therefore,
! # whenever a new autoload cookie gets added that is necessary during
! # bootstrapping, ldefs-boot.el should be updated by overwriting it with
! # an up-to-date copy of loaddefs.el that is uncorrupted by
! # local changes.  (Because loaddefs.el is an automatically generated
! # file, we don't want to store it in the source repository).
  
  bootstrap-prepare:
  	if test -x $(EMACS); then				\
============================================================

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

* Re: ldefs-boot.el
  2005-08-13  1:10 ` ldefs-boot.el Thien-Thi Nguyen
  2005-08-14  0:30   ` ldefs-boot.el Luc Teirlinck
@ 2005-08-14  0:35   ` Luc Teirlinck
  2005-08-14  9:49     ` ldefs-boot.el Thien-Thi Nguyen
  1 sibling, 1 reply; 6+ messages in thread
From: Luc Teirlinck @ 2005-08-14  0:35 UTC (permalink / raw)
  Cc: emacs-devel

>From my previous reply:

   I suggest the following exoansion of the comment in lisp/Makefile.in.

Unless, of course, it would be possible to come up with an alternate
design that would make ldefs-boot.el unnecessary, or automatically
updating.

Sincerely,

Luc.

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

* Re: ldefs-boot.el
  2005-08-14  0:35   ` ldefs-boot.el Luc Teirlinck
@ 2005-08-14  9:49     ` Thien-Thi Nguyen
  0 siblings, 0 replies; 6+ messages in thread
From: Thien-Thi Nguyen @ 2005-08-14  9:49 UTC (permalink / raw)
  Cc: emacs-devel

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> Unless, of course, it would be possible to come up with an alternate
> design that would make ldefs-boot.el unnecessary, or automatically
> updating.

the explanation looks good; you should probably install it.  if someone
wishes to implement an automatic approach in the future, those notes
will inform its design.  in this way we can make incremental progress.

(note: "in the future" may mean before release or after -- that's for
whoever wants to write the automatic approach to figure out.  my point
is that there is no point in holding back on comment-munging changes
that clarify existing process.)

thi

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

end of thread, other threads:[~2005-08-14  9:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-12 19:49 ldefs-boot.el Luc Teirlinck
2005-08-13  1:10 ` ldefs-boot.el Thien-Thi Nguyen
2005-08-14  0:30   ` ldefs-boot.el Luc Teirlinck
2005-08-14  0:35   ` ldefs-boot.el Luc Teirlinck
2005-08-14  9:49     ` ldefs-boot.el Thien-Thi Nguyen
2005-08-13 14:40 ` ldefs-boot.el Richard M. Stallman

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).