Skip to content

Commit 34dc859

Browse files
committed
unix: do not built _test_ctypes as a built-in on macOS
We now build a .so file and test_ctypes now passes on macOS! As part of this, since there is a lib-dynload directory in the output, we make the creation of this directory conditional so we don't ship a .empty file if it isn't needed.
1 parent 10623d9 commit 34dc859

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

cpython-unix/build-cpython.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,11 @@ fi
272272
find ${ROOT}/out/python/install -type d -name __pycache__ -print0 | xargs -0 rm -rf
273273

274274
# Ensure lib-dynload exists, or Python complains on startup.
275-
mkdir -p ${ROOT}/out/python/install/lib/python${PYTHON_MAJMIN_VERSION}/lib-dynload
276-
touch ${ROOT}/out/python/install/lib/python${PYTHON_MAJMIN_VERSION}/lib-dynload/.empty
275+
LIB_DYNLOAD=${ROOT}/out/python/install/lib/python${PYTHON_MAJMIN_VERSION}/lib-dynload
276+
if [ ! -d ${LIB_DYNLOAD} ]; then
277+
mkdir -p ${LIB_DYNLOAD}
278+
touch ${LIB_DYNLOAD}/.empty
279+
fi
277280

278281
# Symlink libpython so we don't have 2 copies. We only need to do
279282
# this on Python 3.7, as 3.8 dropped the m ABI suffix from binary names.

cpython-unix/static-modules.3.7.macos

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ _crypt _cryptmodule.c
88
_curses _cursesmodule.c -lncurses
99
_curses_panel _curses_panel.c -lpanel -lncurses
1010
_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/darwin/dlfcn_simple.c _ctypes/malloc_closure.c _ctypes/stgdict.c _ctypes/cfield.c -DMACOSX -I_ctypes/darwin -lffi -ldl
11-
_ctypes_test _ctypes/_ctypes_test.c -lm
1211
_decimal _decimal/_decimal.c _decimal/libmpdec/basearith.c _decimal/libmpdec/constants.c _decimal/libmpdec/context.c _decimal/libmpdec/convolute.c _decimal/libmpdec/crt.c _decimal/libmpdec/difradix2.c _decimal/libmpdec/fnt.c _decimal/libmpdec/fourstep.c _decimal/libmpdec/io.c _decimal/libmpdec/memory.c _decimal/libmpdec/mpdecimal.c _decimal/libmpdec/numbertheory.c _decimal/libmpdec/sixstep.c _decimal/libmpdec/transpose.c -DUNIVERSAL=1 -IModules/_decimal/libmpdec
1312
_dbm _dbmmodule.c -DHAVE_BERKDB_H -DDB_DBM_HSEARCH -ldb
1413
_elementtree _elementtree.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat

docs/status.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Here, we track the various known failures when running
2828
``test_ctypes``
2929
---------------
3030

31-
Known Failing on: Linux, macOS
31+
Known Failing on: Linux
3232

3333
This fails with a bunch of
3434
``AttributeError: module '_ctypes_test' has no attribute '__file__'``.

0 commit comments

Comments
 (0)