From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Gillespie Newsgroups: gmane.emacs.bugs Subject: bug#53675: lisp/startup.el; startup--require-comp-safely async compile breaks if comp is required in init Date: Mon, 31 Jan 2022 20:13:22 -0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8460"; mail-complaints-to="usenet@ciao.gmane.io" To: 53675@debbugs.gnu.org, akrl@sdf.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 01 05:14:14 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 1nEkYY-00023r-5N for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 01 Feb 2022 05:14:14 +0100 Original-Received: from localhost ([::1]:59772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEkYX-0008Es-48 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Jan 2022 23:14:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEkYP-0008Cj-SM for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2022 23:14:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEkYN-0005Of-HT for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2022 23:14:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nEkYM-0003EZ-Cb for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2022 23:14:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tom Gillespie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 01 Feb 2022 04:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53675 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Emacs Bug Report , Andrea Corallo Original-Received: via spool by submit@debbugs.gnu.org id=B.164368882012383 (code B ref -1); Tue, 01 Feb 2022 04:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Feb 2022 04:13:40 +0000 Original-Received: from localhost ([127.0.0.1]:41413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkY0-0003Df-BV for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:13:40 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEkXy-0003DX-ES for submit@debbugs.gnu.org; Mon, 31 Jan 2022 23:13:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEkXx-00083l-CX for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2022 23:13:38 -0500 Original-Received: from [2a00:1450:4864:20::330] (port=44633 helo=mail-wm1-x330.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEkXv-0005Mo-Ph for bug-gnu-emacs@gnu.org; Mon, 31 Jan 2022 23:13:37 -0500 Original-Received: by mail-wm1-x330.google.com with SMTP id l35-20020a05600c1d2300b0034d477271c1so730407wms.3 for ; Mon, 31 Jan 2022 20:13:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=gUARI+nKHV3CJQ6bp9c9+dEJdBuZ41ncbhFRIPmYcoo=; b=OIhNQbIpiV451J1P5ioRLGQrPJ29eLverENvenCIJPmSiy9OWn7M2uNR7Nu7KBBt6G jYYSNIhM4KwY0Zr3GEYul/aml9q3EpdxOYhYu1FjEydEdfNXIBJ65ybLJH6CVkKQSdep DbWZc6v+ZjYdIoHiINZXdP+z+Y1akegHX132nnz1trtrDsvoh/b88eD/UtsYIo3qhSA0 clfmDazTcZVMJdFZTXG//6ItFKUuNk9UO/PJ1KnJyd31SxK+e5ejFKGlJVCgb2FDs4FQ p/aU1Pvrl5+4DHp29DSrZriLIqay0b3PuuPZAR/uOCR+aA1JifsLusWkWgU+q0zo3hau UtDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gUARI+nKHV3CJQ6bp9c9+dEJdBuZ41ncbhFRIPmYcoo=; b=toJ2B2/8UN/9nJrNyzwV64NfIKyBGg/RrooN8XEtlSWHPnbYXuIFfj0W2+f4x8G6gv or/MLVZzLe1Y9aCQmDjk0ZNFGTSLMx4czTGqbrx+q6kO9T/PsAZ6DVD+/UShUo5fRLHi I9IHZyBGN8mHKK/Uq4zHA7R+bMRgF8C55kQvasIl91sRqHjVZxS3hxnhRqyxlHCS5G7k hcHLAwGmSRzxOuA5J/ZPKodmVRKw9Jl6y1qfc5T1nU+Lns3p/Ry4ebhtkqdLREMHceAH flQwKyavhOSAzJ7FkcXsfgOJTHwaTKdkZBripe1QxdsQFv0c6I+D9nrkDZ4v76ijm12i x3DA== X-Gm-Message-State: AOAM5326oGTy3x4BJ4GB8MSEWNcRF1CgixnzzR9q5+TpnuKc9jD+vIcX aRq4vML5D93D6wjxe0JGZcl2Q9hAEuYTr0gslscuh182jfk= X-Google-Smtp-Source: ABdhPJxOAhUqRcD4Gnq8IDDerFa+ydv6P6/isNdIvIeLhhvy3yglI7Gfz9hOzH7WnsWU6Jy8+n9HiX0+P+TyuFv4Uok= X-Received: by 2002:a7b:c217:: with SMTP id x23mr97459wmi.177.1643688813012; Mon, 31 Jan 2022 20:13:33 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::330 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=tgbugs@gmail.com; helo=mail-wm1-x330.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:225736 Archived-At: async compilation no longer runs on startup if comp is required during loading of user init files The issue is from 536a57b72ce11b1bb8d1b34b339424fea6ccbcce Fix potential native compiler circular dependencies during load If for whatever reason during the loading of a user init file the feature 'comp is loaded (e.g. because they have a call to (use-package queue) in init.el), then startup will not honor delayed native compilations. Known causes are cases where (require 'comp) is called directly in an init file, or where any comp autoload is reached e.g. if a builtin such as macroexpand is advised during init re: bug#47049. This took a very long time to debug because the autoloads make it impossible to grep for the source of the issue. The underlying issues is that startup--require-comp-safely assumes that it is guaranteed to be called for the first time in an state where 'comp has not already been required. This is not the case since all user init files are loaded before startup--require-comp-safely is called. As far as I can tell the issue can be fixed by removing the unless (featurep 'comp) check. I'm not sure what side effects removing the check might cause, however it does restore the expected behavior. The patched version is: (defun startup--require-comp-safely () "Require the native compiler avoiding circular dependencies." ;; Require comp with `comp--loadable' set to nil to break ;; circularity. (let ((comp--loadable nil)) (require 'comp)) (native--compile-async comp--delayed-sources nil 'late) (setq comp--delayed-sources nil))