[pypy-commit] pypy default: Check and complain if there is a "libpypy-c.so" that appears not to be needed

arigo noreply at buildbot.pypy.org
Mon Mar 30 10:47:00 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r76629:98e7823b191a
Date: 2015-03-30 10:47 +0200
http://bitbucket.org/pypy/pypy/changeset/98e7823b191a/

Log:	Check and complain if there is a "libpypy-c.so" that appears not to
	be needed

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
@@ -65,6 +65,9 @@
 add --without-{0} option to skip packaging binary CFFI extension.""".format(module)
             raise MissingDependenciesError(module)
 
+def pypy_runs(pypy_c):
+    return subprocess.call([str(pypy_c), '-c', 'pass']) == 0
+
 def create_package(basedir, options):
     retval = 0
     name = options.name
@@ -87,6 +90,8 @@
             ' Please compile pypy first, using translate.py,'
             ' or check that you gave the correct path'
             ' with --override_pypy_c' % pypy_c)
+    if not pypy_runs(pypy_c):
+        raise OSError("Running %r failed!" % (str(pypy_c),))
     if not options.no_cffi:
         try:
             create_cffi_import_libraries(pypy_c, options)
@@ -100,6 +105,15 @@
     libpypy_name = 'libpypy-c.so' if not sys.platform.startswith('darwin') else 'libpypy-c.dylib'
     libpypy_c = pypy_c.new(basename=libpypy_name)
     if libpypy_c.check():
+        # check that this libpypy_c is really needed
+        os.rename(str(libpypy_c), str(libpypy_c) + '~')
+        try:
+            if pypy_runs(pypy_c):
+                raise Exception("It seems that %r runs without needing %r.  "
+                                "Please check and remove the latter" %
+                                (str(pypy_c), str(libpypy_c)))
+        finally:
+            os.rename(str(libpypy_c) + '~', str(libpypy_c))
         binaries.append((libpypy_c, libpypy_name))
     #
     builddir = options.builddir


More information about the pypy-commit mailing list