From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt M Newsgroups: gmane.emacs.bugs Subject: bug#46972: =?UTF-8?Q?RE=C2=A0:_?= =?UTF-8?Q?RE=C2=A0:_?= =?UTF-8?Q?RE=C2=A0:_?= =?UTF-8?Q?RE=C2=A0:?= bug#46972: 28.0.50; [feature/native-comp] Emacs locks itself during native compilation because of permission denied Date: Fri, 12 Mar 2021 11:37:22 +0000 Message-ID: References: <83lfb0uo5s.fsf@gnu.org> <83ft18umwg.fsf@gnu.org> <83eegsuk1q.fsf@gnu.org> , <835z24ujfw.fsf@gnu.org> , <83r1kklt7i.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_DB6P190MB0327531E10DFF3BEE5DDF546D66F9DB6P190MB0327EURP_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31498"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "46972@debbugs.gnu.org" <46972@debbugs.gnu.org>, "akrl@sdf.org" To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 12 12:38:23 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 1lKg7Z-00083l-P0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Mar 2021 12:38:21 +0100 Original-Received: from localhost ([::1]:50742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lKg7Y-0004ll-Q4 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Mar 2021 06:38:20 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lKg7H-0004lX-4j for bug-gnu-emacs@gnu.org; Fri, 12 Mar 2021 06:38:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lKg7G-0004f1-EE for bug-gnu-emacs@gnu.org; Fri, 12 Mar 2021 06:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lKg7G-0002l0-B1 for bug-gnu-emacs@gnu.org; Fri, 12 Mar 2021 06:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matt M Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Mar 2021 11:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46972 X-GNU-PR-Package: emacs Original-Received: via spool by 46972-submit@debbugs.gnu.org id=B46972.161554905410565 (code B ref 46972); Fri, 12 Mar 2021 11:38:02 +0000 Original-Received: (at 46972) by debbugs.gnu.org; 12 Mar 2021 11:37:34 +0000 Original-Received: from localhost ([127.0.0.1]:56168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKg6n-0002kL-R7 for submit@debbugs.gnu.org; Fri, 12 Mar 2021 06:37:34 -0500 Original-Received: from mail-oln040092070025.outbound.protection.outlook.com ([40.92.70.25]:42371 helo=EUR03-AM5-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lKg6j-0002k4-Es for 46972@debbugs.gnu.org; Fri, 12 Mar 2021 06:37:32 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CrSInHFRaIMerf3Xv8Gskk1HAuF4HW0QasP7foz4bWDxdVSX6lpnzGFW4VHKfzq/H+f4LksisPSiM9+OdozqbvRL/79l68pa6Sj/Li52H4XQjuU1Ls2MMfvzZiK9hHlxK4pUhqQEsBCmLrdDsqF39ON97fKGzHu8xdyBrvtv2mvqmaFEptBPbJ0XKYeDXvhwaST2op2THFqSFj+LDuWMDgcg+dPEIItH/ubLfXxQQSPgUpefXl0U2iMnB6DY+njXx9L6o3ITP+5NJ/dml8GMZ9LdGqxsPCjgalIyLo81i1Tp5LhllVLh7ajJ/iG/VOO31HGFwxSOeCYv++6OS18VFw== 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=nKHVfDhFhsxeIpaCbn+Uf+LjuAQSphWJfzJ5Xwe3VHI=; b=fZjgQwxr9hk2i+7udbFJiOypYpsCWrO+Z7Qqvj214P4PtrXmXnVOSc+w8Wt1l4xbRCuLLA1LJYalPj2SSudvaVIhSpW7bFD2o5fqGOdHrOKc0mEZ6iopgPs3DJySPaYxXf3PUs4NfqILOidsJ2Yl89OdZps9A+1KbqNxk3O980ya0kZVm8gk+P4G4tCYDwDBcHCMiO313OZt88B+Irz8TTdGOrZ8cuOhaE68r2iXk8oomvFus+8JnH0IZJfbTaVTltp7yXMDu04PN4jlQFNw0ixieL+QqKukkvrPpzMHCmaer/odCTuBo1s+84ov63CHBkULfs30q36yIZdznzz5Aw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Original-Received: from DB5EUR03FT014.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e0a::4d) by DB5EUR03HT161.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e0a::224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31; Fri, 12 Mar 2021 11:37:23 +0000 Original-Received: from DB6P190MB0327.EURP190.PROD.OUTLOOK.COM (2a01:111:e400:7e0a::44) by DB5EUR03FT014.mail.protection.outlook.com (2a01:111:e400:7e0a::102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3933.31 via Frontend Transport; Fri, 12 Mar 2021 11:37:23 +0000 Original-Received: from DB6P190MB0327.EURP190.PROD.OUTLOOK.COM ([fe80::b8d9:941:5569:a83a]) by DB6P190MB0327.EURP190.PROD.OUTLOOK.COM ([fe80::b8d9:941:5569:a83a%6]) with mapi id 15.20.3912.029; Fri, 12 Mar 2021 11:37:23 +0000 Thread-Topic: =?UTF-8?Q?RE=C2=A0:_?= =?UTF-8?Q?RE=C2=A0:_?= =?UTF-8?Q?RE=C2=A0:_?= =?UTF-8?Q?RE=C2=A0:?= bug#46972: 28.0.50; [feature/native-comp] Emacs locks itself during native compilation because of permission denied Thread-Index: AQHXErdedzl85mvZ1kKkUqsMFCKrd6p3SXGOgAAHdf6AAAAiG4AAERXcgAADD1mAAACaTIAIApYfgACW7/2AAEGcBg== In-Reply-To: <83r1kklt7i.fsf@gnu.org> Accept-Language: fr-FR, en-US Content-Language: fr-FR x-incomingtopheadermarker: OriginalChecksum:9D0C7A5132C1822717CD7A6D33EC0BBEC9F6199CC72D219AC9B19C280252FE10; UpperCasedChecksum:887E698802DA885D7DDE4FC2C253698FD7BD9B99A464C60E44D5453203A18958; SizeAsReceived:7822; Count:45 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [u1tjItXHPUA+jK6MH6Z9oC7qziF7R7HYeqDhJ/MthmqnnkUnchf5NenwVfypufJT] x-ms-publictraffictype: Email x-incomingheadercount: 45 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 3a24e7fe-853a-4841-b5ad-08d8e54b33f6 x-ms-traffictypediagnostic: DB5EUR03HT161: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: s/u3z7srnP6RkJO8Qay0Z/yq6WHA9Xi44I+HWXHghsDs/vj1S2prK51NTNr3z/hsYJayH7G04W9WiGaKiXiaRZvhoaSsIeEkkmm+g8Rpo1ucVVZ6IxP2FExosux9HUchfSBWqAmEtRDBszE8e0fo1eqcE0Uevj6nml1zmcowItbSQMJrEcNX5T6aj69fx8zQQSq6MOproUa2xt7R2z5zZK5WuH59sd1MBsULmrr9JCPeg01ubxAef2se7qafe+CtOez/i4czDfbl4Bro8jrOuYT13R5UTId4x7OltegVZhS/usR/PJXkG3N1JPBw1J8uDveBOLmqcF6/3hhUUOzmDfKUNM4Taacze+e3YWKkYunUjUGTHLenjYc2G2oFggBlTYKf5G0AaR5kqZBzg2e3QA== x-ms-exchange-antispam-messagedata: an/Obs9V8O4S/J5CzCsX/tw3R/caSLjX3tts4GOnpwrTviZawEv+A4vxp0EI9twkoRv7GoTBucxJwkmgF2kL0SYKmj972j6ezhHx1rxW8E1Dl6cmbjToE15WOsIeT9C9vHWYMDypWv86S8AF6EYhedUMUtRJh+oSn6AroQn392Zf0Ry4jH/LjVaKxIMLiedTJpFnvNAFeW7/Ad0lGiPnCQ== x-ms-exchange-transport-forked: True X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT014.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 3a24e7fe-853a-4841-b5ad-08d8e54b33f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Mar 2021 11:37:22.8900 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR03HT161 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:202157 Archived-At: --_000_DB6P190MB0327531E10DFF3BEE5DDF546D66F9DB6P190MB0327EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable If I understand correctly, this is what happens currently : 1. Rename oldfile to new temporary name 2. Rename newfile to oldfile 3. If rename in 2) failed because oldfile has been recreated, go back to= 1) With my change it becomes : 1. Delete oldfile 2. Rename newfile to oldfile 3. If rename in 2) failed because oldfile has been recreated, go back to= 1) The only difference being that oldfile is deleted instead of keeping an .el= n.old file. In the non Windows version of the code no .eln.old file is created anyway. The problem on Windows is that the oldfile could reappear and block step 2)= , so the while loop is necessary, but I keep it in my proposed change. Or maybe I misunderstood entirely De : Eli Zaretskii Envoy=E9 le :vendredi 12 mars 2021 08:36 =C0 : Matt M Cc : akrl@sdf.org; 46972@debbugs.gnu.org Objet :Re: RE : RE : RE : bug#46972: 28.0.50; [feature/native-comp] Emacs l= ocks itself during native compilation because of permission denied > From: Matt M > CC: "46972@debbugs.gnu.org" <46972@debbugs.gnu.org> > Date: Fri, 12 Mar 2021 00:26:18 +0000 > > The Following patch seems to fix my problem : > --- a/lisp/emacs-lisp/comp.el > +++ b/lisp/emacs-lisp/comp.el > @@ -3778,13 +3778,7 @@ comp-delete-or-replace-file > (while > (condition-case _ > (progn > - ;; oldfile maybe recreated by another Emacs in > - ;; between the following two rename-file calls > - (if (file-exists-p oldfile) > - (rename-file oldfile (make-temp-file-internal > - (file-name-sans-extension o= ldfile) > - nil ".eln.old" nil) > - t)) > + (delete-file oldfile) > (when newfile > (rename-file newfile oldfile nil)) > ;; Keep on trying. > Changed the call to rename-file to delete-file. Thanks, but I don't think we can use this solution, due to the reason explained in the comment there. (You can, of course, use it locally, if the danger described there is not relevant for your usage.) I apologize that I didn't yet have time to recreate the problem you described and look into it: the native-comp branch is still not stable enough for me to try such non-trivial situations. I didn't forget, though. --_000_DB6P190MB0327531E10DFF3BEE5DDF546D66F9DB6P190MB0327EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

