bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unlink failure on abort


From: Orgad Shaneh
Subject: Re: Unlink failure on abort
Date: Fri, 16 Jun 2017 01:16:09 +0300

On Fri, Jun 16, 2017 at 12:46 AM, Orgad Shaneh <address@hidden> wrote:
On Thu, Jun 15, 2017 at 10:33 PM, Orgad Shaneh <address@hidden> wrote:
Hi,

I'm using mingw32-make 4.2.1 from MSYS2/mingw32.

When I abort a build, make fails to unlink the intermediate files. I previously used 4.1.90, and I don't remember having these problems.

This happens even for a single job (without -j).

Output:
main.cpp
mingw32-make[1]: *** Deleting file 'obj/main.o'
mingw32-make[1]: unlink: obj/main.o: Permission denied
^CTerminate batch job (Y/N)? y
mingw32-make[1]: *** [Makefile:7178: obj/main.o] Error 255
Terminate batch job (Y/N)? y
mingw32-make: *** [Makefile:5574: app.exe] Error 255

- Orgad


Ok, I found out that the bug is not (entirely) in make. What causes this problem is the following patch applied by MSYS2 packages of mingw make:

diff -Naur make-4.2.1/main.c make-4.2.1.new/main.c
--- make-4.2.1/main.c   2016-05-31 09:17:26.000000000 +0200
+++ make-4.2.1.new/main.c       2017-02-20 22:55:09.051617838 +0100
@@ -1126,8 +1126,11 @@

 #endif

+/* setlocale interferes with line buffering if using parallel make on MinGW */
+#ifndef __MINGW32__
   /* Set up gettext/internationalization support.  */
   setlocale (LC_ALL, "");
+#endif
   /* The cast to void shuts up compiler warnings on systems that
      disable NLS.  */
   (void)bindtextdomain (PACKAGE, LOCALEDIR);

If I revert the patch, delete works as expected.

I'll file a bug there.

- Orgad


... or not. I still get it even without this patch, when running from IDE. Reverting the patch only fixes the issue when running in command line.

I did file a bug[1], but this is not the real reason. Probably timing issue.

It doesn't reproduce with GnuWin 3.81, but that's ancient, and I need some fixes from later versions.

Another thing I've noticed is that make (on Windows/MinGW) leaves behind suspended processes when it is aborted. Maybe one of these processes holds the file and prevents it from being deleted?

If you can suggest ways to debug and fix this problem, I'll be thankful.

Thanks.

- Orgad

[1] https://github.com/Alexpux/MINGW-packages/issues/2592

reply via email to

[Prev in Thread] Current Thread [Next in Thread]