========= Changelog ========= .. role:: red :class: in-red Release history for |cslug|. Breaking changes are :red:`highlighted in red` text. v1.0.0 ------ .. rst-class:: spacious * Support the semi-standardised ``CFLAGS``, ``MACOSX_DEPLOYMENT_TARGET`` and ``MACOSX_ARCHITECTURE`` as aliases for the pre-existing ``CC_FLAGS``, ``MACOS_DEPLOYMENT_TARGET`` and ``MACOS_ARCHITECTURE`` environment variables. * Fix building wheels with new setuptools+wheel versions. * .. rst-class:: in-red Remove ``cslug.__version__`` attribute. Use ``importlib.metadata.version("cslug")`` instead. * .. rst-class:: in-red Fix the macOS deployment target not being enforced for targets below 10.12. * Drop end of life Python versions 3.6 and 3.7. * The build command in :class:`~cslug.exceptions.BuildError` now uses shell-like syntax instead of an argument list. v0.7.0 ------ .. rst-class:: spacious * Fix macOS wheel tag when building an ``arm64`` only wheel. * Fix macOS wheel tags when building from a ``universal2`` build of Python. * .. rst-class:: in-red Make clang the default compiler on macOS and FreeBSD. Since these platforms officially use clang as their default compilers, clang is much more likely to be available. gcc is still used as a fallback if clang is not find-able. * Expose all stdlib functions available on the current operating system. The original plan of making `cslug.stdlib` expose only symbols that are universally available on all platforms meant that, as cslug gained new platforms or newer versions of existing platforms deprecated functions (in particularly the dropping of the insecure family of functions that took NULL terminated string inputs), that the pool of functions cslug could expose was constantly shrinking and cslug was essentially having to make breaking changes every time. The new approach is simply to expose anything that's available on the current platform. The documentation (`cslug.stdlib`) lists which platforms each function can be used on. * .. rst-class:: in-red On Windows versions that support it (11 and, if the relevant update is installed, 10), use the new Universal C Runtime for `cslug.stdlib`. Unlike ``msvcrt.dll`` which `cslug` used originally, it receives updates and is officially documented and supported API so it shouldn't disappear at some unknown point in the future! The following functions are in ``msvcrt`` but not in UCRT: :ref:`ctime() `, :ref:`fprintf() `, :ref:`fscanf() `, :ref:`gmtime() `, :ref:`localtime() `, :ref:`printf() `, :ref:`scanf() `, :ref:`sprintf() `, :ref:`sscanf() `, :ref:`swprintf() `, :ref:`swscanf() `, :ref:`vfprintf() `, :ref:`vswprintf() `. * Add support for clang on MSYS2. * Add support for OpenBSD and NetBSD. v0.6.0 ------ .. rst-class:: spacious * Add support for NVIDEA's multicore/GPU friendly PGCC_ compiler. v0.5.2 ------ .. rst-class:: spacious * Fix a regression (since ``v0.5.1``) in finding ``libc`` on musl Linux. This regression is reproducible only if gcc is not installed. v0.5.1 ------ .. rst-class:: spacious * Fix compatibility with newer Python versions on MSYS2 which, for some reason, have started setting :data:`sys.platform` to ``cygwin`` instead of ``msys``. * Redesign the :ref:`stdlib library selection` giving it a generic default implementation which simply assumes POSIX compliance. Untested POSIXs or Linux distributions using alternative implementations of libc should work out the box provided that they follow the POSIX standard and :func:`ctypes.util.find_library` works on said platform. All the officially supported platforms should be unaffected. v0.5.0 ------ .. rst-class:: spacious * Add a ``MACOS_ARCHITECTURE`` environment variable to allow cross-building for macOS's new ARM chips. See :ref:`Architectures for macOS`. * Fix compatibility with clang on Windows. Clang/Windows, installed via WinLibs_, is now a supported and routinely tested combination. v0.4.1 ------ .. rst-class:: spacious * Fix :func:`~cslug.cc_version` when version to parse has additional suffixes. v0.4.0 ------ .. rst-class:: spacious * Force ``setup.py bdist_wheel`` to run ``clean --all``. Doing so blocks setuptools from dumping files for the wrong platform from the build cache folder into a wheel without any check to see if it is required. See :class:`cslug.building.bdist_wheel` for details. * Support Android running Termux_. * .. rst-class:: in-red Drop the :c:`mblen()` function from :mod:`cslug.stdlib` due to its unavailability on Android. * Support Cygwin Python and Cygwin native |gcc|. Formerly, |cslug| supported a Cygwin environment but only using a regular MSVC build of Python and |gcc| cross compile headers for building generic Windows applications. .. _Termux: https://termux.com/ v0.3.0 ------ .. rst-class:: spacious * Clang is now adopted automatically on macOS and FreeBSD if gcc unavailable. Preference for either compiler can still be overridden using the ``CC`` environment variable. * Custom compiler options may now be provided either with the new **flags** option to :class:`cslug.CSlug` or with the ``CC_FLAGS`` environment variable. See :ref:`Add compiler flags`. * Control of the minimum support macOS version has moved from the previously undocumented ``MIN_OSX`` environment variable to the more standard (albeit wordier) ``MACOS_DEPLOYMENT_TARGET`` environment variable. See :ref:`Minimum OSX version`. The default value for this variable has changed from 10.5 to 10.6 to match that of minimum supported Python (currently Python 3.6). * Compile with ``-O3`` instead of ``-Ofast``. The latter breaks handling of ``NaN`` and ``INF`` amongst other things. ``-Ofast`` may be re-enabled through :ref:`custom compiler flags ` if desired. * Only specify architecture to compiler (using ``-m32``) if Python is 32bit. This fixes compatibility with ``aarch64``/``arm64``, ``ppc64le`` and ``s390x`` architectures which are now considered supported and part of routine testing using the `manylinux wacky-architecture `_ docker images. * Fix compatibility with `Alpine Linux `_. Cross-distribution compiling for or from Alpine is not possible but compiling on Alpine for Alpine is now officially supported and routinely tested with the `Python Alpine `_ docker images. v0.2.0 ------ .. rst-class:: spacious * Compile with ``-Ofast`` on clang. * Prevent ``.h`` files being passed to compiler. TinyCC and certain versions of clang raise an error if passed a header file directly. v0.1.2 ------ .. rst-class:: spacious * Default unrecognised C types to void pointer. Formally the default was :c:`int` for arguments, none for return types and structure fields broke. v0.1.1 ------ .. rst-class:: spacious * Fix docstring type annotations to use ``or`` instead of ``Union[...]``. * Add C type :c:`ptrdiff_t` as an alias for :c:`ssize_t`. v0.1.0 ------ .. rst-class:: spacious * Initial release on PyPI.