[Scipy-svn] r5227 - trunk/tools/win32/build_scripts

scipy-svn at scipy.org scipy-svn at scipy.org
Fri Dec 5 06:40:25 EST 2008


Author: cdavid
Date: 2008-12-05 05:40:20 -0600 (Fri, 05 Dec 2008)
New Revision: 5227

Modified:
   trunk/tools/win32/build_scripts/pavement.py
Log:
Display the build log when build fails.

Modified: trunk/tools/win32/build_scripts/pavement.py
===================================================================
--- trunk/tools/win32/build_scripts/pavement.py	2008-12-04 23:17:27 UTC (rev 5226)
+++ trunk/tools/win32/build_scripts/pavement.py	2008-12-05 11:40:20 UTC (rev 5227)
@@ -274,8 +274,30 @@
 
 def raw_build_sdist(cwd):
     cmd = ["python", "setup.py", "sdist", "--format=zip"]
-    st = subprocess.call(cmd, cwd=cwd)
 
+    build_log = "sdist.log"
+    f = open(build_log, 'w')
+    try:
+        try:
+            st = subprocess.call(cmd, #shell = True,
+                            stderr = subprocess.STDOUT, stdout = f,
+                            cwd=cwd)
+            if st:
+                raise RuntimeError("The cmd failed with status %d" % st)
+        finally:
+            f.close()
+    except (subprocess.CalledProcessError, RuntimeError), e:
+        print e
+        msg = """
+There was an error while executing the following command:
+
+    %s
+
+Error was : %s
+
+Look at the log (%s).""" % (cmd, str(e), build_log)
+        raise Exception(msg)
+
 def raw_bootstrap(pyver, src_dir):
     bdir = bootstrap_dir(pyver)
     prepare_scipy_sources(src_dir, bdir)




More information about the Scipy-svn mailing list