From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Async rebuild package-quickstart after packages update? was Re: 28.0.50; Proposal: slightly more efficient package-quickstart.el Date: Sat, 07 Aug 2021 07:45:33 +0200 Message-ID: References: <24842.41537.969310.87574@retriever.mtv.corp.google.com> <83tuk4jusd.fsf@gnu.org> <83pmurhy9s.fsf@gnu.org> <83h7g2itxx.fsf@gnu.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="10716"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Eli Zaretskii , raman , Stefan Monnier , EMACS development team To: chad Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 07 07:46:37 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mCFAK-0002ax-2r for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Aug 2021 07:46:37 +0200 Original-Received: from localhost ([::1]:46924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCFAI-00078S-LV for ged-emacs-devel@m.gmane-mx.org; Sat, 07 Aug 2021 01:46:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCF9P-0006TX-9j for emacs-devel@gnu.org; Sat, 07 Aug 2021 01:45:39 -0400 Original-Received: from mail-db8eur05olkn2055.outbound.protection.outlook.com ([40.92.89.55]:28640 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCF9N-0003Et-F1; Sat, 07 Aug 2021 01:45:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VKgwqS4WGO6G6y/xXtCmtB8eShKcf9E2VlXJ0ADeuinVOMkTRd760q6ZLhFZCPgFXsoZQ3xLESzyoVaRytSZlqwxmXL3eXcvAGYbD1wrq5xSaPtXKhjyaJ4oIf4ZQdRfhDZqDxZb2VK0510GSq3jVEeOk/c41/p26/BPRt67q2Kd1/Uz0pY5vKusLSy/dGXeO+D01uLpaevAOYbD/p3DLHyzKC7twOqvs0aXgpr5aLtiQPodqQsW4h/UEe8NWwPW/luTOiLuxHlw35JzV5xQTdTMZsnqYVjo3I8ac8F9sYt7kOdzAuwmzMCg/EyN6Bgzcmwx+hTQRD0lduopJDVDKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XIayLVvsv8Nwaq+Ng+Op68yEJgCV0Ut14notm77ihTs=; b=G1zUiV9WMDZ+G9KiZw/YXfV3VJYkzFFWENAkNxTQilPDTYl4IOogsgqsWJN79PyzGdlYkYftMoa69yNSayJAVLwAriretudZp+xS8nMn7JSwZgBj6H0Uf7xG3iJ55YBC3Vzq3oZLoUREXR1uDmKx4WITEpqtQ60rBZMjfdLCcX9hdQviY4spJTqCTNfMJb7tMkXVI3erGLTWnbS1byeEeZEu7esJ3AjYwCh8T2D/QoF2jq23tuMNXUQpUGJ3NetkLix5GL0A7nfdcD6SWIikSmlyRa1vz6rM2gHu9EUH8HWWRZCOms3YQB+auPZ785Y1DxloP0URlnYzxl9VYARpGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XIayLVvsv8Nwaq+Ng+Op68yEJgCV0Ut14notm77ihTs=; b=ssivJ5IMf1Jn4Kbd+MiqfyScKOnOdgk4QOhY+Tsk8lZuYcl7mZ57DdvFslYZuUFruk02jrozjk4VQG5NpVU01nvPXO8+YyoQWbI/qV7s3dbLvrFEZU+vKc4gwRWVnwSe3lMPXP0w2WD1gsZAqVdI0lv3XV6PbG2+quizlgTcLsb0SLSHxseNRXzgoSq1kT6z69WIDTzUcfSx7y2I2oFYVNx8SMnlHPCH7FMwt1hqlD5kkbYbvJCqfD7uzzIka8nX1nStbTp0fzwjGh1SZ4a+cN4I/LilD3kloSHut+TAIN6PFd8W5VvY5qRmALOvkxImo8j7ey8WnxA07MmHkNdciA== Original-Received: from AM6EUR05FT065.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc11::51) by AM6EUR05HT049.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc11::260) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16; Sat, 7 Aug 2021 05:45:34 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc11::50) by AM6EUR05FT065.mail.protection.outlook.com (2a01:111:e400:fc11::106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.16 via Frontend Transport; Sat, 7 Aug 2021 05:45:34 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:2E047312C9AB29F6C7799F0DC4FC5734B50756BA20C05D3BBEE906C8ABA5500D; UpperCasedChecksum:DC2069EFA9CD87A08B5D5080F5C7BF3F8818A9662C3DA28026CD6200579D2619; SizeAsReceived:8725; Count:46 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4394.021; Sat, 7 Aug 2021 05:45:34 +0000 In-Reply-To: (chad's message of "Fri, 6 Aug 2021 17:46:43 -0700") X-TMN: [Q9TEJNXTShjgynvEQsHx5D5ol3vXf3w6] X-ClientProxiedBy: AM7PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:20b:100::19) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87h7g1olj6.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM7PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:20b:100::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.17 via Frontend Transport; Sat, 7 Aug 2021 05:45:33 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 6f3b5961-45e9-425a-c056-08d9596692f8 X-MS-TrafficTypeDiagnostic: AM6EUR05HT049: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mat0mSo1grbcNpv2cdKGEClVWtK4DKmpkSCBJCyVoxVpzxTfPuaonQY3R6atD33xnNYSplmbnizkRjJB5YHY5OhbxmvkSUszYsbntbDcc1DyivMN4ZsHR7dADSMrNKCbUPZ8uSkkrpcHB5BFSRixlNOW9+34OOxelfxOOvRngm2gPuQE4WxLC5KZLtQJcVf/njwCvlHGbwIxmxSeGsn9y1jhLVxHmKMJuZW9q2tRzzhqGZh5lZjcsmIC4kQKEssxXbYBG8eMFL4B38u8zfeeAwQyZjpx027qK4h8OXcDy4aBmDwwegqf0n1xyQosP0PXnBFdgyT0LBPSdUzd5pF3Baxhwazvy6gdobZoZfaBz4mWpK1vxhaa2ffBwhHpjIwrSthfbl32NYMRlVKwo7QCPF3USCxa8fZK7hDj6mtXPZSOFF2tYnibxpv1HcewRRPq X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B4ArMwWm1IatKmpzsRMxa5BaQBn1LVZaOWvLebPS4IhMAnzbOUI5cvBu69N3GSYXBiuyVihqKjbkm1wE+nFmGM9Eywnqau11qPiWMaiVuOwQ6+bnUTqoh9HOApqKRIKPQNBAOlpo9RQJAWMTDejjRA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f3b5961-45e9-425a-c056-08d9596692f8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2021 05:45:34.0243 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM6EUR05FT065.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6EUR05HT049 Received-SPF: pass client-ip=40.92.89.55; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:272158 Archived-At: chad writes: > As near as I can tell, the moderate-sized potential problem with "just start another full interactive session, and communicate with > it" is the near-certainty that some people's interactive startup isn't (effectively) reentrant. There are lots of ways this can happen > -- package auto-loading and refreshing, cache files like desktop/places/recent/history/etc, configurations that automatically open > dedicated frames in various places, multiple servers confusing emacsclient, and the like. (Back in the 90's and early 00's, I used to > see user configurations like this all the time.) I thought that emacs does not open frames in daemon mode (more than one invisible or how it works). > There is some mitigation for this effect in that it overlaps with daemon-mode non-rerentrancy, and also some in that only a subset > of users will use package-quickstart. That's probably enough to put together an experiment, but I would expect some (solvable!) > problems to crop up. > > On the other hand, if I understand T.V Raman's suggestion to put together a package that learns which parts of the environment > are necessary to share between a configured emacs and a subsequent emacs batch process, it sounds like a reasonable approach > toward a similar middle ground, but starting from the cleaner -Q state. If I'm reading async.el correctly, it already has machinery > for this in, for example, async-inject-variable. > > (defun async-inject-variables > > (include-regexp &optional predicate exclude-regexp noprops) "Return a `setq' form that replicates part of the calling > environment. > It sets the value for every variable matching INCLUDE-REGEXP and > also PREDICATE. It will not perform injection for any variable > matching EXCLUDE-REGEXP (if present) or representing a `syntax-table' > i.e. ending by \"-syntax-table\". > When NOPROPS is non nil it tries to strip out text properties of each > variable's value with `async-variables-noprops-function'. > It is intended to be used as follows: > (async-start > \\=`(lambda () > (require \\='smtpmail) > (with-temp-buffer > (insert ,(buffer-substring-no-properties (point-min) (point-max))) > ;; Pass in the variable environment for smtpmail > ,(async-inject-variables \"\\\\=`\\(smtpmail\\|\\(user-\\)?mail\\)-\") > (smtpmail-send-it))) > \\='ignore)" > > It also has this option, which suggests that this issue comes up at least some of the time, and is worked around in situ rather than > solved at the package level: > > (defvar async-quiet-switch "-Q" > "The Emacs parameter to use to call emacs without config. > Can be one of \"-Q\" or \"-q\". > Default is \"-Q\" but it is sometimes useful to use \"-q\" to have a > enhanced config or some more variables loaded.") > > I think there's an interesting area to explore here, especially given the relatively low utility of make-thread, the way cores are > multiplying, and the extra crunching-power desired by potential changes like native-comp, json, lsp, and tree-sitter (which I > assume, perhaps wrongly, will end up with loadable binary objects for some/most languages), this seems like a good problem to > look at. I agree that it is an interesting problem, it seems like a lot of work.