[pypy-commit] pypy py3.5-mac-embedding: add embedding arg to build_cffi_imports during translation too

mattip pypy.commits at gmail.com
Sun Oct 22 12:00:07 EDT 2017


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.5-mac-embedding
Changeset: r92829:825f3ec1239e
Date: 2017-10-22 18:55 +0300
http://bitbucket.org/pypy/pypy/changeset/825f3ec1239e/

Log:	add embedding arg to build_cffi_imports during translation too

diff --git a/pypy/goal/targetpypystandalone.py b/pypy/goal/targetpypystandalone.py
--- a/pypy/goal/targetpypystandalone.py
+++ b/pypy/goal/targetpypystandalone.py
@@ -352,8 +352,9 @@
 
     def hack_for_cffi_modules(self, driver):
         # HACKHACKHACK
-        # ugly hack to modify target goal from compile_* to build_cffi_imports
-        # this should probably get cleaned up and merged with driver.create_exe
+        # ugly hack to modify target goal from compile_* to build_cffi_imports,
+        # as done in package.py
+        # this is needed by the benchmark buildbot run, maybe do it as a seperate step there?
         from rpython.tool.runsubprocess import run_subprocess
         from rpython.translator.driver import taskdef
         import types
@@ -363,11 +364,14 @@
         def task_build_cffi_imports(self):
             ''' Use cffi to compile cffi interfaces to modules'''
             filename = os.path.join(pypydir, 'tool', 'build_cffi_imports.py')
+            if system.platform == 'darwin':
+                argv = [filename, '--embed-dependencies']
+            else:
+                argv = [filename,]
             status, out, err = run_subprocess(str(driver.compute_exe_name()),
-                                              [filename])
+                                              argv)
             sys.stdout.write(out)
             sys.stderr.write(err)
-            # otherwise, ignore errors
         driver.task_build_cffi_imports = types.MethodType(task_build_cffi_imports, driver)
         driver.tasks['build_cffi_imports'] = driver.task_build_cffi_imports, [compile_goal]
         driver.default_goal = 'build_cffi_imports'
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
@@ -312,7 +312,7 @@
     parser.add_argument('--embedded-dependencies', '--no-embedded-dependencies',
                         dest='embed_dependencies',
                         action=NegateAction,
-                        default=sys.platform == 'darwin',
+                        default=(sys.platform == 'darwin'),
                         help='whether to embed dependencies for distribution '
                         '(default on OS X)')
     options = parser.parse_args(args)


More information about the pypy-commit mailing list