From: Lars Ingebrigtsen Date: Fri, 24 Jun 2022 08:45:34 +0000 (+0200) Subject: Make warning about require/autoload while bootstrapping not error out X-Git-Tag: emacs-29.0.90~1447^2~1501 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2ff5cb4cb4420e2b18ea8451ad0b29f1a69bdb6c;p=emacs.git Make warning about require/autoload while bootstrapping not error out * src/fns.c (Frequire): * src/eval.c (Fautoload_do_load): Avoid further errors while outputting the error about not being able to autoload/require while bootstrapping. --- diff --git a/src/eval.c b/src/eval.c index 346dff8bdcc..141d2546f08 100644 --- a/src/eval.c +++ b/src/eval.c @@ -2273,8 +2273,13 @@ it defines a macro. */) /* This is to make sure that loadup.el gives a clear picture of what files are preloaded and when. */ if (will_dump_p () && !will_bootstrap_p ()) - error ("Attempt to autoload %s while preparing to dump", - SDATA (SYMBOL_NAME (funname))); + { + /* Avoid landing here recursively while outputting the + backtrace from the error. */ + gflags.will_dump_ = false; + error ("Attempt to autoload %s while preparing to dump", + SDATA (SYMBOL_NAME (funname))); + } CHECK_SYMBOL (funname); diff --git a/src/fns.c b/src/fns.c index 4a9954ce903..5ee8482d003 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3121,8 +3121,13 @@ FILENAME are suppressed. */) /* This is to make sure that loadup.el gives a clear picture of what files are preloaded and when. */ if (will_dump_p () && !will_bootstrap_p ()) - error ("(require %s) while preparing to dump", - SDATA (SYMBOL_NAME (feature))); + { + /* Avoid landing here recursively while outputting the + backtrace from the error. */ + gflags.will_dump_ = false; + error ("(require %s) while preparing to dump", + SDATA (SYMBOL_NAME (feature))); + } /* A certain amount of recursive `require' is legitimate, but if we require the same feature recursively 3 times,