If I understand correctly, this is what happens curr= ently :

  1. Rename oldfile to new temporary name
  2. Rename newfile to oldf= ile
  3. If rename in 2) failed because oldfile has been recreated, go= back to 1)

With my change it becomes :

  1. Delete oldfile
  2. Rename newfile to oldfile
  3. If renam= e in 2) failed because oldfile has been recreated, go back to 1)

 

The only difference being that oldfile is deleted in= stead of keeping an .eln.old file.

In the non Windows version of the code no .eln.old f= ile is created anyway.

 

The problem on Windows is that the oldfile could rea= ppear and block step 2),

so the while loop is necessary, but I keep it in my = proposed change.

 

Or maybe I misunderstood entirely

De : <= a href=3D"mailto:eliz@gnu.org">Eli Zaretskii
Envoy=E9 le :vendredi 12 mars 2021 08:36
=C0 : Matt M
Cc : akrl@sdf.org; 46972@debbugs.gnu.org
Objet :Re: RE : RE : RE : bug#46972: 28.0.50; [f= eature/native-comp] Emacs locks itself during native compilation because of= permission denied

 

> From: Matt M <mmerino@outlook.fr>
> CC: "46972@debbugs.gnu.org" <46972@debbugs.gnu.org> > Date: Fri, 12 Mar 2021 00:26:18 +0000
>
> The Following patch seems to fix my problem :
> --- a/lisp/emacs-lisp/comp.el
> +++ b/lisp/emacs-lisp/comp.el
> @@ -3778,13 +3778,7 @@ comp-delete-or-replace-file
>           (while
>            = ;   (condition-case _
>            = ;       (progn
> -           &nb= sp;       ;; oldfile maybe recreated by anoth= er Emacs in
> -           &nb= sp;       ;; between the following two rename= -file calls
> -           &nb= sp;       (if (file-exists-p oldfile)
> -           &nb= sp;           (rename-fil= e oldfile (make-temp-file-internal
> -           &nb= sp;            =             &nb= sp;        (file-name-sans-extension old= file)
> -           &nb= sp;            =             &nb= sp;        nil ".eln.old" nil)=
> -           &nb= sp;            =             t))
> +           &nb= sp;       (delete-file oldfile)
>            = ;         (when newfile
>            = ;           (rename-file = newfile oldfile nil))
>            = ;         ;; Keep on trying.
> Changed the call to rename-file to delete-file.

Thanks, but I don't think we can use this solution, due to the reason
explained in the comment there.  (You can, of course, use it locally,<= br> if the danger described there is not relevant for your usage.)

I apologize that I didn't yet have time to recreate the problem you
described and look into it: the native-comp branch is still not stable
enough for me to try such non-trivial situations.  I didn't forget, though.

 

--_000_DB6P190MB0327531E10DFF3BEE5DDF546D66F9DB6P190MB0327EURP_--