From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#53024: 29.0.50; Wishlist: Byte-compile loaddefs.el? Date: Sun, 31 Jul 2022 18:35:32 +0200 Message-ID: <87a68p2qaz.fsf@gnus.org> References: <87ee5mdvqu.fsf@gnus.org> <874k5wj6qr.fsf@gnus.org> <87sfmh38ic.fsf@gnus.org> <87o7x537pd.fsf@gnus.org> <87k07t36e8.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18975"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: monnier@iro.umontreal.ca To: 53024@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 31 18:36:12 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIBvI-0004ie-Bi for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jul 2022 18:36:12 +0200 Original-Received: from localhost ([::1]:49146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIBvH-00041a-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Jul 2022 12:36:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIBv8-00041D-F6 for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 12:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48799) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIBv8-0000uB-6D for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 12:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIBv8-0006tU-1F for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2022 12:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jul 2022 16:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53024 X-GNU-PR-Package: emacs Original-Received: via spool by 53024-submit@debbugs.gnu.org id=B53024.165928534626478 (code B ref 53024); Sun, 31 Jul 2022 16:36:01 +0000 Original-Received: (at 53024) by debbugs.gnu.org; 31 Jul 2022 16:35:46 +0000 Original-Received: from localhost ([127.0.0.1]:38548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIBur-0006t0-QX for submit@debbugs.gnu.org; Sun, 31 Jul 2022 12:35:46 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:37148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIBup-0006sm-MS for 53024@debbugs.gnu.org; Sun, 31 Jul 2022 12:35:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=K8Mv/REYK8aqmKkWQb5JWBX9/T1hCgofJHPAjPAJDW0=; b=iKAn4RNYT0yNoDKhfNzpbKmMpx 36a7XnmVmu3B66UrfRw8WXQaTibTKotQVxx9IXF2eRIpOinq7aV+1Qqxm9ZsCjcRFB2/dkPB92Fxu Wp9oXJjufYpwFLs63WT7qC0NELuC1XRZ193L87sd9qnM6/zkKDopnDLMSCWIehyMVVFg=; Original-Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIBuf-0004ic-3L; Sun, 31 Jul 2022 18:35:35 +0200 In-Reply-To: <87k07t36e8.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 31 Jul 2022 12:47:59 +0200") X-Now-Playing: Steven Brown's _Searching For Contact_: "Scene 2: The Bar (Last Rendezvous)" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238352 Archived-At: With the following, Emacs builds successfully. The problem is that we need to generate the loaddefs files before compile-main (so that it picks up the .el files for compilation), but we do this after we've built Emacs, so a change that updates loaddefs.el will first compile the .elc file, and then the next "make" will rebuild src/emacs, which is backwards. But I'm unable to follow the logic completely in the relevant Makefiles. I've tried a number of things here, but I seem to be unable to make the src/Makefile depend on the lisp/loaddefs.elc file in any sensible way -- I either end up with generating the .elc file twice or none at all, which is frustrating. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 9516f2fc36..8f08195df8 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -196,13 +196,16 @@ org-manuals: # from ../src rules, but that doesn't seem possible due to the various # non-trivial dependencies. -# We make $(lisp)/loaddefs.el a dependency of .PHONY to cause Make to +# We make autoloads a dependency of .PHONY to cause Make to # ignore its time stamp. That's because the real dependencies of # loaddefs.el aren't known to Make, they are implemented in # loaddefs-generate--emacs-batch. +autoloads .PHONY: + $(AM_V_GEN)$(emacs) \ + -l $(lisp)/emacs-lisp/loaddefs-gen.elc \ + -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST} -autoloads .PHONY: $(lisp)/loaddefs.el -$(lisp)/loaddefs.el: gen-lisp $(LOADDEFS) $(lisp)/emacs-lisp/loaddefs-gen.elc +$(lisp)/loaddefs.el: $(LOADDEFS) $(lisp)/emacs-lisp/loaddefs-gen.elc $(AM_V_GEN)$(emacs) \ -l $(lisp)/emacs-lisp/loaddefs-gen.elc \ -f loaddefs-generate--emacs-batch ${SUBDIRS_ALMOST} diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el index 261e44aece..830799ec36 100644 --- a/lisp/emacs-lisp/loaddefs-gen.el +++ b/lisp/emacs-lisp/loaddefs-gen.el @@ -459,7 +459,7 @@ loaddefs-generate--compute-prefixes (push name prefs))))) (loaddefs-generate--make-prefixes prefs load-name))) -(defun loaddefs-generate--rubric (file &optional type feature) +(defun loaddefs-generate--rubric (file &optional type feature compile) "Return a string giving the appropriate autoload rubric for FILE. TYPE (default \"autoloads\") is a string stating the type of information contained in FILE. TYPE \"package\" acts like the default, @@ -467,7 +467,9 @@ loaddefs-generate--rubric If FEATURE is non-nil, FILE will provide a feature. FEATURE may be a string naming the feature, otherwise it will be based on -FILE's name." +FILE's name. + +If COMPILE, don't include a \"don't compile\" cookie." (let ((lp (and (equal type "package") (setq type "autoloads")))) (with-temp-buffer (generate-lisp-file-heading @@ -481,6 +483,7 @@ loaddefs-generate--rubric (insert " \n;;; End of scraped data\n\n") (generate-lisp-file-trailer file :provide (and (stringp feature) feature) + :compile compile :inhibit-provide (not feature)) (buffer-string)))) @@ -585,7 +588,8 @@ loaddefs-generate (with-temp-buffer (if (and updating (file-exists-p loaddefs-file)) (insert-file-contents loaddefs-file) - (insert (loaddefs-generate--rubric loaddefs-file nil t)) + (insert (loaddefs-generate--rubric + loaddefs-file nil t include-package-version)) (search-backward "\f") (when extra-data (insert extra-data) diff --git a/lisp/loadup.el b/lisp/loadup.el index 21a87dbd77..a65c1724ae 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -185,9 +185,10 @@ ;; should be updated by overwriting it with an up-to-date copy of ;; loaddefs.el that is not corrupted by local changes. ;; admin/update_autogen can be used to update ldefs-boot.el periodically. -(condition-case nil (load "loaddefs.el") - ;; In case loaddefs hasn't been generated yet. - (file-error (load "ldefs-boot.el"))) +(condition-case nil + (load "loaddefs") + (file-error + (load "ldefs-boot.el"))) (let ((new (make-hash-table :test #'equal))) ;; Now that loaddefs has populated definition-prefixes, purify its contents. diff --git a/src/Makefile.in b/src/Makefile.in index 7d15b7afd5..feb809ea10 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -652,13 +652,11 @@ $(pdmp): ## for the first time, this prevents any variation between configurations ## in the contents of the DOC file. ## -$(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(doc_obj) $(lispsource)/loaddefs.el +$(etc)/DOC: $(libsrc)/make-docfile$(EXEEXT) $(doc_obj) $(AM_V_GEN)$(MKDIR_P) $(etc) $(AM_V_at)rm -f $(etc)/DOC $(AM_V_at)$(libsrc)/make-docfile -d $(srcdir) \ $(SOME_MACHINE_OBJECTS) $(doc_obj) > $(etc)/DOC - $(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \ - loaddefs.el $(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \ $(lib)/libgnu.a