From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#68083: 30.0.50; Intermittent build failure with native compilation Date: Sat, 30 Dec 2023 17:08:11 -0600 Message-ID: References: <83le9e743s.fsf@gnu.org> <835y0g5gq8.fsf@gnu.org> <838r5b4me9.fsf@gnu.org> <831qb34jgv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0000000000000e03ef060dc23992" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24285"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68083@debbugs.gnu.org, Andrea Corallo , Jens Schmidt To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 31 00:09:20 2023 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 1rJiSG-00067n-1r for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Dec 2023 00:09:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rJiRy-0003wR-MF; Sat, 30 Dec 2023 18:09:02 -0500 Original-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 1rJiRx-0003wF-Ov for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 18:09:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rJiRx-0005EC-H0 for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 18:09:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rJiRx-0004cK-TU for bug-gnu-emacs@gnu.org; Sat, 30 Dec 2023 18:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Dec 2023 23:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68083 X-GNU-PR-Package: emacs Original-Received: via spool by 68083-submit@debbugs.gnu.org id=B68083.170397770517703 (code B ref 68083); Sat, 30 Dec 2023 23:09:01 +0000 Original-Received: (at 68083) by debbugs.gnu.org; 30 Dec 2023 23:08:25 +0000 Original-Received: from localhost ([127.0.0.1]:45224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJiRM-0004bT-Pr for submit@debbugs.gnu.org; Sat, 30 Dec 2023 18:08:25 -0500 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:61702) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rJiRH-0004bC-If for 68083@debbugs.gnu.org; Sat, 30 Dec 2023 18:08:23 -0500 Original-Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cc7d2c1ff0so84317221fa.3 for <68083@debbugs.gnu.org>; Sat, 30 Dec 2023 15:08:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703977692; x=1704582492; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Qzml/OQ67qxbBp/oCzdgxpw0awXuhqlu4p/XeYYIdbg=; b=fdwLuHD/cELFhLCxYjsDBdaNP7ZKMyJ42JRTvG50+z3r3NZlAoJvgrWXExmZwTZHUg lDm57R+wQh76nKGrIPo7gR9nG2ttU1tUr1EcxEVwDGFz1hL2uU9lX2gXYV2zJHR/Lx9A Y57D5XiTIHBVf5HKi2pzLAqH1zVaNP6B3uIwEDzcmAhlFykMUtLRCUDgS6EFkz4Vf2jM Il7OF/UKeoZbuRuz3IfjOKLsYj0zF/xWoZ79kHYOzxO4i+86Mkj0VuSsgkbCUdIx2CZo /DqGIsFD4Fn0yhWYFwWU/2mqDH03g0umOFZLSqdlZu6j/swdjnkZ9nb07Cr3M0yiZdx5 slkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703977692; x=1704582492; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Qzml/OQ67qxbBp/oCzdgxpw0awXuhqlu4p/XeYYIdbg=; b=mDRDWswwfwwjlTF/qBlAIqWFP+RpLmQ5hEPJvKEuEw+Dfx5bI525EljS7a04K/W75p h3Hu+vQaw+xYLsDhBCHPmAnqIOblFC0CFs8r3rh3SkzfZzK0vORwi8RvglSJm50QyjR4 xYgZqknCrexFLtBWv+FqRi+08Hd6zP7zScNx/Vp4/IUbPyh8TmuXJ0URZPVid036KPq3 2sNvp9xr7Co1vT56mRXA0+295AAf6ClEk22nj4XGbfVjpF96Jo1WRH54dOaNdf9JujBs J8AD9ZBLa9IA2wt9EE40wVHwiXaPSQ1/bh2t6JdLMBOE0IziA/m17nP7g0UsnoS3X/xF AjsA== X-Gm-Message-State: AOJu0YxRq/Z3uDsdKY3VPPGB2jgbDkUj0XlzGKPiKd4URMxj3d2e6rkL stKvkUfjD+LYcwZ1sZ7kgxF3B5q1Q4s0b9PiZsY= X-Google-Smtp-Source: AGHT+IE63U8yidYgyT0YV0VK/b+VW/pEs6t7QBhGf4R5fnpqAkegkU6r0GDagQbfaAhuM1YDu/WOxwJHvR6Nrhe++wk= X-Received: by 2002:a2e:3a03:0:b0:2cc:5a00:8e0 with SMTP id h3-20020a2e3a03000000b002cc5a0008e0mr6652334lja.80.1703977692291; Sat, 30 Dec 2023 15:08:12 -0800 (PST) Original-Received: from 649336022844 named unknown by gmailapi.google.com with HTTPREST; Sat, 30 Dec 2023 17:08:11 -0600 X-Mailer: Superhuman Desktop (2023-12-22T20:06:10Z) X-Superhuman-ID: lqsob57p.51c7a4cc-0d44-49ef-a217-a8f7efb905b2 In-Reply-To: X-Superhuman-Draft-ID: draft00b67a882aea2dc3 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277108 Archived-At: --0000000000000e03ef060dc23992 Content-Type: multipart/alternative; boundary="0000000000000e03ed060dc23990" --0000000000000e03ed060dc23990 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Here's a patch, if helpful. I've tested it and can build with it. Aaron On Sat, Dec 30, 2023 at 3:54 PM, Aaron Jensen wrote= : > Works for me, though is it still an outstanding question as to whether or > not we should add macro expand back? > > Also yeah if we add the t we can do what you suggested where it=E2=80=99s= either a > delete or rename force. > > > Aaron > > On Sat, Dec 30 2023 at 1:46 PM, Eli Zaretskii wrote: > > From: Aaron Jensen > Date: Sat, 30 Dec 2023 13:06:55 -0500 > Cc: acorallo@gnu.org, 68083@debbugs.gnu.org, jschmidt4gnu@vodafonemail.de > > On Sat, Dec 30, 2023 at 12:43=E2=80=AFPM Eli Zaretskii wro= te: > > > > What happens if, instead of wrapping rename-file in condition-case, > > you change that to say > > > > (t (if newfile > > (rename-file newfile oldfile) > > (delete-file oldfile)) > > I don't really understand this change. The previous version of the code > wraps the rename in a (when newfile) and deletes the oldfile right before > that. The deletion would always be necessary if the oldfile exists unless > OK-IF-ALREADY-EXISTS is specified in rename-file. > > Sorry, I meant to add the OK-IF-ALREADY-EXISTS argument non-nil, of > course. > > The point is that you can rename a file if the OLDFILE exists with no > problem, and that is supposed to be an atomic operation, so no race > conditions. > > Indeed, but we aren't specifying OK-IF-ALREADY-EXISTS, so if another > process does the same compile at the same time (and therefore the same > rename), they will conflict. We could specify OK-IF-ALREADY-EXISTS instea= d > and that works as well: > > Then I prefer this version. > > --0000000000000e03ed060dc23990 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Here's a patch,= if helpful. I've tested it and can build with it.
=


