From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Camden Narzt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 05:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 61668@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167695808911557 (code B ref -1); Tue, 21 Feb 2023 05:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Feb 2023 05:41:29 +0000 Received: from localhost ([127.0.0.1]:54278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pULP3-00030E-7C for submit@debbugs.gnu.org; Tue, 21 Feb 2023 00:41:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:58322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUAoy-0001a2-UB for submit@debbugs.gnu.org; Mon, 20 Feb 2023 13:23:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUAoq-0000ez-V6 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 13:23:22 -0500 Received: from pv50p00im-zteg10021401.me.com ([17.58.6.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pUAop-0000l5-Bb for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 13:23:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1676917394; bh=vMBGquMwYWBkzptaChiLR6CyDAaHRtXighsaO1Rj/DI=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=YXoJi4bvbDAVOp37CQ20yvrMJUAwhOYeI5PjUXoc92cnDzcQO4wyR2OHNSWUa4PHu 2ecvk4HYdibYJ+YLmMeTyV9Hv1Xa3VELT73wbpjQug2T/+fLOST48xYmOpH/l7jETd 0dHR+tqqk8N0X+B5ciduP0rPrdb3swo0fHaPtR+/WdxvS+02PTfEevQMn+BWpG5os0 QNvyk5BzF7frS7xJh2mD4CXTCSDn7esARuoHfM4Cn3Q428ZW0n63ffri9cQW96XVmY bM2z6N/FaxqKXkaKxrHuRWBW3pkzQLrZ6ibviiGHH9QkaaG0fRio9YwR29FnBvJE5E uW7qs/YOTy0Mg== Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10021401.me.com (Postfix) with ESMTPSA id 5E5AE8E0FA8 for ; Mon, 20 Feb 2023 18:23:13 +0000 (UTC) From: Camden Narzt Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Message-Id: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> Date: Mon, 20 Feb 2023 11:23:02 -0700 X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Proofpoint-ORIG-GUID: gyGepvdrLCEeUoU79pLrd-nsH52ZOtZG X-Proofpoint-GUID: gyGepvdrLCEeUoU79pLrd-nsH52ZOtZG X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.517,18.0.572,17.11.64.514.0000000 definitions=2022-06-21_01:2022-06-21_01,2020-02-14_11,2022-02-23_01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1011 phishscore=0 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2302200169 Received-SPF: pass client-ip=17.58.6.47; envelope-from=c.narzt@me.com; helo=pv50p00im-zteg10021401.me.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Mailman-Approved-At: Tue, 21 Feb 2023 00:41:23 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) I=E2=80=99m sorry if this is not the correct place to report a = flymake-proc bug, but since flymake is included in the emacs git repo I = figured it might be ok. I=E2=80=99m currently seeing incorrect behaviour from the = `flymake-proc--delete-temp-directory` function. The path is parsed and = then reassembled incorrectly as the following backtrace extract = demonstrates: = flymake-proc--safe-delete-directory("/private/var/folders/p7/03_g5t611499l= mjqhwc5tljr0000gn/T/000gn/T/Users/camdennarzt/Developer/Java/getargv.java/= src/main/java/cam/narzt/getargv") = flymake-proc--delete-temp-directory("/private/var/folders/p7/03_g5t611499l= mjqhwc5tljr0000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main= /java/cam/narzt/getargv/=E2=80=9C) As you can see the `000gn/T/` segment of the path gets duplicated when = `flymake-proc--safe-delete-directory` gets called. This is because in `flymake-proc--delete-temp-directory` when the = `suffix` variable is declared it is assumed that `(directory-file-name = temporary-file-directory)` is a prefix of the `dir-name` argument, = however `(directory-file-name temporary-file-directory)` doesn=E2=80=99t = seem to resolve symlinks in the path whereas `dir-name` seems to have = symlinks already resolved, so they don=E2=80=99t necessarily match. On = my system the difference is: (directory-file-name temporary-file-directory) =E2=86=92 = "/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T=E2=80=9D dir-name =E2=86=92 = "/private/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/Users/camdennarz= t/Developer/Java/getargv.java/src/main/java/cam/narzt/getargv/=E2=80=9C Note the "/private=E2=80=9D prefix on the `dir-name` path. That = difference in length causes the suffix to be incorrectly determined and = then causes a bunch of errors while any subsequent function call tries = to work with a path with the `000gn/T/` segment duplicated which = obviously doesn=E2=80=99t exist in the fs. Changing the suffix variable to be computed as follows fixes the bug: (substring dir-name (1+ (length (file-truename (expand-file-name = (directory-file-name temp-dir)))))) If this can be fixed that=E2=80=99s great, if there=E2=80=99s somewhere = else I should report this I=E2=80=99d love to know. Cheers, Camden Narzt= From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 12:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Camden Narzt , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.16769829108706 (code B ref 61668); Tue, 21 Feb 2023 12:36:02 +0000 Received: (at 61668) by debbugs.gnu.org; 21 Feb 2023 12:35:10 +0000 Received: from localhost ([127.0.0.1]:54847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pURrR-0002GK-Up for submit@debbugs.gnu.org; Tue, 21 Feb 2023 07:35:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52450) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pURrP-0002Fi-43 for 61668@debbugs.gnu.org; Tue, 21 Feb 2023 07:35:08 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pURrI-0004Yc-Ri; Tue, 21 Feb 2023 07:35:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=lHHgsJIao16N+UsXZQJP7Rtjo5IUnniTqnTsNDzt36g=; b=AQ8GWvW+M/chyr7Ntmmw 0pxachSmePaN9DsDmzl0VgVyYm+l4t1fpT5VJAycghNlMzJRiHH10eTM9gluMg7kk+lTH+ERniyWa BBjAOJKGr/qV6dzFRxbdukBZ0GFD1lgINhtdas++U5qqRnsXq0Ydh2Xj2MMEMRnfzgvTj99yRDUaC DXxweQfTydZpS63rla+/FUFzyaRAYO8KbEsJ9GnTGkv5mvXqEuDlTaloub7wg2XcFKpnVDBkV2t7M dcRiNOESEIiYAgPf3FbO4/W2hxRxhyMFv02+zJg1N5TIGtDQVBu2ltASCuk2zCMw5eknO9ViWjTNl VMf3/xI3xiubBQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pURrI-00038X-Ai; Tue, 21 Feb 2023 07:35:00 -0500 Date: Tue, 21 Feb 2023 14:35:08 +0200 Message-Id: <83lekrtcw3.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> (bug-gnu-emacs@gnu.org) References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Adding João. > Date: Mon, 20 Feb 2023 11:23:02 -0700 > From: Camden Narzt via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > I’m sorry if this is not the correct place to report a flymake-proc bug, but since flymake is included in the emacs git repo I figured it might be ok. > > I’m currently seeing incorrect behaviour from the `flymake-proc--delete-temp-directory` function. The path is parsed and then reassembled incorrectly as the following backtrace extract demonstrates: > > flymake-proc--safe-delete-directory("/private/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main/java/cam/narzt/getargv") > flymake-proc--delete-temp-directory("/private/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main/java/cam/narzt/getargv/“) > > As you can see the `000gn/T/` segment of the path gets duplicated when `flymake-proc--safe-delete-directory` gets called. > > This is because in `flymake-proc--delete-temp-directory` when the `suffix` variable is declared it is assumed that `(directory-file-name temporary-file-directory)` is a prefix of the `dir-name` argument, however `(directory-file-name temporary-file-directory)` doesn’t seem to resolve symlinks in the path whereas `dir-name` seems to have symlinks already resolved, so they don’t necessarily match. On my system the difference is: > > (directory-file-name temporary-file-directory) → "/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T” > dir-name → "/private/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main/java/cam/narzt/getargv/“ > > Note the "/private” prefix on the `dir-name` path. That difference in length causes the suffix to be incorrectly determined and then causes a bunch of errors while any subsequent function call tries to work with a path with the `000gn/T/` segment duplicated which obviously doesn’t exist in the fs. > > Changing the suffix variable to be computed as follows fixes the bug: > > (substring dir-name (1+ (length (file-truename (expand-file-name (directory-file-name temp-dir)))))) > > > If this can be fixed that’s great, if there’s somewhere else I should report this I’d love to know. > > Cheers, > > Camden Narzt > > > From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 12:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Camden Narzt , 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.16769833549740 (code B ref 61668); Tue, 21 Feb 2023 12:43:02 +0000 Received: (at 61668) by debbugs.gnu.org; 21 Feb 2023 12:42:34 +0000 Received: from localhost ([127.0.0.1]:54855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pURyc-0002X2-6x for submit@debbugs.gnu.org; Tue, 21 Feb 2023 07:42:34 -0500 Received: from mail-oa1-f51.google.com ([209.85.160.51]:43975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pURya-0002Wb-BP for 61668@debbugs.gnu.org; Tue, 21 Feb 2023 07:42:32 -0500 Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-172094e10e3so5005810fac.10 for <61668@debbugs.gnu.org>; Tue, 21 Feb 2023 04:42:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rAmyr2IpZxoA/SGjRnciZwcUPzXVsvVxgN9ivps2W9Q=; b=Qx/kJQzn3HlPHpTmztz5QyJN1LDk3/qwJBI4FfKrRge0V+Dnz4ICLITfRgbY/F975R R8pygbpvSYzDeGY/tdBMjvjh9YzJOjPhiE0scHIEK48dE9haJQdYPV2INFC5UHSQwBet zxcQgKqH55DJgYi52n5ODbluplmKyj8UOPAAQoNc7jyR7Rj4VlZ3W1ZNGQ9fmNNBmDpR SxkmLMqMxHBDsfezs5nmlm1A6HBJLJN43BMpdRnrfqAwp9zRlEmJacG5490OXn7XkJyZ Iv1CtGnZlKhgbkJDZrcvBCeh/OoRR30/Fz5b7p2q3ghE94RouRVOi5izqFixLKAfPm6g tVHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rAmyr2IpZxoA/SGjRnciZwcUPzXVsvVxgN9ivps2W9Q=; b=XizBWjZqKGYbHkpa2TTD9Rmfclx+pV3FuE0wH5pGt/lV3yZWqU8ExSDceT6qQAvkw2 +b48wssadnf6DJckKJe0EIzhH0NsE/+8w5D62/EEwKwu1bclq84Xa2um4hP3ec1Pgznb 2T8w4dZZJD8vaIIAnVpRTwi96KOrDuYdYgnmXL1KwbFkGOx5SiGSZoAwNdIfELgUB8sK 9c9ePbSpCkMKAd//hfmujNbXOO//HxwwKAcgAyiqpizJRB6NVHCIl0HrGdLYotDC0myT 2CmMY9usLtv8lm8RLBbVEPtOOgnU+sxjQnFu6cIQeKXaCTkamuU7JW9f4AdXX4MQM72W vWEA== X-Gm-Message-State: AO0yUKVPrRKLJfWqkYp74Ycl+fUYDzm/WDfUeCHaeFobgLChHd2313Bu tl5OOUkRLO4P+9CWo2eRn1h+Ya20F7/2o4oaf9g= X-Google-Smtp-Source: AK7set+zUa3d8bon4K/V20h8Ftb+vgGfKD/WhEccDdq0EbvPUZRyizvZGascCJ+ZKEJGkUkQqF+ZuF8EMFlgS4r5/+w= X-Received: by 2002:a05:6870:d148:b0:16d:dc93:691d with SMTP id f8-20020a056870d14800b0016ddc93691dmr698071oac.6.1676983346774; Tue, 21 Feb 2023 04:42:26 -0800 (PST) MIME-Version: 1.0 References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> <83lekrtcw3.fsf@gnu.org> In-Reply-To: <83lekrtcw3.fsf@gnu.org> From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Date: Tue, 21 Feb 2023 12:42:15 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Camden, Flymake-proc is a deprecated part of Flymake. I haven't used or tested it in a long time (there were never automated tests for it). When I redesigned Flymake years ago, in which flymake-proc became another backend, I tested some basic use cases, but I didn't change the underlying code, including the directory calculating parts and helpers. In other words, this is not "my code" and I never understood it. So if you think the change makes sense, go for it i.e. provide a patch that we can push. I think there are very few users of this backend anyway. Jo=C3=A3o On Tue, Feb 21, 2023 at 12:35 PM Eli Zaretskii wrote: > > Adding Jo=C3=A3o. > > > Date: Mon, 20 Feb 2023 11:23:02 -0700 > > From: Camden Narzt via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > I=E2=80=99m sorry if this is not the correct place to report a flymake-= proc bug, but since flymake is included in the emacs git repo I figured it = might be ok. > > > > I=E2=80=99m currently seeing incorrect behaviour from the `flymake-proc= --delete-temp-directory` function. The path is parsed and then reassembled = incorrectly as the following backtrace extract demonstrates: > > > > flymake-proc--safe-delete-directory("/private/var/folders/p7/03_g5t6114= 99lmjqhwc5tljr0000gn/T/000gn/T/Users/camdennarzt/Developer/Java/getargv.jav= a/src/main/java/cam/narzt/getargv") > > flymake-proc--delete-temp-directory("/private/var/folders/p7/03_g5t6114= 99lmjqhwc5tljr0000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/ma= in/java/cam/narzt/getargv/=E2=80=9C) > > > > As you can see the `000gn/T/` segment of the path gets duplicated when = `flymake-proc--safe-delete-directory` gets called. > > > > This is because in `flymake-proc--delete-temp-directory` when the `suff= ix` variable is declared it is assumed that `(directory-file-name temporary= -file-directory)` is a prefix of the `dir-name` argument, however `(directo= ry-file-name temporary-file-directory)` doesn=E2=80=99t seem to resolve sym= links in the path whereas `dir-name` seems to have symlinks already resolve= d, so they don=E2=80=99t necessarily match. On my system the difference is: > > > > (directory-file-name temporary-file-directory) =E2=86=92 "/var/folders/= p7/03_g5t611499lmjqhwc5tljr0000gn/T=E2=80=9D > > dir-name =E2=86=92 "/private/var/folders/p7/03_g5t611499lmjqhwc5tljr000= 0gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main/java/cam/narzt= /getargv/=E2=80=9C > > > > Note the "/private=E2=80=9D prefix on the `dir-name` path. That differe= nce in length causes the suffix to be incorrectly determined and then cause= s a bunch of errors while any subsequent function call tries to work with a= path with the `000gn/T/` segment duplicated which obviously doesn=E2=80=99= t exist in the fs. > > > > Changing the suffix variable to be computed as follows fixes the bug: > > > > (substring dir-name (1+ (length (file-truename (expand-file-name (direc= tory-file-name temp-dir)))))) > > > > > > If this can be fixed that=E2=80=99s great, if there=E2=80=99s somewhere= else I should report this I=E2=80=99d love to know. > > > > Cheers, > > > > Camden Narzt > > > > > > --=20 Jo=C3=A3o T=C3=A1vora From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Camden Narzt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Feb 2023 16:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Eli Zaretskii , 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.167699612325764 (code B ref 61668); Tue, 21 Feb 2023 16:16:02 +0000 Received: (at 61668) by debbugs.gnu.org; 21 Feb 2023 16:15:23 +0000 Received: from localhost ([127.0.0.1]:57121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUVIY-0006hU-Bv for submit@debbugs.gnu.org; Tue, 21 Feb 2023 11:15:22 -0500 Received: from pv50p00im-zteg10011401.me.com ([17.58.6.41]:51074) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pUVIW-0006hD-CU for 61668@debbugs.gnu.org; Tue, 21 Feb 2023 11:15:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1676996114; bh=1ehoUiUncQHCHSVjzQ+t6BHluy0Ed6+FTf9ZnLCwu+U=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; b=SPfvfwfR7g+hyOO/cK+wJ1TTTkZ/KrqEaMdvpwAtkYZXSTe9vZK3uZx2v03lKPS4K VGrvPdu4XZWwL6+uCUbXMrr2lUTsbiYiMu+/pMqKtRDoHud9z734A89SZGmE0yfbUM ehPck+3bZf9jK6Ix9LJICAmqmhx+6UZoPWYzJMJgZK3PyckPOhPptEB17j/RiBu9ak ksyjQ2QDSeyVULK0x/Czx7/gcD4kyozyKK3CPj8rhT23a8WsTiFoMYRhirLqI6g7Kj 0SYFHB4XARSjfMpNqtQ9xUNQE7jZEOGuc63QmTiohCMu8EuxD42b2N2N82kIIt9Zga 132JX1lcnfHtQ== Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-zteg10011401.me.com (Postfix) with ESMTPSA id 9CA37DC0D9E; Tue, 21 Feb 2023 16:15:13 +0000 (UTC) From: Camden Narzt Message-Id: <049BD343-8598-44EE-B510-64199BC594F9@me.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_FB91C576-9E66-49B5-93E5-28E1BB07867B" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Date: Tue, 21 Feb 2023 09:15:01 -0700 In-Reply-To: References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> <83lekrtcw3.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Proofpoint-GUID: jz5bQ2GaPZJkRLNXoetZXMlIB2aLb6hu X-Proofpoint-ORIG-GUID: jz5bQ2GaPZJkRLNXoetZXMlIB2aLb6hu X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.517,18.0.572,17.0.605.474.0000000 definitions=2022-06-21_01:2022-06-21_01,2020-02-14_11,2020-01-23_02 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 malwarescore=0 mlxscore=0 bulkscore=0 spamscore=0 clxscore=1011 adultscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2302210135 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_FB91C576-9E66-49B5-93E5-28E1BB07867B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Jo=C3=A3o, Yeah I don=E2=80=99t use flymake-proc directly, I think lsp-mode is = using it or something. Anyway I=E2=80=99ve attached a patch. --Apple-Mail=_FB91C576-9E66-49B5-93E5-28E1BB07867B Content-Disposition: attachment; filename=flymake-proc.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="flymake-proc.patch" Content-Transfer-Encoding: 7bit --- flymake-proc.el.old 2023-02-21 09:12:10 +++ flymake-proc.el.new 2023-02-21 09:11:43 @@ -904,7 +904,7 @@ (defun flymake-proc--delete-temp-directory (dir-name) "Attempt to delete temp dir DIR-NAME, do not fail on error." (let* ((temp-dir temporary-file-directory) - (suffix (substring dir-name (1+ (length (directory-file-name temp-dir)))))) + (suffix (substring dir-name (1+ (length (file-truename (expand-file-name (directory-file-name temp-dir)))))))) (while (> (length suffix) 0) (setq suffix (directory-file-name suffix)) --Apple-Mail=_FB91C576-9E66-49B5-93E5-28E1BB07867B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Cheers, Camden > On Feb 21, 2023, at 5:42 AM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > Hi Camden, >=20 > Flymake-proc is a deprecated part of Flymake. I haven't used or = tested > it in a long time (there were never automated tests for it). When I > redesigned Flymake years ago, in which flymake-proc became another > backend, I tested some basic use cases, but I didn't change the > underlying code, including the directory calculating parts and = helpers. >=20 > In other words, this is not "my code" and I never understood it. >=20 > So if you think the change makes sense, go for it i.e. provide a patch > that we can push. I think there are very few users of this backend > anyway. >=20 > Jo=C3=A3o >=20 > On Tue, Feb 21, 2023 at 12:35 PM Eli Zaretskii wrote: >>=20 >> Adding Jo=C3=A3o. >>=20 >>> Date: Mon, 20 Feb 2023 11:23:02 -0700 >>> From: Camden Narzt via "Bug reports for GNU Emacs, >>> the Swiss army knife of text editors" >>>=20 >>> I=E2=80=99m sorry if this is not the correct place to report a = flymake-proc bug, but since flymake is included in the emacs git repo I = figured it might be ok. >>>=20 >>> I=E2=80=99m currently seeing incorrect behaviour from the = `flymake-proc--delete-temp-directory` function. The path is parsed and = then reassembled incorrectly as the following backtrace extract = demonstrates: >>>=20 >>> = flymake-proc--safe-delete-directory("/private/var/folders/p7/03_g5t611499l= mjqhwc5tljr0000gn/T/000gn/T/Users/camdennarzt/Developer/Java/getargv.java/= src/main/java/cam/narzt/getargv") >>> = flymake-proc--delete-temp-directory("/private/var/folders/p7/03_g5t611499l= mjqhwc5tljr0000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main= /java/cam/narzt/getargv/=E2=80=9C) >>>=20 >>> As you can see the `000gn/T/` segment of the path gets duplicated = when `flymake-proc--safe-delete-directory` gets called. >>>=20 >>> This is because in `flymake-proc--delete-temp-directory` when the = `suffix` variable is declared it is assumed that `(directory-file-name = temporary-file-directory)` is a prefix of the `dir-name` argument, = however `(directory-file-name temporary-file-directory)` doesn=E2=80=99t = seem to resolve symlinks in the path whereas `dir-name` seems to have = symlinks already resolved, so they don=E2=80=99t necessarily match. On = my system the difference is: >>>=20 >>> (directory-file-name temporary-file-directory) =E2=86=92 = "/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T=E2=80=9D >>> dir-name =E2=86=92 = "/private/var/folders/p7/03_g5t611499lmjqhwc5tljr0000gn/T/Users/camdennarz= t/Developer/Java/getargv.java/src/main/java/cam/narzt/getargv/=E2=80=9C >>>=20 >>> Note the "/private=E2=80=9D prefix on the `dir-name` path. That = difference in length causes the suffix to be incorrectly determined and = then causes a bunch of errors while any subsequent function call tries = to work with a path with the `000gn/T/` segment duplicated which = obviously doesn=E2=80=99t exist in the fs. >>>=20 >>> Changing the suffix variable to be computed as follows fixes the = bug: >>>=20 >>> (substring dir-name (1+ (length (file-truename (expand-file-name = (directory-file-name temp-dir)))))) >>>=20 >>>=20 >>> If this can be fixed that=E2=80=99s great, if there=E2=80=99s = somewhere else I should report this I=E2=80=99d love to know. >>>=20 >>> Cheers, >>>=20 >>> Camden Narzt >>>=20 >>>=20 >>>=20 >=20 >=20 >=20 > --=20 > Jo=C3=A3o T=C3=A1vora --Apple-Mail=_FB91C576-9E66-49B5-93E5-28E1BB07867B-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 04 04:57:52 2023 Received: (at control) by debbugs.gnu.org; 4 Sep 2023 08:57:52 +0000 Received: from localhost ([127.0.0.1]:48563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd5P5-0003Eo-SO for submit@debbugs.gnu.org; Mon, 04 Sep 2023 04:57:52 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:59798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qd5P4-0003EX-GA for control@debbugs.gnu.org; Mon, 04 Sep 2023 04:57:50 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-500b66f8b27so1918608e87.3 for ; Mon, 04 Sep 2023 01:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693817865; x=1694422665; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=t0iL31zwcKyLUxQRnaqYQWM6NCcJHXfZ5ZF/TDQxaU8=; b=dtGW2mkeZyWCjk+s4sOeJC/4FyB3b2ZyGwi6fYsIOYIhPXo39htG06I3B4PYwoYdDH JpfhZPp0yL/Tg6i5jEnYlWFGcS2CsJpLQv1ma9SRYRsvYMc86VLSjBmVPViHpty+rmKT W+hbPjzB4pFO1NXv6PiY/0ZX5eXtokQ60Iv5NG6LGVcH+Dqxhvb57lRD82p0uMpkr5xQ plwoOAn4SyAAdnskCV1OkzAtInVN4+6Sd10bUbUjscQyAreJ+t13THZEgWXH92VdE328 LJGl6aeQ6eMnHWyS+pz4qBYYtnEL5qScMUYiDq4nsARXWfx3uSfA1L6LCvMi3D4dzFst dJBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693817865; x=1694422665; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=t0iL31zwcKyLUxQRnaqYQWM6NCcJHXfZ5ZF/TDQxaU8=; b=djGeH/s83JG04N7ulwKnkDIJCylJZ5ZN4ClXph3vSTYqWimw9O5wyQrj2CNKAq1Dp/ ls2pxSOxRx+rLOM4TGxXwBUfe12Tal85tlpDX2BrboSeTm61ApSb5b8/lPcrT84KYx0N ZMBCCzjEERq6cD5gTaXCRl+rSoVHBJGpyRSC9qdco/hHJQwx+lfMMhlpWOOyonyvlCb1 eQd/w9ucjzXmst0FPNPW4swkknkicpD5ZsCkPQmU4h29/1DFa4XTf6dIJwfZc4A+wTP2 OCFc7iKorT4/TbWC1Q7+bRRCDDh11M8jbqG3e8D1eYyqlR97vNvaYHgoFMqYwiW2+Gvc ZNmQ== X-Gm-Message-State: AOJu0YxzyOGtIp+o+PLMAtXyJcKjkSO+kBYyqzJMZbSL8m2qEprO29FT y58ncqS7eoTd0UnmQ5dL9cxjff1RhCU0Ig+J6rpW8AepYyI= X-Google-Smtp-Source: AGHT+IEtE5RMzdZIvIcIziqlGkxsKHwHcgIH6LLkcFCOc52nd9m6URNsHdwEgnxF4jD0frt1qTnENoZRW4G6KrrmLng= X-Received: by 2002:a05:6512:3049:b0:500:9b7d:ee3c with SMTP id b9-20020a056512304900b005009b7dee3cmr7687152lfb.7.1693817864783; Mon, 04 Sep 2023 01:57:44 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 4 Sep 2023 01:57:44 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Mon, 4 Sep 2023 01:57:44 -0700 Message-ID: Subject: control message for bug #61668 To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 61668 + patch quit From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Oct 2023 16:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Camden Narzt , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Cc: Eli Zaretskii , 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.16967829782995 (code B ref 61668); Sun, 08 Oct 2023 16:37:01 +0000 Received: (at 61668) by debbugs.gnu.org; 8 Oct 2023 16:36:18 +0000 Received: from localhost ([127.0.0.1]:58388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpWlO-0000mD-8D for submit@debbugs.gnu.org; Sun, 08 Oct 2023 12:36:18 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:57738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpWlM-0000lu-FQ for 61668@debbugs.gnu.org; Sun, 08 Oct 2023 12:36:16 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-505748580ceso4733413e87.3 for <61668@debbugs.gnu.org>; Sun, 08 Oct 2023 09:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696782950; x=1697387750; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=m2jz8dc86RLpWJblkLTcrEuws3D7BXWrGT29Vfz/pEw=; b=hsW54GPvOqm0wtY8T/HxIsvb+sEHHHhEN+1xZnMJPJR9Kvg18rWLtjCBsQPm5U4NTP ac7mOC8OYqnm42iOzcqvs3wyXg0SjdmoWFBBAfgaMrI11d++1/KGNew/SI/NaWgzfu5M YT502rRgygeMnkktYLCVGG6G45ChIFGESsXtTT/hmzmefTfnJDk8CFhqVciluzyI4tDu E9LP5UZuAoQM+OURqxdyyY4WYKi+chZGyN+MOIVMXYjK6ClfUd4oYxu1SxPTEY3LhPJZ KI6bayfnU25aQNucSw5qU4lyziQJAtFQ/jN67RkYIDRzSbY9qruanfXSHb5AnTIc9XLV yyug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696782950; x=1697387750; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=m2jz8dc86RLpWJblkLTcrEuws3D7BXWrGT29Vfz/pEw=; b=l89/9uyQqTTmKqYRelAxBniAVoAEV0Wb/OjOiXAS8YPeK5xZL4GXChD+TJTrMHr00j 6xjSb0DVXLF83SUFAzglDCgXB+1YA72I4yitpEf/wxtHri+pNHlypvugANcuFslriVsU 589/pgot0BG29azFLsFKWxFHSp0D4UI8GL2P9d6sVjD6X8bFpKwIdTGraUPWFloe9zi4 8uc7xoxdasriSFc//N0WW6AkgFs9Wik1SezOftO0Gz8FyFGvjELq5uaDGCNQitzQQpEk VClqpgPfwxanASbBAfmHu2S01mB8HkR6g5ROPqYjMGPC4mL9puD3+8NmAdh5aVFVSA3K 0MKQ== X-Gm-Message-State: AOJu0YwKxFJdqVMHP4yZHRKkvO2jWVYwGERcCCNB975/HUpp82r50zQe gZW10G9eZJMTUFANLvAsfRIKR9ThdlyAhpJ7r9I= X-Google-Smtp-Source: AGHT+IGUQfQqNWZwJgkASjun2yzwUZhQEJaMyv9NBv8hRp4BtG7rbBaAtgpYdGqyVHmUmkkjGpFWTOVcP9U1IBbIbRI= X-Received: by 2002:a19:ca08:0:b0:4ff:9efd:8a9e with SMTP id a8-20020a19ca08000000b004ff9efd8a9emr10334975lfg.7.1696782950127; Sun, 08 Oct 2023 09:35:50 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 8 Oct 2023 16:35:49 +0000 From: Stefan Kangas In-Reply-To: <049BD343-8598-44EE-B510-64199BC594F9@me.com> References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> <83lekrtcw3.fsf@gnu.org> <049BD343-8598-44EE-B510-64199BC594F9@me.com> MIME-Version: 1.0 Date: Sun, 8 Oct 2023 16:35:49 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 61668 + patch thanks Camden Narzt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Yeah I don=E2=80=99t use flymake-proc directly, I think lsp-mode is using= it > or something. Anyway I=E2=80=99ve attached a patch. I would like to install this patch. Could you please send the patch as an attachment instead? We prefer that patches are created with a command like `git format-patch -1'. Please also include the bug number of this bug in the commit message, if possible, like so: Bug#61668. That would make it easier for us to review and install this patch. Thanks in advance. From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Camden Narzt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Oct 2023 19:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Stefan Kangas Cc: Eli Zaretskii , =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= , 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.16967949036496 (code B ref 61668); Sun, 08 Oct 2023 19:56:01 +0000 Received: (at 61668) by debbugs.gnu.org; 8 Oct 2023 19:55:03 +0000 Received: from localhost ([127.0.0.1]:58575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpZrj-0001gi-3t for submit@debbugs.gnu.org; Sun, 08 Oct 2023 15:55:03 -0400 Received: from pv50p00im-ztdg10011301.me.com ([17.58.6.40]:58870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpZrg-0001g9-Au for 61668@debbugs.gnu.org; Sun, 08 Oct 2023 15:55:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1696794874; bh=bwj9ArooU20m/CBdMtxAAHEQa0aPSPdc1bJ0PwHHKz8=; h=From:Message-Id:Content-Type:Mime-Version:Subject:Date:To; b=xV0QDwXBIGHdZsRPb5dYAcfxZxD4uewpDO+8ANzU/ECYpXSUM1B6rPtOhqHMBijww pDLI7ZkIORpC8K7ZbhzOocEhDWdWzXMj74Bhyv/GaiSoy/BJHY932Qp7iMEXftNAWw W4YJl7Pcry0Hmo08GYiVmmA0df4DJnFZVm85K1ma64DUaazIrJCmRcriuSy4RmkJ17 Lld08TSTVsYMpl+6HY7kXmgrNUQ0dzdEa2ve2ucZkXFoSu5cozsO6IIO9XhR48QQnr oeTiaC64UfUANNiwzADTZUYdkuqbaJsd3zBrHvLFCLbqtKdqc0uYyqpVsYk3tb46G9 RBd+vUgnKszgw== Received: from smtpclient.apple (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10011301.me.com (Postfix) with ESMTPSA id 35696180169; Sun, 8 Oct 2023 19:54:33 +0000 (UTC) From: Camden Narzt Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_C5B09D4C-2069-4B39-A905-946C26A97000" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.100.2.1.4\)) Date: Sun, 8 Oct 2023 13:54:21 -0600 In-Reply-To: References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> <83lekrtcw3.fsf@gnu.org> <049BD343-8598-44EE-B510-64199BC594F9@me.com> X-Mailer: Apple Mail (2.3774.100.2.1.4) X-Proofpoint-ORIG-GUID: W4aEZEK56iQ2fO-93zzGkAGRRuBelUCp X-Proofpoint-GUID: W4aEZEK56iQ2fO-93zzGkAGRRuBelUCp X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.517,18.0.883,17.11.64.514.0000000 definitions=2022-06-21_08:2022-06-21_01,2022-06-21_08,2022-02-23_01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 phishscore=0 suspectscore=0 clxscore=1011 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2310080181 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_C5B09D4C-2069-4B39-A905-946C26A97000 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I=E2=80=99ll try my best. I=E2=80=99ve attached a patch I made by: cloning https://git.savannah.gnu.org/git/emacs.git=20 making the change committing the change with a message mentioning the bug number Running `git format-patch -1` to create the patch Hopefully it is useful to you. Cheers, Camden =EF=BF=BC > On Oct 8, 2023, at 10:35=E2=80=AFAM, Stefan Kangas = wrote: >=20 > tags 61668 + patch > thanks >=20 > Camden Narzt via "Bug reports for GNU Emacs, the Swiss army knife of > text editors" writes: >=20 >> Yeah I don=E2=80=99t use flymake-proc directly, I think lsp-mode is = using it >> or something. Anyway I=E2=80=99ve attached a patch. >=20 > I would like to install this patch. >=20 > Could you please send the patch as an attachment instead? We prefer > that patches are created with a command like `git format-patch -1'. > Please also include the bug number of this bug in the commit message, = if > possible, like so: Bug#61668. >=20 > That would make it easier for us to review and install this patch. >=20 > Thanks in advance. --Apple-Mail=_C5B09D4C-2069-4B39-A905-946C26A97000 Content-Type: multipart/mixed; boundary="Apple-Mail=_1176BFC3-416E-466F-88E3-1C2090437D61" --Apple-Mail=_1176BFC3-416E-466F-88E3-1C2090437D61 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 I=E2=80=99ll = try my best.

I=E2=80=99ve attached a patch I made = by:

Hopefully it is useful to = you.

Cheers,

Camden

= --Apple-Mail=_1176BFC3-416E-466F-88E3-1C2090437D61 Content-Disposition: attachment; filename=0001-Fix-for-Bug-61668-resolve-symlinks-in-temp-dir-path.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Fix-for-Bug-61668-resolve-symlinks-in-temp-dir-path.patch" Content-Transfer-Encoding: quoted-printable =46rom=205e787db2d3fd11bd23be8882804c99d45d464c9d=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Camden=20Narzt=20=0ADate:=20= Sun,=208=20Oct=202023=2013:47:56=20-0600=0ASubject:=20[PATCH]=20Fix=20= for=20Bug#61668:=20resolve=20symlinks=20in=20temp=20dir=20path=0A=0A---=0A= =20lisp/progmodes/flymake-proc.el=20|=202=20+-=0A=201=20file=20changed,=20= 1=20insertion(+),=201=20deletion(-)=0A=0Adiff=20--git=20= a/lisp/progmodes/flymake-proc.el=20b/lisp/progmodes/flymake-proc.el=0A= index=202e9c28a92d5..2e4995ed7fc=20100644=0A---=20= a/lisp/progmodes/flymake-proc.el=0A+++=20= b/lisp/progmodes/flymake-proc.el=0A@@=20-904,7=20+904,7=20@@=20can=20= also=20be=20executed=20interactively=20independently=20of=0A=20(defun=20= flymake-proc--delete-temp-directory=20(dir-name)=0A=20=20=20"Attempt=20= to=20delete=20temp=20dir=20DIR-NAME,=20do=20not=20fail=20on=20error."=0A=20= =20=20(let*=20((temp-dir=20=20=20=20(file-truename=20= temporary-file-directory))=0A-=09=20(suffix=20=20=20=20=20=20(substring=20= dir-name=20(1+=20(length=20(directory-file-name=20temp-dir))))))=0A+=09=20= (suffix=20=20=20=20=20=20(substring=20dir-name=20(1+=20(length=20= (file-truename=20(expand-file-name=20(directory-file-name=20= temp-dir))))))))=0A=20=0A=20=20=20=20=20(while=20(>=20(length=20suffix)=20= 0)=0A=20=20=20=20=20=20=20(setq=20suffix=20(directory-file-name=20= suffix))=0A--=20=0A2.39.3=20(Apple=20Git-145)=0A=0A= --Apple-Mail=_1176BFC3-416E-466F-88E3-1C2090437D61 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Oct 8, 2023, at 10:35=E2=80=AFAM, Stefan Kangas = <stefankangas@gmail.com> wrote:

tags 61668 + = patch
thanks

Camden Narzt via "Bug reports for GNU Emacs, the = Swiss army knife of
text editors" <bug-gnu-emacs@gnu.org> = writes:

Yeah I don=E2=80=99t use = flymake-proc directly, I think lsp-mode is using it
or something. = Anyway I=E2=80=99ve attached a patch.

I would like = to install this patch.

Could you please send the patch as an = attachment instead?  We prefer
that patches are created with a = command like `git format-patch -1'.
Please also include the bug = number of this bug in the commit message, if
possible, like so: = Bug#61668.

That would make it easier for us to review and install = this patch.

Thanks in = advance.

= --Apple-Mail=_1176BFC3-416E-466F-88E3-1C2090437D61-- --Apple-Mail=_C5B09D4C-2069-4B39-A905-946C26A97000-- From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Oct 2023 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Camden Narzt , 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.169683758912919 (code B ref 61668); Mon, 09 Oct 2023 07:47:02 +0000 Received: (at 61668) by debbugs.gnu.org; 9 Oct 2023 07:46:29 +0000 Received: from localhost ([127.0.0.1]:59160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpkyC-0003MI-Kq for submit@debbugs.gnu.org; Mon, 09 Oct 2023 03:46:29 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:48533) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpkyA-0003Lq-QA for 61668@debbugs.gnu.org; Mon, 09 Oct 2023 03:46:27 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5044dd5b561so5001544e87.1 for <61668@debbugs.gnu.org>; Mon, 09 Oct 2023 00:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696837560; x=1697442360; darn=debbugs.gnu.org; h=content-transfer-encoding:to:subject:message-id:date:mime-version :references:in-reply-to:from:from:to:cc:subject:date:message-id :reply-to; bh=o67uaZchFMFx9NNIGgmhkACHK30kXQwOh8MmHFIdCQM=; b=Qrx2knIPMae+T7L4rb8Rx2aItfYqeYNzbS8mNTh5DbC4HtULbgRKrH+JMZbeyP/xxM +3LldGZf25gc0/jgQAIdYY4GoCb5X7PPIAjQNmhXWzia91AwoavrKQDyR/rT1pZCyQsv 7Lbeod2fsEU67JZFg9eSWCKtOpYs8v9zOox0kzqu4v4c/Ou4caD9ybQNglPXanUqZdt+ siv+5kCNsNWonFou2d0vJHPfsSnUwvhx7BUuu+m0T5ISb408BltSdKY83OLZzAOUCVe9 /sLzsdilP/B0bG0t6Rq6HPxXCMBCRilfTGliS1B1D9c6hW+nBiUwXvKSvGgmLQurriJf pZYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696837560; x=1697442360; h=content-transfer-encoding:to:subject:message-id:date:mime-version :references:in-reply-to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=o67uaZchFMFx9NNIGgmhkACHK30kXQwOh8MmHFIdCQM=; b=mk54LmnEey3sXVb0JXdB1mjyXwjk295sjyU1v2YxYil42xXEVzTFJCaQGu64oAApXv 8xVWNh/bPZU8sEwHmxVWczl4nFuY2mN1gACyIbZN8D8/IwCKl4fbJjpItEUnWNQD+lDj jaeJOmSjk2FEWTT0aAfusgWVABFuJRNCCtXaBq5B9Omq4fXIID5a+PykC4mhkksVAA5Z mwwQuwnBxtj8GHLjqMS2svi32Wz9pnfIthI+WRbG5mV2DZeCM7GHZHoFCkJ3ZzZPPmZv OWmRBYO87aqh+LwPld3uT+0aNBSzW4o7HyWPV8ROCBQheCTT1hTRoK2gIS72gLMnzWQX q9VQ== X-Gm-Message-State: AOJu0YwyIZyn0DpjDmBUvUAlUo3Q0J/YFVa/nnR+8od0JKOw1r+13pwZ 7NBaEDKEJ1Qj9caQg1KLlUREf+93FrIOVmy2udM= X-Google-Smtp-Source: AGHT+IEECnbUEzcTdJR7DoljSdyjOo4J3UWo2FZjPgyb3ieCYnNsArGx7N3/oJ8m26+aI69+eTtbOm2oVBtlR2w6mT4= X-Received: by 2002:a05:6512:32a8:b0:505:98a8:fa36 with SMTP id q8-20020a05651232a800b0050598a8fa36mr11778100lfe.22.1696837559904; Mon, 09 Oct 2023 00:45:59 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 9 Oct 2023 07:45:59 +0000 From: Stefan Kangas In-Reply-To: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> MIME-Version: 1.0 Date: Mon, 9 Oct 2023 07:45:59 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Camden Narzt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > I=E2=80=99m currently seeing incorrect behaviour from the `flymake-proc--= delete-temp-directory` function. The path is parsed and then reassembled in= correctly as the following backtrace extract demonstrates: > > flymake-proc--safe-delete-directory("/private/var/folders/p7/03_g5t611499= lmjqhwc5tljr0000gn/T/000gn/T/Users/camdennarzt/Developer/Java/getargv.java/= src/main/java/cam/narzt/getargv") > flymake-proc--delete-temp-directory("/private/var/folders/p7/03_g5t611499= lmjqhwc5tljr0000gn/T/Users/camdennarzt/Developer/Java/getargv.java/src/main= /java/cam/narzt/getargv/=E2=80=9C) > > As you can see the `000gn/T/` segment of the path gets duplicated when `f= lymake-proc--safe-delete-directory` gets called. > > This is because in `flymake-proc--delete-temp-directory` when the `suffix= ` variable is declared it is assumed that `(directory-file-name temporary-f= ile-directory)` is a prefix of the `dir-name` argument, however `(directory= -file-name temporary-file-directory)` doesn=E2=80=99t seem to resolve symli= nks in the path whereas `dir-name` seems to have symlinks already resolved,= so they don=E2=80=99t necessarily match. On my system the difference is: > > (directory-file-name temporary-file-directory) =E2=86=92 "/var/folders/p7= /03_g5t611499lmjqhwc5tljr0000gn/T=E2=80=9D > dir-name =E2=86=92 "/private/var/folders/p7/03_g5t611499lmjqhwc5tljr0000g= n/T/Users/camdennarzt/Developer/Java/getargv.java/src/main/java/cam/narzt/g= etargv/=E2=80=9C > > Note the "/private=E2=80=9D prefix on the `dir-name` path. That differenc= e in length causes the suffix to be incorrectly determined and then causes = a bunch of errors while any subsequent function call tries to work with a p= ath with the `000gn/T/` segment duplicated which obviously doesn=E2=80=99t = exist in the fs. > > Changing the suffix variable to be computed as follows fixes the bug: > > (substring dir-name (1+ (length (file-truename (expand-file-name (directo= ry-file-name temp-dir)))))) Taking a closer look, I'm not yet sure about the proposed fix. First, it seems like you're using macOS, which you did not mention in your bug report. Which version of macOS are you using? Reducing the code down to something more minimal, I see this on my macOS 12.7 machine. The original code produces something like this: (let* ((temp-dir (file-truename temporary-file-directory)) (dir (directory-file-name temp-dir))) (cons dir (length dir))) =3D> ("/private/var/folders/pj/rhx0gxy15tv3vx6l3mdy0qvm0000gn/T" . 56) This is your fix---i.e. (file-truename (expand-file-name ...))---and I get the exact same result here: (let* ((temp-dir (file-truename temporary-file-directory)) (dir (file-truename (expand-file-name (directory-file-name temp-dir))))) (cons dir (length dir))) =3D> ("/private/var/folders/pj/rhx0gxy15tv3vx6l3mdy0qvm0000gn/T" . 56) I'm also seeing the same result if I skip the call to `expand-file-name': (let* ((temp-dir (file-truename temporary-file-directory)) (dir (file-truename (directory-file-name temp-dir)))) (cons dir (length dir))) =3D> ("/private/var/folders/pj/rhx0gxy15tv3vx6l3mdy0qvm0000gn/T" . 56) What do the above forms evaluate to on your machine? Thanks. From unknown Mon Aug 18 04:42:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#61668: Bug in flymake-proc with fix Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Oct 2023 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61668 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Camden Narzt Cc: 61668@debbugs.gnu.org Received: via spool by 61668-submit@debbugs.gnu.org id=B61668.169686215419431 (code B ref 61668); Mon, 09 Oct 2023 14:36:01 +0000 Received: (at 61668) by debbugs.gnu.org; 9 Oct 2023 14:35:54 +0000 Received: from localhost ([127.0.0.1]:60662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qprMQ-00053G-7G for submit@debbugs.gnu.org; Mon, 09 Oct 2023 10:35:54 -0400 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:48303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qprMN-00052y-GI for 61668@debbugs.gnu.org; Mon, 09 Oct 2023 10:35:52 -0400 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5043a01ee20so5506249e87.0 for <61668@debbugs.gnu.org>; Mon, 09 Oct 2023 07:35:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696862124; x=1697466924; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=D65RqFAZ1H3MyPvNKy+a4fS6rsnpLVRZR2RbpaQvhE8=; b=INMJGRKk0ADIYNVCIykmd9btikaqaZ0rA0VTpUGyxHE2eHwLl9JwOgbaGhTG+vcjRd 2ua/gCteI2uw5Jt6lQhAmZ+2z428XJggEDT1ONcefRP+lRxml91rk9VK3WPc2PnUWm0o PzJt3ohFkOQksNzFNGw3JPLjQSry3oFZ5EixRNqV+R0lUeELJknFgdYvZ508DsNPGeUW o9gNzM+YOy5b27S44kWOW5J0DxTZwWjS0h/oPJlFV4yXuyS0QDgul0zhJ+DugfcmFt5P h2LM7i3niOPJYISr16vFmTAL4R5ouh+xRI9Wyj/WNCUiuK8vTPKtvtxgQIYScqBmuy8h Xy6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696862124; x=1697466924; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=D65RqFAZ1H3MyPvNKy+a4fS6rsnpLVRZR2RbpaQvhE8=; b=KWcpEqr8b8TviRw47QXDfvFtZxLSUkg7C5Rr2NPuoHoVxfcg+lRe8DDVGZH29ROje1 gWah1FpDUPHoeBdfq4r/x8hNRXN7zZ5aunx5WVozsZtMt/Ge0Ywqli0JCEmN3tKkJL81 f3W49fFaiv781To/w7v4k6TST9q0ViNlpVx+d/UkyfdO4vb/96HM8dEuJpOMNouq+Nc/ 5tJxkKtKC6xdyJ3HqltQeYAcMBoUAovZAmHkZpT08fv2VcFVgtHEVvL7PQ2w5gnXbx0N BQMGZudbmInjDn/iH2jyTbNIUGzQj3fykmQ9Bn8UDCna1eJqD37PTivM1YhJ9sp6/TFy 3Ypw== X-Gm-Message-State: AOJu0YwURR647ZajfRqNA8yVybtfRD4gyz5sPL+q4gT6bbIWeTGrMed2 Krz/27C8f0n6E4N41X+uNLRPh/xXXqBiBnWao1k= X-Google-Smtp-Source: AGHT+IGoroqVQni2gX1aK24QPLpyFFkrvtiVy0l/Nso0vmZNjT+oZcFY7ANjxUs8004F76pqihnLgSj6k2Iejggpvxs= X-Received: by 2002:a19:910c:0:b0:501:c1d4:cf68 with SMTP id t12-20020a19910c000000b00501c1d4cf68mr11238909lfd.15.1696862124333; Mon, 09 Oct 2023 07:35:24 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 9 Oct 2023 14:35:23 +0000 From: Stefan Kangas In-Reply-To: <31C926E5-AA1F-403A-A4DB-9F0B448323DC@me.com> References: <096AC334-D7CF-41A2-BFFA-FE3BE3A13C05@me.com> <31C926E5-AA1F-403A-A4DB-9F0B448323DC@me.com> MIME-Version: 1.0 Date: Mon, 9 Oct 2023 14:35:23 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) unarchive 46203 forcemerge 46203 61668 thanks [ Please in the future use "Reply to all" so that the discussion is recorded in the bug tracker. ] Camden Narzt writes: > I looked at why you weren=E2=80=99t seeing the bug I reported, and honest= ly I > don=E2=80=99t know, it looks like Lars Ingebrigtsen fixed this already in > 9225599c. I don=E2=80=99t know why I was seeing the behaviour I was seein= g. > > Cheers, > > Camden Ah, that makes sense. Thanks. I'm merging this bug with #46203 then, which should also close this bug.