Skip to content

Commit

Permalink
Try using an earlier workaround for pypy 7.2.0 on macos
Browse files Browse the repository at this point in the history
This should hopefully fix the following error:

 ERROR: Command errored out with exit status 1:
   command: /tmp/cibw_bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pip-req-build-rAkgSa/setup.py'"'"'; __file__='"'"'/private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pip-req-build-rAkgSa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pip-wheel-KO2bV3
       cwd: /private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pip-req-build-rAkgSa/
  Complete output (8 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'spam' extension
  creating build
  creating build/temp.macosx-10.14-x86_64-2.7
  cc -pthread -arch x86_64 -DNDEBUG -O2 -fPIC -I/tmp/pypy2.7-v7.2.0-osx64/include -c spam.c -o build/temp.macosx-10.14-x86_64-2.7/spam.o
  error: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.9" but "10.14" during configure
  • Loading branch information
hyperair committed Jun 11, 2020
1 parent d04864f commit f395c7b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cibuildwheel/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ def install_pypy(version: str, url: str) -> str:
download(url, os.path.join("/tmp", pypy_tar_bz2))
call(['tar', '-C', '/tmp', '-xf', os.path.join("/tmp", pypy_tar_bz2)])

# fix PyPy 7.2.0 bug resulting in wrong macOS platform tag
if "-v7.2.0-" in url:
patch_file = os.path.abspath(os.path.join(os.path.dirname(__file__), 'resources', 'pypy3.6-7.2.0.patch'))
sysconfigdata_file = os.path.join(installation_path, 'lib_pypy', '_sysconfigdata.py')
call(['patch', sysconfigdata_file, patch_file, '-N']) # Always has nonzero return code

installation_bin_path = os.path.join(installation_path, 'bin')
python_executable = 'pypy3' if version[0] == '3' else 'pypy'
pip_executable = 'pip3' if version[0] == '3' else 'pip'
Expand Down
7 changes: 7 additions & 0 deletions cibuildwheel/resources/pypy3.6-7.2.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--- a/lib_pypy/_sysconfigdata.py Tue Jan 28 22:54:59 2020 +0200
+++ b/lib_pypy/_sysconfigdata.py Wed Jan 29 19:21:23 2020 +0200
@@ -47,3 +47,4 @@
build_time_vars['CC'] += ' -arch %s' % (arch,)
if "CXX" in build_time_vars:
build_time_vars['CXX'] += ' -arch %s' % (arch,)
+ build_time_vars['MACOSX_DEPLOYMENT_TARGET'] = '10.7'

0 comments on commit f395c7b

Please sign in to comment.