Aaron


On Sat, Dec 30, 2023 at 3:54 PM, Aaro= n Jensen <aaronjensen@gmail.com> wrote:
Works for me= , though is it still an outstanding question as to whether or not we should= add macro expand back?

Also yeah if we add the t we can = do what you suggested where it=E2=80=99s either a delete or rename force.= =C2=A0


Aaron
=20

On Sat, Dec 30 2023 at 1:46 PM, Eli = Zaretskii <eliz@gnu.org&= gt; wrote:

From: Aaron Jensen <aaronje= nsen@gmail.com>
Date: Sat, 30 Dec 20= 23 13:06:55 -0500
Cc: acorallo@gnu.org,= 68083@debbugs.gnu.<= wbr>org, jschmidt4g= nu@vodafonemail.de

On Sat, Dec 30, 2023 at 12:43=E2=80=AFPM Eli Zaretskii <eliz@gnu.org> wrote:
>
> What happens if, instead of wrapping rename-file in condition-case,
> you change that to say
>
> (t (if newfile
> (rename-file newfile oldfile)
> (delete-file oldfile))

I don't really understand this change. The previous version of the code wraps the rename in a (when newfile) and deletes the oldfile right before that. The deletion would always be necessary if the oldfile exists unless OK-IF-ALREADY-EXISTS is specified in rename-file.

Sorry, I meant to add the OK-IF-ALREADY-EXISTS argument non-nil, of course.

The point is that you can rename a file if the OLDFILE exists with no problem, and that is supposed to be an atomic operation, so no race conditions.

Indeed, but we aren't specifying OK-IF-ALREADY-EXISTS, so if another process does the same compile at the same time (and therefore the same rename), they will conflict. We could specify OK-IF-ALREADY-EXISTS instead and that works as well:

Then I prefer this version.

<= /div>

--0000000000000e03ed060dc23990-- --0000000000000e03ef060dc23992 Content-Type: application/octet-stream; name="0001-comp.el-comp-delete-or-replace-file-Fix-parallel-com.patch" Content-Disposition: attachment; filename="0001-comp.el-comp-delete-or-replace-file-Fix-parallel-com.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: fe7a8a11c2e3eb3_0.1 RnJvbSBjMWFiMjcxNzllNjhiOTRjOWFkYjQ5MDVjNjc3YzdmMzQ0YzA5ZTZkIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBBYXJvbiBKZW5zZW4gPGFhcm9uamVuc2VuQGdtYWlsLmNvbT4K RGF0ZTogU2F0LCAzMCBEZWMgMjAyMyAxODowNjo0NSAtMDUwMApTdWJqZWN0OiBbUEFUQ0hdICog Y29tcC5lbCAoY29tcC1kZWxldGUtb3ItcmVwbGFjZS1maWxlKTogRml4IHBhcmFsbGVsCiBjb21w aWxhdGlvbgoKLS0tCiBsaXNwL2VtYWNzLWxpc3AvY29tcC5lbCB8IDYgKysrLS0tCiAxIGZpbGUg Y2hhbmdlZCwgMyBpbnNlcnRpb25zKCspLCAzIGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xp c3AvZW1hY3MtbGlzcC9jb21wLmVsIGIvbGlzcC9lbWFjcy1saXNwL2NvbXAuZWwKaW5kZXggM2Iy ZmQyNWU2MWMuLmY5ZWVlZjFiOWU4IDEwMDY0NAotLS0gYS9saXNwL2VtYWNzLWxpc3AvY29tcC5l bAorKysgYi9saXNwL2VtYWNzLWxpc3AvY29tcC5lbApAQCAtMzMzOSw5ICszMzM5LDkgQEAgY29t cC1kZWxldGUtb3ItcmVwbGFjZS1maWxlCiAgICAgICAgIDs7IFJlbW92ZSB0aGUgb2xkIGVsbiBp bnN0ZWFkIG9mIGNvcHlpbmcgdGhlIG5ldyBvbmUgaW50byBpdAogICAgICAgICA7OyB0byBnZXQg YSBuZXcgaW5vZGUgYW5kIHByZXZlbnQgY3Jhc2hlcyBpbiBjYXNlIHRoZSBvbGQgb25lCiAgICAg ICAgIDs7IGlzIGN1cnJlbnRseSBsb2FkZWQuCi0gICAgICAgICh0IChkZWxldGUtZmlsZSBvbGRm aWxlKQotICAgICAgICAgICAod2hlbiBuZXdmaWxlCi0gICAgICAgICAgICAgKHJlbmFtZS1maWxl IG5ld2ZpbGUgb2xkZmlsZSkpKSkpCisgICAgICAgICh0IChpZiBuZXdmaWxlCisgICAgICAgICAg ICAgICAocmVuYW1lLWZpbGUgbmV3ZmlsZSBvbGRmaWxlIHQpCisgICAgICAgICAgICAgKGRlbGV0 ZS1maWxlIG9sZGZpbGUpKSkpKQogCiAoZGVmdW4gY29tcC0tbmF0aXZlLWNvbXBpbGUgKGZ1bmN0 aW9uLW9yLWZpbGUgJm9wdGlvbmFsIHdpdGgtbGF0ZS1sb2FkIG91dHB1dCkKICAgIkNvbXBpbGUg RlVOQ1RJT04tT1ItRklMRSBpbnRvIG5hdGl2ZSBjb2RlLgotLSAKMi40Mi4xCgo= --0000000000000e03ef060dc23992--