[pypy-commit] pypy py3.6: merge default into py3.6

mattip pypy.commits at gmail.com
Wed Nov 13 10:26:26 EST 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r98045:7d4bfee3b8a6
Date: 2019-11-13 10:25 -0500
http://bitbucket.org/pypy/pypy/changeset/7d4bfee3b8a6/

Log:	merge default into py3.6

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
@@ -194,9 +194,9 @@
             if status != 0:
                 failures.append((key, module))
                 print("stdout:")
-                print(stdout.decode('utf-8'))
+                print(stdout.decode('utf-8'), file=sys.stderr)
                 print("stderr:")
-                print(stderr)
+                print(stderr, file=sys.stderr)
         except:
             import traceback;traceback.print_exc()
             failures.append((key, module))
diff --git a/pypy/tool/release/package.py b/pypy/tool/release/package.py
--- a/pypy/tool/release/package.py
+++ b/pypy/tool/release/package.py
@@ -31,6 +31,8 @@
 
 POSIX_EXE = 'pypy3'
 
+POSIX_EXE = 'pypy'
+
 from pypy.tool.build_cffi_imports import (create_cffi_import_libraries,
         MissingDependenciesError, cffi_build_scripts)
 
@@ -72,7 +74,7 @@
 
     basedir = py.path.local(basedir)
     if not override_pypy_c:
-        basename = 'pypy3-c'
+        basename = POSIX_EXE + '-c'
         if sys.platform == 'win32':
             basename += '.exe'
         pypy_c = basedir.join('pypy', 'goal', basename)
@@ -107,10 +109,13 @@
 
     if (sys.platform != 'win32' and    # handled below
         not _fake and os.path.getsize(str(pypy_c)) < 500000):
-        # This pypy3-c is very small, so it means it relies on libpypy3_c.so.
+        # This 'pypy_c' is very small, so it means it relies on a so/dll
         # If it would be bigger, it wouldn't.  That's a hack.
-        libpypy_name = ('libpypy3-c.so' if not sys.platform.startswith('darwin')
-                                        else 'libpypy3-c.dylib')
+        if sys.platform.startswith('darwin'):
+            ext = 'dylib'
+        else:
+            ext = 'so'
+        libpypy_name = 'lib' + POSIX_EXE + '-c.' + ext
         libpypy_c = pypy_c.new(basename=libpypy_name)
         if not libpypy_c.check():
             raise PyPyCNotFound('Expected pypy to be mostly in %r, but did '
@@ -135,8 +140,9 @@
             tgt = py.path.local(tgt)
             binaries.append((pypyw, tgt.new(purebasename=tgt.purebasename + 'w').basename, None))
             print("Picking %s" % str(pypyw))
-        # Can't rename a DLL: it is always called 'libpypy3-c.dll'
-        win_extras = [('libpypy3-c.dll', None), ('sqlite3.dll', lib_pypy)]
+        # Can't rename a DLL
+        win_extras = [('lib' + POSIX_EXE + '-c.dll', None),
+                      ('sqlite3.dll', lib_pypy)]
         if not options.no_tk:
             tkinter_dir = lib_pypy.join('_tkinter')
             win_extras += [('tcl85.dll', tkinter_dir), ('tk85.dll', tkinter_dir)]
@@ -156,9 +162,7 @@
             print('Picking %s (and contents)' % libsdir)
             shutil.copytree(str(libsdir), str(pypydir.join('libs')))
         else:
-            print('"libs" dir with import library not found.')
-            print('You have to create %r' % (str(libsdir),))
-            print('and copy libpypy3-c.lib in there, renamed to python32.lib')
+            raise RuntimError('"libs" dir with import library not found.')
             # XXX users will complain that they cannot compile capi (cpyext)
             # modules for windows, also embedding pypy (i.e. in cffi)
             # will fail.
@@ -186,14 +190,14 @@
                           for source, target, target_dir in binaries])
 
     # Careful: to copy lib_pypy, copying just the hg-tracked files
-    # would not be enough: there are also ctypes_config_cache/_*_cache.py.
-    # XXX ^^^ this is no longer true!
+    # would not be enough: there are also build artifacts like cffi-generated
+    # dynamic libs
     shutil.copytree(str(basedir.join('lib-python').join(STDLIB_VER)),
                     str(pypydir.join('lib-python').join(STDLIB_VER)),
                     ignore=ignore_patterns('.svn', 'py', '*.pyc', '*~'))
     shutil.copytree(str(basedir.join('lib_pypy')), str(lib_pypy),
                     ignore=ignore_patterns('.svn', 'py', '*.pyc', '*~',
-                                           '*_cffi.c', '*.o'))
+                                           '*_cffi.c', '*.o', '*.pyd-*'))
     for file in ['README.rst',]:
         shutil.copy(str(basedir.join(file)), str(pypydir))
     for file in ['_testcapimodule.c', '_ctypes_test.c']:
@@ -301,7 +305,7 @@
             setattr(ns, self.dest, option[2:4] != 'no')
 
     if sys.platform == 'win32':
-        pypy_exe = 'pypy3.exe'
+        pypy_exe = POSIX_EXE + '.exe'
     else:
         pypy_exe = POSIX_EXE
     parser = argparse.ArgumentParser()


More information about the pypy-commit mailing list