From 3e93741d315a41d014e81140df828398258aba48 Mon Sep 17 00:00:00 2001 From: mattip Date: Mon, 14 Aug 2023 12:38:39 +0300 Subject: [PATCH] fix and comment test c-extension handling --- recipe/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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