Re: Sbuild update 4.1.1

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

 



Hi,

> gobject-introspection might fail to generate stuff (failure at
> shutil.rmtree() in gdumpparser.py), especially on slow machines. Re-run
> the build from the last step.
> No new insights into this bug.
> 

Attached is an old patch (I used Dieterv's G-O-I branch) that fixes this mostly for me.

>From what I could determine at the time, either the Anti-Virus or some other culprit still had the .exe locked, so the rm failed the first time. Waiting (might make it longer for slower machines) on failure seems to fix it.


Regards,
Martin



Vrywaringsklousule / Disclaimer:  http://www.nwu.ac.za/it/gov-man/disclaimer.html 

>From 0c9f764be019d25a7ac1274abd16ea05767c3d2a Mon Sep 17 00:00:00 2001
From: Martin Schlemmer <Martin.Schlemmer@xxxxxxxxx>
Date: Thu, 12 Jul 2012 12:44:10 +0200
Subject: [PATCH 3/3] Windows port: handle failure to unlink the temporary
 directory more gracefully

On MinGW/MSYS unlinking the temporary directory the first time do not always
succeed the first time because of what seems to be AV-scanner activity on
the created executable. This causes Python to throw an exception, and due to
some strange interaction between MSYS and Python, an artificial lockup is
caused. Pressing return in mintty prints the exception and continues.

This is with Python 2.7 from www.python.org.
---
 giscanner/gdumpparser.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py
index c0b13f4..ae30e57 100644
--- a/giscanner/gdumpparser.py
+++ b/giscanner/gdumpparser.py
@@ -23,6 +23,7 @@ import sys
 import tempfile
 import shutil
 import subprocess
+import time
 from xml.etree.cElementTree import parse
 
 from . import ast
@@ -171,7 +172,14 @@ blob containing data gleaned from GObject's primitive introspection."""
             return parse(out_path)
         finally:
             if not utils.have_debug_flag('save-temps'):
-                shutil.rmtree(self._binary.tmpdir)
+                # FIXME: MinGW/MSYS do not always remove the directory the first time,
+                #        causing lockups due to what seems to be interaction between
+                #        MSYS and python when an exception is caught ...
+                try:
+                    shutil.rmtree(self._binary.tmpdir)
+                except Exception, e:
+                    time.sleep(0.5)
+                    shutil.rmtree(self._binary.tmpdir, True)
 
     # Parser
 
-- 
1.7.11.msysgit.1

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux