all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Aaron Jensen <aaronjensen@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 68083@debbugs.gnu.org, Andrea Corallo <acorallo@gnu.org>,
	Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Subject: bug#68083: 30.0.50; Intermittent build failure with native compilation
Date: Sat, 30 Dec 2023 17:08:11 -0600	[thread overview]
Message-ID: <CAHyO48x0GLUnmWNbkiPevRApTgVLEzxxs84x6d_9XQSphY+ThA@mail.gmail.com> (raw)
In-Reply-To: <CAHyO48wX+hyERCt7Py3xyT-dQFvtzAh4i5Bk8-uOJBGjWo3P+g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1742 bytes --]

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 <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’s either a
> delete or rename force.
>
>
> Aaron
>
> On Sat, Dec 30 2023 at 1:46 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> From: Aaron Jensen <aaronjensen@gmail.com>
> 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 PM 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.
>
>

[-- Attachment #1.2: Type: text/html, Size: 4328 bytes --]

[-- Attachment #2: 0001-comp.el-comp-delete-or-replace-file-Fix-parallel-com.patch --]
[-- Type: application/octet-stream, Size: 1073 bytes --]

From c1ab27179e68b94c9adb4905c677c7f344c09e6d Mon Sep 17 00:00:00 2001
From: Aaron Jensen <aaronjensen@gmail.com>
Date: Sat, 30 Dec 2023 18:06:45 -0500
Subject: [PATCH] * comp.el (comp-delete-or-replace-file): Fix parallel
 compilation

---
 lisp/emacs-lisp/comp.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 3b2fd25e61c..f9eeef1b9e8 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -3339,9 +3339,9 @@ comp-delete-or-replace-file
         ;; Remove the old eln instead of copying the new one into it
         ;; to get a new inode and prevent crashes in case the old one
         ;; is currently loaded.
-        (t (delete-file oldfile)
-           (when newfile
-             (rename-file newfile oldfile)))))
+        (t (if newfile
+               (rename-file newfile oldfile t)
+             (delete-file oldfile)))))
 
 (defun comp--native-compile (function-or-file &optional with-late-load output)
   "Compile FUNCTION-OR-FILE into native code.
-- 
2.42.1


  reply	other threads:[~2023-12-30 23:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28 14:05 bug#68083: 30.0.50; Intermittent build failure with native compilation Aaron Jensen
2023-12-28 15:12 ` Eli Zaretskii
2023-12-29 18:43   ` Andrea Corallo
2023-12-29 19:09     ` Aaron Jensen
2023-12-29 20:17       ` Andrea Corallo
2023-12-29 20:26         ` Aaron Jensen
2023-12-29 21:07           ` Aaron Jensen
2023-12-30  6:47             ` Eli Zaretskii
2023-12-30 15:29               ` Aaron Jensen
2023-12-30 17:42                 ` Eli Zaretskii
2023-12-30 18:06                   ` Aaron Jensen
2023-12-30 18:46                     ` Eli Zaretskii
2023-12-30 20:54                       ` Aaron Jensen
2023-12-30 23:08                         ` Aaron Jensen [this message]
2023-12-31  6:26                         ` Eli Zaretskii
2024-01-01 19:39                           ` Andrea Corallo
2024-01-01 20:12                             ` Eli Zaretskii
2023-12-31 20:30         ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHyO48x0GLUnmWNbkiPevRApTgVLEzxxs84x6d_9XQSphY+ThA@mail.gmail.com \
    --to=aaronjensen@gmail.com \
    --cc=68083@debbugs.gnu.org \
    --cc=acorallo@gnu.org \
    --cc=eliz@gnu.org \
    --cc=jschmidt4gnu@vodafonemail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.