meson/mesonbuild/utils
Eli Schwartz 2ef94a71f8
delay importing ctypes unless it is actually used
ctypes uses FFI, and surprisingly often people's Python installations
will be broken because ctypes is broken (e.g. the system libffi has been
updated and Python needs to be recompiled). That is not our fault, but
it does manifest as Meson failing to run. It turns out we aren't even
using it though. At least, pretty often.

We have two uses of ctypes, and both of them are for Windows. One of
them is already conditionally imported in the function that uses it, but
the other is imported at startup. Move this down into the invoking
function.

On non-Windows systems, it is now impossible for Meson to fail to run
when ctypes is broken, because we don't use it. Anecdotally, this issue
tends to come up on Linux systems primarily.

Fixes #11111
Closes #11112
2022-12-15 16:44:35 -05:00
..
__init__.py Move classes used by scripts to their own module 2022-09-28 19:36:13 -04:00
core.py devenv: Do not include system values in --dump 2022-12-07 11:58:35 -05:00
platform.py Move classes used by scripts to their own module 2022-09-28 19:36:13 -04:00
posix.py Move classes used by scripts to their own module 2022-09-28 19:36:13 -04:00
universal.py delay importing ctypes unless it is actually used 2022-12-15 16:44:35 -05:00
vsenv.py Fix native compilation on ARM64 Windows 2022-10-25 14:59:06 +03:00
win32.py Move classes used by scripts to their own module 2022-09-28 19:36:13 -04:00