From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauricio Collares Newsgroups: gmane.emacs.bugs Subject: bug#45854: 28.0.50; [feature/native-comp] autoload behavior different in the presence of errors Date: Wed, 13 Jan 2021 23:52:29 -0300 Message-ID: <87pn282psi.fsf@collares.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16772"; mail-complaints-to="usenet@ciao.gmane.io" To: 45854@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 14 03:53:12 2021 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 1kzsl4-0004E1-O3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Jan 2021 03:53:11 +0100 Original-Received: from localhost ([::1]:42074 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kzsl3-0006ev-CR for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 13 Jan 2021 21:53:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzskx-0006em-0P for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 21:53:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kzskw-00075x-PZ for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 21:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kzskw-0003Uf-Oo for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 21:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mauricio Collares Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Jan 2021 02:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45854 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.161059277013405 (code B ref -1); Thu, 14 Jan 2021 02:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jan 2021 02:52:50 +0000 Original-Received: from localhost ([127.0.0.1]:36927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzskj-0003U9-Ql for submit@debbugs.gnu.org; Wed, 13 Jan 2021 21:52:50 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:36220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kzski-0003U1-0M for submit@debbugs.gnu.org; Wed, 13 Jan 2021 21:52:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzskh-0006eD-Ne for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 21:52:47 -0500 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:56917) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kzskf-000709-NM for bug-gnu-emacs@gnu.org; Wed, 13 Jan 2021 21:52:47 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 80531258 for ; Wed, 13 Jan 2021 21:52:42 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 13 Jan 2021 21:52:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=collares.org; h= from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=fm2; bh=1f+2WAuVLGDe4frG49jOG12t+p ukYPdT0Z+smCYXzbo=; b=FHqnSAc/Mg35bFeP1aGL7QTWWfY71n9dFCJALJLCDo eY5c8VJf8lFv1jXccO/6//jJG4CEZs2nwZ4Wc6wmS8MkDdWe+/10iacYiIhpg8zZ malKiwBKzk6oFwf6nrB/REwz1ByVM246uJVv+SkfLFmuYEjEN7Oh66Fl9wBASqx6 XlJq7o2KDp91wPZDmAJTpvyVmjsUlkJTWusXrBhF6GKglcIXLkTrwFRUn7U4VPMK 0eroSSGnpbspbH9M9Io5/9som/B4BAZCvHrJe6Floi83aQClQbPhoOvhH5rzQ2u0 LvrASCEB+JCKSq6ga6pZQolkIQ41v0MvF7Yms9wnahoA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=1f+2WA uVLGDe4frG49jOG12t+pukYPdT0Z+smCYXzbo=; b=GYAQ3YW4kb9PfOufiQ7ZmD kRES4YEExDZMi0gRlxx759G8i5/4TNKddw1sroueo/zLfA4LaGkruSVRbPKePyAW qJ0szRV2rhBFsFskR6Xy/ycV/RYbgxLLnJ7Uv879aNDDkRjdEPxDzMC1l8BRo+zU WxGXTP7Ryj6qlQw9c5oU2Gq8nHDhYDwiS4/zF6hk82cJUTxfccslfc1XLI0A5T4D CbeSTcZabl6Mn++rVcXzPBCteFuLk0/ONrXQoguWDANrjfUTIQrVJuYNbYFymxkz 6AKzsZ+zU6MDZFK9O5EFsthU9YCWMSku43OQBYClj5WdYOBSjTQbxY6Pq5QqT2lQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedukedrtdeggdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgfgsehtqhertddttd ejnecuhfhrohhmpeforghurhhitghiohcuveholhhlrghrvghsuceomhgruhhrihgtihho segtohhllhgrrhgvshdrohhrgheqnecuggftrfgrthhtvghrnhepfffhffdvtedujeeite eivdetleeiveduleejvdfhgeevvedtueefhfeljedtleevnecukfhppeduledurddukeeh rdefiedrvdefjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehmrghurhhitghiohestgholhhlrghrvghsrdhorhhg X-ME-Proxy: Original-Received: from asus (unknown [191.185.36.237]) by mail.messagingengine.com (Postfix) with ESMTPA id F377B108005B for ; Wed, 13 Jan 2021 21:52:40 -0500 (EST) Received-SPF: pass client-ip=64.147.123.24; envelope-from=mauricio@collares.org; helo=wout1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:197925 Archived-At: The example is a bit convoluted, but it is a reduced example from another error I saw in the wild. It's not a big problem, but since this might be a bug I thought a report could be useful. I wish I could reduce it further, but hopefully this is enough. Suppose I have three files as below (I've appended an x to the original pac= kage names to avoid conflict): * File 1: transientx.el ;;; transientx.el --- x -*- lexical-binding: t; -*- ;; Package-Requires: ((emacs "25.1")) ;; Package-Version: 0 (require 'cl-lib) (require 'eieio) (defclass transient-suffix () ()) (cl-defmethod transient--init-suffix-key ((obj transient-suffix))) ;; (provide 'transientx) commented on purpose to cause an error when requir= ing ;;; transientx.el ends here * File 2: git-commitx.el ;;; git-commitx.el --- x -*- lexical-binding: t; -*- ;; Package-Requires: ((emacs "25.1") (transientx "20200601")) ;; Package-Version: 20210102.1242 (require 'transientx) ;;;###autoload (define-minor-mode global-git-commit-mode "desc" :global t :initialize (lambda (symbol exp) (add-hook 'find-file-hook 'git-commit-setup-check-buffer))) ;;;###autoload (defun git-commit-setup-check-buffer ()) (provide 'git-commitx) ;;; git-commitx.el ends here * File 3: elpa2nix.el (require 'package) (package-initialize) (defun elpa2nix-install-package () (pcase command-line-args-left (`(,archive) (with-temp-buffer (insert-file-contents archive) (package-unpack (package-buffer-info)))))) Then running the following two commands in order produces the stack trace below on the native-comp branch: $ emacs --batch -Q -l ~/elpa2nix.el -f elpa2nix-install-package transientx.= el=20 $ emacs --batch -Q -l ~/elpa2nix.el -f elpa2nix-install-package git-commitx= .el=20 git-commitx.el:6:1: Error: Loading file /home/collares/.emacs.d/elpa/transi= entx-0/transientx.elc failed to provide feature =E2=80=98transientx=E2=80=99 Done (Total of 0 files compiled, 1 failed, 2 skipped) Debugger entered--Lisp error: (error "transient--init-suffix-key is already= defined as s...") error("%s is already defined as something else than a gen..." transient--= init-suffix-key) cl-generic-ensure-function(transient--init-suffix-key) cl-generic-define-method(transient--init-suffix-key nil ((obj transient-s= uffix)) nil #f(compiled-function (obj) #)) require(transientx) load-with-code-conversion("/home/collares/.emacs.d/elpa/git-commitx-20210= 102...." "/home/collares/.emacs.d/elpa/git-commitx-20210102...." nil t) git-commit-setup-check-buffer() run-hooks(find-file-hook) after-find-file(nil t) find-file-noselect-1(# "~/git-commitx.el" nil nil = "~/git-commitx.el" (7340496 65025)) find-file-noselect("/home/collares/git-commitx.el") command-line-1(("-l" "/home/collares/elpa2nix.el" "-f" "elpa2nix-install-= package" "/home/collares/git-commitx.el")) command-line() normal-top-level() The transient--init-suffix-key error does not appear on trunk (the "failed to provide feature" error appears as expected). Reverting commit 7d7bfbf0346114b116e14a4338ea235d12674f13 makes the change of behaviour disappear, but I suspect it's not the true cause of the difference. Things that might be relevant: package-native-compile is nil, but when package-unpack is called on git-commitx.el the (require 'transientx) causes native compilation to happen. The above stacktrace seems to come from the "(package--load-files-for-activation new-desc :reload)" call in package.el's package-unpack. Let me know if I can provide more information. Best, Mauricio