Upcoming Release 2.6

In this document, we track the per-version changes and comments for the upcoming Nuitka 2.6 as a draft about hot-fixes of the current stable release as 2.5.1 as well.

Nuitka Release 2.5 (Draft)

Note

This a draft of the release notes for 2.5, which is supposed to add Nuitka standalone backend support and enhanced 3.12 performance and scalability in general.

The main focus shall be scalability and a few open issues for performance enhancements that later Python versions enable us to.

This release in not complete yet.

Bug Fixes

  • Windows: The onefile handling of sys.argv was seriously regressed for program and command line paths with spaces. Fixed in 2.4.4 already.

  • Windows: Fix, console output handles were opened with close file handles, but that is not allowed. Fixed in 2.4.2 already.

  • Standalone: Fix, using trailing slashes to mark the target directory for data files no longer worked on Windows. Fixed in 2.4.2 already.

  • Fix, the .pyi parser could fail for relative imports. This could break some packages that are extension modules, but with source code available too. Fixed in 2.4.3 already.

  • Modules: Fix, extension modules didn’t load into packages with Python3.12. Fixed in 2.4.4 already.

  • Windows: Fix, command line handling for onefile mode on was not fully compatible with quoting. Fixed in 2.4.4 already.

  • Fix, accept non-normalized paths on the command line for data directories. Fixed in 2.4.5 already.

  • Python3.11: Fix, inspect module functions could raise StopIteration looking at compiled functions on the stack. Fixed in 2.4.5 already.

  • Fix, cannot trust that importlib_metadata always works, it some situations it’s actually broken and that could crash the compilation then. Fixed in 2.4.5 already.

  • Plugins: Fix, no_asserts yaml configuration was crashing the compilation. Fixed in 2.4.6 already.

  • Scons: Fix, need to read ccache log files error tolerant. Otherwise on Windows it can crash for non-ASCII module names or paths. Fixed in 2.4.11 already.

  • Scons: Fix, specifying the C standard should not be done towards C++ compilers. For splash screen on Windows we use C++ and the Clang rejects this option there. Fixed in 2.4.8 already.

  • macOS: Handle one more oddity with self-dependencies. Can apparently switch freely between .so and .dylib for self-dependencies. Fixed in 2.4.8 already.

Fix, leaked a reference to the object compiled methods are associated to when deepcopy is used on them. Fixed in 2.4.9 already.

  • MSYS2: Fix, need to consider bin directory not as system DLL folder for DLL inclusion. Fixed in 2.4.9 already.

  • Python3.10+: Fix, failed match of class with args could crash. Fixed in 2.4.9 already.

  • MSYS2: Workaround for not normalized / from os.path.normpath on this Python flavor. Fixed in 2.4.11 already.

  • Fix, with 3.12.7 our constant code was triggering assertions. Fixed in 2.4.10 already.

  • Fix, the --include-package didn’t include extension modules that are sub-modules of the package, but only Python modules. Fixed in 2.4.11 already.

  • Windows: Fix, avoid encoding issues for CMD files used for accelerated mode on Windows.

  • Standalone: Fix, scan of standard library should not assume files presence. Files that make no sense could also be manually deleted already by the user or by a Python distribution.

Compatibility: Fix, nuitka resource readers need more attributes for file objects. Added suffix, suffixes, and stem attributes.

Package Support

  • Standalone: Improved arcade configuration. Added in 2.4.3 already.

  • Standalone: Add data file for license-expression. package Added in 2.4.6 already.

  • Standalone: Added missing implicit dependency for pydantic needed for deprecated decorators to work. Fixed in 2.4.5 already.

  • Standalone: Added missing implicit dependency for spacy package. Added in 2.4.7 already.

  • Standalone: Added support for newer trio package. Added in 2.4.8 already.

  • Standalone: Added support for newer tensorflow package. Added in 2.4.8 already.

  • Standalone: Added support for pygame-ce. Added in 2.4.8 already.

  • Standalone: Added support for newer toga on Windows. Added in 2.4.9 already.

  • Fix, workaround django debug wanting to extract column numbers of compiled frames. Added in 2.4.9 already.

  • Standalone: Allow more potentially unusable plugins for PySide6 to be recognized on macOS. Added in 2.4.9 already.

  • Standalone: Added missing dependency of polars package. Added in 2.4.9 already.

  • Standalone: Enhanced handling of absence of django settings module parameter. Added in 2.4.9 already.

  • Standalone: Added missing implicit dependency of win32ctypes modules on Windows. Added in 2.4.9 already.

  • Standalone: Added missing data file for arcade packaged. Added in 2.4.9 already.

  • Standalone: Allow PySide6 extras to not be installed on macOS, was complaining about missing DLLs, which of course can be normal in that case. Added in 2.4.11 already.

  • Standalone: Added driverless-selenium support. Added in 2.4.11 already.

  • Standalone: Added support for newer tkinterdnd2. Added in 2.4.11 already.

  • Standalone: Added support for newer kivymd. Added in 2.4.11 already.

  • Standalone: Added support for gssapi. Added in 2.4.11 already.

