From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#55056: [PATCH] Delete temporary Flymake Elisp files Date: Thu, 21 Apr 2022 16:42:05 +0000 Message-ID: <87mtgejsma.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13880"; mail-complaints-to="usenet@ciao.gmane.io" To: 55056@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 21 19:56:22 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 1nhb2U-00037N-7P for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Apr 2022 19:56:22 +0200 Original-Received: from localhost ([::1]:58454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhb2T-0005UT-9K for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Apr 2022 13:56:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhZtW-0002iJ-Ek for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 12:43:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56968) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhZtW-0003OS-2r for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 12:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nhZtV-0006U6-V8 for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 12:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Apr 2022 16:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55056 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.165055933924860 (code B ref -1); Thu, 21 Apr 2022 16:43:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Apr 2022 16:42:19 +0000 Original-Received: from localhost ([127.0.0.1]:50865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhZsp-0006St-7L for submit@debbugs.gnu.org; Thu, 21 Apr 2022 12:42:19 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:46120) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nhZsn-0006Sk-NH for submit@debbugs.gnu.org; Thu, 21 Apr 2022 12:42:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhZsn-0001PW-9Z for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 12:42:17 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:54273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhZsj-0003In-GR for bug-gnu-emacs@gnu.org; Thu, 21 Apr 2022 12:42:16 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 363D0240107 for ; Thu, 21 Apr 2022 18:42:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1650559331; bh=7GNB6k7Oy5f5S/tRsvTvJK9sUALeNjBGAlRdfUdNzNs=; h=From:To:Subject:Autocrypt:Date:From; b=OEnEsnTUiHw4kMld3Hf3hwMxDIZ8pQKr2xSB1616yji3cU7djqusR5rZgNE2R3mMo I8Q8KXU37FrZQGECfAVtQtiQJc6ugpih5Kr41L2ti91uPLVga8nkof8R0u/dTauENp I57RoRIL4HilNsnhC77HB61mRoPa441mLNp1iE66LN+dk826ptoK39oLEx/3cHI+jZ UWYAPwJlcDm9greU1xYMC1CItLAHmFNL76BMy/jfeuMOPq1barhmJ46xSp+XTV9qsJ 6HAqAxKc/PakvmMz6ElXTmtnF9dHskEXJWkV9EFEUaGy/lHv2OPZarY+1HoPeFvX2n Byxu9PjUpY5Wg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4KkjxZ4d1Zz9rxN for ; Thu, 21 Apr 2022 18:42:10 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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:230390 Archived-At: --=-=-= Content-Type: text/plain Tags: patch My temporary directory appears to always be littered with flymake files. The reason for this appears to be that the Elisp Flymake backend doesn't always clean up after itself, when it should. In the worst case I can run out of space and that can mess up a lot of things on a system. The below patch adds a check to the sentinel to do so. I was a bit paranoid and considered more process-states that might be necessary, but I hope that someone with a better understanding of the process interface will be able to help here. In GNU Emacs 29.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 2.24.33, cairo version 1.16.0) of 2022-04-18 built on icterid Repository revision: 7b1881682bfbd1ff83d47b88fa8cca22c0290c17 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure --with-native-compilation --with-cairo --with-harfbuzz LDFLAGS=-flto 'CFLAGS=-march=native -mtune=native -pipe'' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Delete-temporary-Flymake-Elisp-files-every-time-a-pr.patch >From 26eba81b8a05e394d495336749da171e1cdf355e Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Thu, 21 Apr 2022 17:04:19 +0200 Subject: [PATCH] Delete temporary Flymake Elisp files every time a process ends * elisp-mode.el (elisp-flymake-byte-compile): Handle terminal process states besides exit by also removing the temporary file. --- lisp/progmodes/elisp-mode.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 0dfff32f20..c99cf34db0 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -2101,7 +2101,11 @@ elisp-flymake-byte-compile :explanation (format "byte-compile process %s died" proc)))) (ignore-errors (delete-file temp-file)) - (kill-buffer output-buffer)))) + (kill-buffer output-buffer))) + (when (memq (process-status proc) '(failed closed signal)) + (message "Elisp flymake [%s]: %S" (buffer-file-name) (process-status proc)) + (ignore-errors (delete-file temp-file)) + (kill-buffer output-buffer))) :stderr " *stderr of elisp-flymake-byte-compile*" :noquery t))))) -- 2.30.2 --=-=-= Content-Type: text/plain -- Philip Kaludercic --=-=-=--