From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#28994: 26.0.90; Build error during bootstrap Date: Wed, 25 Oct 2017 11:37:58 -0400 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1508946333 28976 195.159.176.226 (25 Oct 2017 15:45:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 25 Oct 2017 15:45:33 +0000 (UTC) To: 28994@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 25 17:45:27 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7Nrh-000598-ME for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Oct 2017 17:45:09 +0200 Original-Received: from localhost ([::1]:48853 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Nro-0000c3-V6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Oct 2017 11:45:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7Nre-0000Wk-Gy for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:45:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7Nrb-0003FZ-66 for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:45:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e7Nrb-0003EY-28 for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:45:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e7Nra-0003XK-OM for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Oct 2017 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 28994 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.150894624913505 (code B ref -1); Wed, 25 Oct 2017 15:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Oct 2017 15:44:09 +0000 Original-Received: from localhost ([127.0.0.1]:33510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7Nqi-0003Vl-R5 for submit@debbugs.gnu.org; Wed, 25 Oct 2017 11:44:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e7Nqh-0003VW-5w for submit@debbugs.gnu.org; Wed, 25 Oct 2017 11:44:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7Nqa-0001fx-QH for submit@debbugs.gnu.org; Wed, 25 Oct 2017 11:44:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:36217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e7Nqa-0001fl-Ms for submit@debbugs.gnu.org; Wed, 25 Oct 2017 11:44:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7NqZ-0000TM-5s for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:44:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e7NqV-0001X2-RE for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:43:59 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:47383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e7NqV-0001Uz-LP for bug-gnu-emacs@gnu.org; Wed, 25 Oct 2017 11:43:55 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id v9PFhrog010983 for ; Wed, 25 Oct 2017 11:43:53 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id CCE0266233; Wed, 25 Oct 2017 11:37:58 -0400 (EDT) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.3 X-NAI-Spam-Rules: 5 Rules triggered BEC_TRC1=0.1, BEC_TRC1_W_GEN_SPAM_FEATRE=0.1, GEN_SPAM_FEATRE=0.1, EDT_SA_DN_PASS=0, RV6144=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6144> : inlines <6144> : streams <1768387> : uri <2522246> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:138970 Archived-At: Package: Emacs Version: 26.0.90 The following: rm -f src/bootstrap-emacs lisp/progmodes/elisp-mode.elc make triggers the following message: [...] Loading emacs-lisp/lisp-mode... Loading .../lisp/progmodes/elisp-mode.el (source)... Eager macro-expansion failure: (error "Autoloading file .../lisp/emacs-lisp/regexp-opt.elc failed to define function flymake-log") Loading textmodes/text-mode... [...] It's arguably harmless, but the error is undesirable and the error message itself clearly shows we have a bug somewhere in our error reporting. I tracked down the source of the problem to: - autoload-do-load (called to fetch flymake-log) will call `load` telling it to silently ignore errors if flymake is not found. - then, indeed, flymake.el isn't found (because lisp/progmodes is not in load-path in this specific situation). - so after the call to `load` the macro is still not defined and the load-history has no trace of flymake.el since we didn't load it at all, hence the odd error message. The patch below to src/eval.c fixes this problem by: - not signaling an error if the load didn't define the function when we told load not to signal an error anyway (so we don't emit a misleading message about some unrelated file). - not telling load to ignore errors when we're trying to load a macro. So after that patch, we get the real error message: [...] Loading emacs-lisp/lisp-mode... Loading .../lisp/progmodes/elisp-mode.el (source)... Eager macro-expansion failure: (file-missing "Cannot open load file" "Aucun fichier ou dossier de ce type" "flymake") Loading textmodes/text-mode... [...] Which I fix with the patch to lisp/loadup.el. This then bumps into another error, because flymake.el ends up loading edmacro, which loads kmacro which tries to modify query-replace-map which doesn't exist yet, and if we fix that by loading `replace.el` we get yet another error because `replace.el` tries to use text-mode-map which again isn't defined yet, which I fix by loading text-mode. And now it works without signaling an error. Any objection to installing this patch, or suggestion to fix the string of problems some other way? Stefan diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 4abc571db4..5729f2fc8d 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el @@ -111,6 +111,7 @@ ;;; Code: ;; Customization: +(require 'replace) (defgroup kmacro nil "Simplified keyboard macro user interface." diff --git a/lisp/loadup.el b/lisp/loadup.el index d048f0736b..40e5651aa1 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -76,6 +76,7 @@ (setq max-lisp-eval-depth 2200) (setq load-path (list (expand-file-name "." dir) (expand-file-name "emacs-lisp" dir) + (expand-file-name "progmodes" dir) (expand-file-name "language" dir) (expand-file-name "international" dir) (expand-file-name "textmodes" dir) diff --git a/lisp/replace.el b/lisp/replace.el index a5548f461d..cdaeb9240a 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -28,6 +28,7 @@ ;;; Code: +(require 'text-mode) (eval-when-compile (require 'cl-lib)) (defcustom case-replace t diff --git a/src/eval.c b/src/eval.c index 52e4c96d4b..063deb4ba0 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1986,12 +1986,10 @@ it defines a macro. */) if (!CONSP (fundef) || !EQ (Qautoload, XCAR (fundef))) return fundef; - if (EQ (macro_only, Qmacro)) - { - Lisp_Object kind = Fnth (make_number (4), fundef); - if (! (EQ (kind, Qt) || EQ (kind, Qmacro))) - return fundef; - } + Lisp_Object kind = Fnth (make_number (4), fundef); + if (EQ (macro_only, Qmacro) + && !(EQ (kind, Qt) || EQ (kind, Qmacro))) + return fundef; /* This is to make sure that loadup.el gives a clear picture of what files are preloaded and when. */ @@ -2014,15 +2012,18 @@ it defines a macro. */) The value saved here is to be restored into Vautoload_queue. */ record_unwind_protect (un_autoload, Vautoload_queue); Vautoload_queue = Qt; - /* If `macro_only', assume this autoload to be a "best-effort", + /* If `macro_only' is set and fundef isn't a macro, assume this autoload to + be a "best-effort" (e.g. to try and find a compiler macro), so don't signal an error if autoloading fails. */ - Fload (Fcar (Fcdr (fundef)), macro_only, Qt, Qnil, Qt); + Lisp_Object ignore_errors + = (EQ (kind, Qt) || EQ (kind, Qmacro)) ? Qnil : macro_only; + Fload (Fcar (Fcdr (fundef)), ignore_errors, Qt, Qnil, Qt); /* Once loading finishes, don't undo it. */ Vautoload_queue = Qt; unbind_to (count, Qnil); - if (NILP (funname)) + if (NILP (funname) || !NILP (ignore_errors)) return Qnil; else {