New Features

  • Plugins: Change data files configuration over to list of items as well, which allows to use when conditions. Done in 2.4.6 already.

  • Onefile: Splash screen no longe requires MSVC, but works with MinGW64, Clang, and ClangCL too. Done for 2.4.8 already.

  • Reports: Add file system encoding of compiling Python to aid in debugging encoding issues.

  • Windows: Console mode attach enhancements for forced redirects work better now, but it’s still not perfect.

Optimization

  • Enhanced exception handling

    Use exception state to abstract 3.12 or before differences. This solves a TODO about more very in-efficient C code generated that also requires many conversions of exceptions back and forth from 3 value form to normalized. The new code is also better for older Python versions.

  • Pass the exception state into unpacking functions for more efficient code. No need to fetch exceptions per use of those into the exception state, but it can directly write to there.

  • Solve TODO and have dedicated helper for unpacking length check, giving faster and more compact code.

  • Have our own variant of _PyGen_FetchStopIterationValue to avoid API calls in generator handling.

  • Generate more efficient code for raising exceptions of builtin type. Rather than calling them as a function, create them via base exception new directly which will be much quicker.

  • Faster exception creation, avoid having args and a tuple needed to hold them for empty exceptions avoiding one more allocation.

  • Removed remaining uses of PyTuple_Pack and replace with our own helpers to avoid API calls.

  • Avoid implicit exception raise nodes with delayed creation, and have direct exception making nodes instead.

  • Windows and Python3.12+: Follow CPython undoing its own inline function usage for reference count handling. Without this, LTO can make us a lot slower without due to MSVC issues.

  • Avoid API calls when creating int values in more cases. Some of our specialization code and many helpers as well as the constants blob loading codes were not avoiding these unnecessary calls, since we have faster code for a while already.

Anti-Bloat

  • Avoid including importlib_metadata for numpy package. Added in 2.4.2 already.

  • Anti-Bloat: Avoid dask usage in pandera package. Added in 2.4.5 already.

  • Anti-Bloat: Removed numba for newer shap as well. Added in 2.4.6 already.

  • Anti-Bloat: Avoid attempts to include Python2 and Python3 code both for aenum. This avoids SyntaxError warnings with that package. Added in 2.4.7 already.

  • Anti-Bloat: Enhanced handling for sympy package. Added in 2.4.7 already.

  • Anti-Bloat: Need to allow pydoc for pyqtgraph package. Added in 2.4.7 already.

  • Anti-Bloat: Avoid pytest in time_machine package. Added in 2.4.9 already.

Organizational

  • GitHub: Make clear we do not want --deployment in issue reports are made, since it prevents automatic identification of issues.

  • Plugins: Better error messages when querying information from packages at compile time.

  • Quality: Use clang-format-20 in GitHub actions.

  • Release script tests for Debian and PyPI used old runner names, not the new ones. Changed in 2.4.1 already.

  • UI: Disable locking of progress bar, as Nuitka doesn’t use threads at this time.

  • UI: Added support for recognizing terminal link support heuristically. And added a first terminal link as an experiment to be completed later.

  • Debugging: The explain reference counts could crash on strange dict values. Can mistake them be for a module, when that’s not the case.

  • Debugging: Print reference counts of tracebacks too when dumping reference counts at program end.

  • Debugging: Added assertions and traces for input/output handling.

  • Quality: Check configuration module names in Nuitka package configuration. This should catch cases where filenames are used mistakenly.

  • UI: Removed obsolete options controlling cache options, should use the general ones now.

Tests

  • Make sure to default to executing python when comparing results with compare_with_cpython rather than expecting PYTHON environment to be set.

  • Azure: Set up CI with Azure Pipelines to run the Nuitka tests against factory branch on commit.

  • Always use static libpython for construct based tests. We don’t really want to see DLL call overhead there.

  • Made many construct tests less susceptible to other unrelated optimization changes.

Cleanups

  • WASI: Make sure C function getters and setters of compiled types have the correct signature that they are being called with. Cast locally to the compiled types only, rather than in the function signature.

    Also the call entries offered now have the matching signature as used by Python C code.

  • Indentation of generated code was regressed and generating unaligned code in some cases.

  • Quality: Avoid format differences for clang-format-20, so it doesn’t matter if the new or old version is used.

  • Cleanup, enforce proper indentation of Nuitka cache files in Json format.

  • Cleanup, found remaining Python3.3 only code in frame templates and removed it.

Summary

This release is not done yet.