diff --git a/recipe/build.sh b/recipe/build.sh index c2a79fb..f20bf4e 100755 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -121,12 +121,18 @@ echo INCLUDEPY $(pypy -c "from distutils import sysconfig; print(sysconfig.get_c ls $(pypy -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))") _PYTHON_SYSCONFIGDATA_NAME=$sysconfigdata_name pypy -c "from distutils import sysconfig; assert sysconfig.get_config_var('HOST_GNU_TYPE') != None" -# Build and copy the c-extension modules for the standard library +# Build the test c-extension modules then copy to the standard library +# PyPy uses a wrapper to trick the import system into gettig the c-extension from `/tmp` +# so that changing the code triggers a rebuild. +pypy -c "import _testcapi" cp $(pypy -c "import _testcapi; print(_testcapi.__file__)") $PREFIX/lib/pypy${PY_VERSION} if [[ "${PY_VERSION}" == "3.8" ]]; then + pypy -c "import _ctypes_test, _test_multiphase" cp $(pypy -c "import _ctypes_test; print(_ctypes_test.__file__)") $PREFIX/lib/pypy${PY_VERSION} cp $(pypy -c "import _testmultiphase; print(_testmultiphase.__file__)") $PREFIX/lib/pypy${PY_VERSION} else + pypy -c "import _ctypes_test_build, _test_multiphase_build" + # Need to import the *build module to properly import the built module from `/tmp` cp $(pypy -c "import _ctypes_test_build, _ctypes_test; print(_ctypes_test.__file__)") $PREFIX/lib/pypy${PY_VERSION} cp $(pypy -c "import _testmultiphase_build, _testmultiphase; print(_testmultiphase.__file__)") $PREFIX/lib/pypy${PY_VERSION} fi