[pypy-commit] pypy default: preserve dest dir

mattip pypy.commits at gmail.com
Sat Sep 14 09:09:24 EDT 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r97477:1a5d83a05509
Date: 2019-09-14 16:08 +0300
http://bitbucket.org/pypy/pypy/changeset/1a5d83a05509/

Log:	preserve dest dir

diff --git a/pypy/tool/build_cffi_imports.py b/pypy/tool/build_cffi_imports.py
--- a/pypy/tool/build_cffi_imports.py
+++ b/pypy/tool/build_cffi_imports.py
@@ -90,6 +90,9 @@
         print('fetching archive', url, file=sys.stderr)
         urlretrieve(url, archive)
 
+    shutil.rmtree(deps_destdir, ignore_errors=True)
+    os.makedirs(deps_destdir)
+
     # extract the into our destination directory
     print('unpacking archive', archive, file=sys.stderr)
     _unpack_tarfile(archive, deps_destdir)
@@ -151,13 +154,7 @@
 
         print('*', ' '.join(args), file=sys.stderr)
         if embed_dependencies:
-            destdir = deps_destdir
-
-            shutil.rmtree(destdir, ignore_errors=True)
-            os.makedirs(destdir)
-
             status, stdout, stderr = _build_dependency(key)
-
             if status != 0:
                 failures.append((key, module))
                 print("stdout:")
@@ -167,9 +164,9 @@
                 continue
 
             env['CPPFLAGS'] = \
-                '-I{}/usr/include {}'.format(destdir, env.get('CPPFLAGS', ''))
+                '-I{}/usr/include {}'.format(deps_destdir, env.get('CPPFLAGS', ''))
             env['LDFLAGS'] = \
-                '-L{}/usr/lib {}'.format(destdir, env.get('LDFLAGS', ''))
+                '-L{}/usr/lib {}'.format(deps_destdir, env.get('LDFLAGS', ''))
         elif sys.platform == 'win32':
             env['INCLUDE'] = r'..\externals\include;' + env.get('INCLUDE', '')
             env['LIB'] = r'..\externals\lib;' + env.get('LIB', '')


More information about the pypy-commit mailing list