Nuitka v0.5.30 Release Notes

  • ๐Ÿš€ This release has improvements in all areas. Many bug fixes are accompanied with optimization changes towards value tracing.

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fix, the new setuptools runners were not used by pip breaking the use of Nuitka from PyPI.

    • ๐Ÿ›  Fix, imports of six.moves could crash the compiler for built-in names. Fixed in 0.5.29.2 already.

    • ๐Ÿ Windows: Make the nuitka-run not a symlink as these work really bad on that platform, instead make it a full copy just like we did for nuitka3-run already. Fixed in 0.5.29.2 already.

    • Python3.5: In module mode, types.coroutine was monkey patched into an endless recursion if including more than one module, e.g. for a package. Fixed in 0.5.29.3 already.

    • Python3.5: Dictionary unpackings with both star arguments and non star arguments could leak memory. Fixed in 0.5.29.3 already.

    .. code-block:: python

    c = {a : 1, **d}
    
    • ๐Ÿ›  Fix, distutils usage was not working for Python2 anymore, due to using super for what are old style classes on that version.

    • ๐Ÿ›  Fix, some method calls to C function members could leak references.

    .. code-block:: python

    class C:
       for_call = functools.partial
    
       def m():
          self.for_call() # This leaked a reference to the descriptor.
    
    • Python3.5: The bases classes should be treated as an unpacking too.

    .. code-block:: python

    class C(*D): # Allowed syntax that was not supported.
       pass
    
    • ๐Ÿ Windows: Added back batch files to run Nuitka from the command line. Fixed in 0.5.29.5 already.

    ๐Ÿ†• New Features

    • โž• Added option --include-package to force inclusion of a whole package with the submodules in a compilation result.

    • โž• Added options --include-module to force inclusion of a single module in a compilation result.

    • The `multiprocessing plug-in got adapted to Python 3.4 changes and will now also work in accelerated mode on Windows.

    • ๐Ÿ”Œ It is now possible to specify the Qt plugin directories with e.g. --enable-plugin=qt_plugins=imageformats and have only those included. This should avoid dependency creep for shared libraries.

    • ๐Ÿ”Œ Plugins can now make the decision about recursing to a module or not.

    • ๐Ÿ”Œ Plugins now can get their own options passed.

    Optimization

    • The re-raising of exceptions has gotten its own special node type. This aims at more readability (XML output) and avoiding the overhead of checking potential attributes during optimization.

    • ๐Ÿ”„ Changed built-in int, long, and float to using a slot mechanism that also analyses the type shape and detects and warns about errors at compile time.

    • ๐Ÿ”„ Changed the variable tracing to value tracing. This meant to cleanup all the places that were using it to find the variable.

    • Enable must have / must not value value optimization for all kinds of variables including module and closure variables. This often avoids error exits and leads to smaller and faster generated code.

    โœ… Tests

    • โž• Added burn test with local install of pip distribution to virtualenv before making any PyPI upload. It seems pip got its specific error sources too.

    • Avoid calling 2to3 and prefer <python> -m lib2to3 instead, as it seems at least Debian Testing stopped to provide the binary by default. For Python 2.6 and 3.2 we continue to rely on it, as the don't support that mode of operation.

    • ๐Ÿ‘• The PyLint checks have been made more robust and even more Python3 portable.

    • โž• Added PyLint to Travis builds, so PRs are automatically checked too.

    • โž• Added test for distutils usage with Nuitka that should prevent regressions for this new feature and to document how it can be used.

    • ๐Ÿ Make coverage taking work on Windows and provide the full information needed, the rendering stage is not there working yet though.

    • โœ… Expanded the trick assignment test cases to cover more slots to find bugs introduced with more aggressive optimization of closure variables.

    • ๐Ÿ†• New test to cover multiprocessing usage.

    • โœ… Generating more code tests out of doctests for increased coverage of Nuitka.

    Cleanups

    • โœ… Stop using --python-version in tests where they still remained.

    • Split the forms of int and long into two different nodes, they share nothing except the name. Create the constants for the zero arg variant more immediately.

    • โœ… Split the output comparison part into a dedicated testing module so it can be re-used, e.g. when doing distutils tests.

    • โœ‚ Removed dead code from variable closure taking.

    • Have a dedicated module for the metaclass of nodes in the tree, so it is easier to find, and doesn't clutter the node base classes module as much.

    • Have a dedicated node for reraise statements instead of checking for all the arguments to be non-present.

    Organizational

    • There is now a pull request template for Github when used.

    • ๐Ÿ—„ Deprecating the --python-version argument which should be replaced by using -m nuitka with the correct Python version. Outputs have been updated to recommend this one instead.

    • ๐Ÿ‘‰ Make automatic import sorting and autoformat tools properly executable on Windows without them changing new lines.

    • ๐Ÿ“š The documentation was updated to prefer the call method with -m nuitka and manually providing the Python binary to use.

    Summary

    ๐Ÿš€ This release continued the distutils integration adding first tests, but more ๐Ÿ”‹ features and documentation will be needed.

    Also, for the locals dictionary work, the variable tracing was made generic, but not yet put to use. If we use this to also trace dictionary keys, we can expect a lot of improvements for class code again.

    The locals dictionary tracing will be the focus before resuming the work on ๐ŸŽ C types, where the ultimate performance boost lies. However, currently, not the full compatibility has been achieved even with currently using dictionaries โšก๏ธ for classes, and we would like to be able to statically optimize those better anyway.