Nuitka Release 1.1
This is to inform you about the new stable release of Nuitka. It is the extremely compatible Python compiler, “download now”.
This release contains a large amount of new compatibility features, while consolidating what we have. Scalability should be better in some cases.
Bug Fixes
Standalone: Enhanced dependency scan of dependent DLLs to forward the containing package, so it can be searched in as well. This fixed at least PySide on macOS. Fixed in 1.0.1 already.
macOS: Enhanced dependency detection to use normalized paths and therefore to be more stable. Fixed in 1.0.1 already.
Standalone: Added support for the
networkxpackage which uses new support for a function decorator trying to copy function default values. Fixed in 1.0.1 already.Standalone: Include data files for
pandas.io.formatpackage. This one has Jinja2 template files that will be needed when using this package.Python3.10: Fix, could crash in case a class was not giving
matcharguments, but the user did attempt to match them. This happened e.g. withrangeobjects. Fixed in 1.0.2 already.Standalone: Added data files needed for
pyenchantpackage. Fixed in 1.0.2 already.Python3.10: Fix, matching sequence with
asassignments in them didn’t check for sub-pattern given. Fixed in 1.0.2 already.Standalone: Fix, do not attempt to list non-existent
PATHentries on Windows, these can crash the dependency detection otherwise. Fixed in 1.0.2 already.Standalone: Fix, on newer Linux,
linux-vdso.so.1appears in output oflddin a way that suggests it may exist, which of course it does not, this is a kernel virtual DLL. Fixed in 1.0.3 already.Fix, comparison expressions could give wrong results as a regression of the new release. Fixed in 1.0.3 already.
Fix, on older Python (before 3.6), it could crash on data files defined in the Yaml config. Fixed in 1.0.4 already.
Fix, binary operations could give wrong results as a regression of the new release. Fixed in 1.0.4 already.
Standalone: Added support for
pyzbarpackage. Fixed in 1.0.5 already.Standalone: Fix, empty directory structures were not working anymore due to a regression in the last release. Fixed in 1.0.5 already.
Windows: Fix, detected Pythons from Windows registry may of course fail to execute, because they were e.g. manually deleted. This would show e.g. in onefile compression. Fixed in 1.0.5 already.
Onefile: Fix, using a too old
zstandardwithout finding another Python with a suitable one, lead to run time unpacking errors. Fixed in 1.0.6 already.Fix, the inline copy of Jinja2 imported
loggingfor no good reason, which lead to errors for users who have a module of the same name, that it was then using instead. Fixed in 1.0.6 already.Fix, disable LTO mode for Anaconda Python, it is known to not work. Fixed in 1.0.6 already.
Linux: Fix, no need to insist on icon path for onefile anymore. Fixed in 1.0.6 already.
Standalone: Fix, the new version
certifiwas not working on Windows and 3.10 anymore. Fixed in 1.0.7 already.Standalone: Added support for more
rapidfuzzimplicit dependencies. Fixed in 1.0.8 already.Standalone: Added support for
vibora. Fixed in 1.0.8 already.Fix, must not expose module name objects to Python import hooks. Fixed in 1.0.8 already.
Fix, calls to bound methods of string values generated incorrect calls. Fixed in 1.0.8 already.
Fix, do not crash in version detection on
gccerror exit querying of its version.Standalone: Added back support for older versions of the
pyzmqpackage.Standalone: Ignore
PATHelements that fail to be listed as a directory. It appears e.g. on Windows, folders can exist, despite being unusable in fact. These can then cause errors in DLL dependency scan. Also avoid havingPATHset when executing dependency walker, it appears to use it even if not asked to.Standalone: Added support for
tzlocalpackage.Python3.10: Fix,
complexliterals were not working for mappings inmatchstatements.Fix,
boolbuilt-in expressions were not properly annotating exception raises, where the value cannot raise on truth check.Standalone: Added support for the
agschedulerpackage. Plugins must be done manually still with explicit--include-modulecalls.Standalone: Added support for using
shapelyin Anaconda as well.Debian: Fix, versioned dependency for
libzstdshould also be in package, this should restore Nuitka package builds for Debian Jessie.Standalone: Added support for
vtkpackage.Windows: Fix, avoid using
pywin32in our appdirs usage, it might be a broken installation and is optional toappdirsanyway, which then will fallback to usingctypesto make the lookups.Standalone: Added support for more
pandasversions.Standalone: Adding support for
mklimplicit DLL usage in Anaconda.Standalone: Added support for
jsonschemawith Python 3.10.Standalone: Added support for
pyfigletfonts data files.Scons: Avoid gcc linker command line length limits for module mode too.
Standalone: Added data file of
distributed.config.Standalone: Add support for
cv2GUI on Linux, the Qt platform plugin is now included.Fix, the anti-bloat configuration for
numpy.testingtools exposed an incompletesuppress_warningsreplacement that could lead to errors in some functions ofnumpy.Standalone: Fix DLL dependency caching on Windows, need to consider DLL content of course too.
Standalone: Added missing dependency for
torchvision.Standalone: Added support for
torchvisionon Anaconda as well.Standalone: Added support for
panda3d.Windows: Fix, need to make sure to use UTF-8 encoding for define values like company name. Otherwise the local system encoding is used, but the C compiler expects UTF-8 in wide literals. This may crash of give wrong results.
Standalone: Added
facenet_torchdata files.Anaconda: Include
libstdc++.soon Linux or else e.g.cv2will not work with system library.Windows: Fix, can have file version without a company name.
New Features
Python3.10: Added support for assignments in
matchalternatives|syntax.Compatibility: Register Nuitka meta path based loader with
pkg_resourcessuch that checking resource presence withhas_resourceworks too. This should also add support for usingjinja2.PackageLoader, previously onlyjinja2.FileSystemLoaderworked. Fixed in 1.0.1 already.Compatibility: Make function
__defaults__attribute size changeable. For a long time, this was a relatively big issue for some packages, but now this is supported as well.Compatibility: Added support for
importlib.metadata.distributionandimportlib_metadata.distributionfunctions as wellimportlib.metadata.metadataandimportlib_metadata.metadatafunctions.Onefile: Added support for including other binaries than the main executable in the payload. So far on non-Windows, we only made the main binary executable, hard coded, and nothing else. But Some things, e.g. Qt web engine, do require binaries to be used, and these no longer have the issue of missing x-bit on macOS and Linux now.
Standalone: Resolve executable path when called through symbolic link, which makes file resolutions work properly for it, for this type of installing it in
%PATH%.Python3.9+: Added support for
importlib.resources.fileswith compiled modules.It returns traversable objects, which can be used to opens files, checks them, etc. and this e.g. allows
jsonschemato work with Python 3.10, despite bugs in CPython’s compatibility layer.UI: Added interface method to specify filename patterns with package data inclusion option, making
--include-package-datausable in many more cases, picking the only files or file types you want. You can now use--include-package-data=package_name=*.txtand select only a subset of package data files in this way. Before this, it included everything and--noinclude-data-fileswould have to be used.macOS: Make
runtimesigning an experimental option.Consistently allow
whenconditions for all package configuration elements, e.g. also DLLs.Plugins: Added method to overload to work on standalone binary specifically. This makes it easier to only modify that specific binary.
Plugins: Added support for regular expressions in anti-bloat replacements, with new
replacements_recode.
Optimization
Add support for
os.pathhard module imports along with specialized nodes for file testsos.path.exists,os.path.isfile, andos.path.isdiraiming at tracking used files, producing warnings about missing files in the future.Standalone: Do not include
concurrentstandard library package automatically. This avoids the inclusion ofmultiprocessingwhich we essentially had reverted during last release cycle.Standalone: Do not include
zoneinfostandard library package automatically. It has many data files and is often not used (yet).Standalone: Do not include
asynciostandard library package automatically anymore.Avoid compilation of large generated codes in the
asyncuapackage.Compile time optimize
pkg_resources.iter_entry_pointstoo, such that these can be used to resolve plugin modules, which helps with adding support foragschedulerpackage plugins. Note that these still need to be manually included with--include-modulebut now that works.For known truth values of the right hand side of
andororconditions, reduce the expression as far as possible.Added dedicated assignment node for hard imports, which then are propagated in classes as well, allowing for more static optimization for code on the class level.
Added linker options to make static
--static-libpythonwork with clang on Linux as well.macOS: Make sure
libpythonis loaded relative to the executable. This is needed for at least Anaconda Python.macOS: Fix, need to search environment specific DLL paths and only then global paths, otherwise mixed Python versions will not work correctly.
Anti-Bloat: Remove IPython usage in
richpackage.Anti-Bloat: Avoid
doctestdependency when usingpyrect.Anti-Bloat: Some
unittestremovals frompytorchusing libraries.Keep the Scons report items sorted, or else it varies for the hashing of dependencies with Python versions before 3.6, causing cache misses without need.
Organisational
UI: Output the
.cmdfile created (if any) on Windows, e.g. when run in a virtualenv or for uninstalled Python versions, it will otherwise not run in accelerated mode, but previously the output suggested to run the executable directly.UI: Enhanced command line option description of
--include-plugin-directorywhich is frequently misunderstood. That option barely does what people want it to do. Point them to using the other options that are easy to use and will work.UI: Specified needed Python version for use in
--python-for-sconsso users can know ahead of time what versions are suitable.Reports: Added information about data files including, optimization times per module, active plugins.
Debugging: Repaired offline DLL dependency listing tool, such that it can be used during Windows DLL analysis.
Make
--xmlaccept a filename for the node tree dump, and change it so it can be executed in addition to actual compilation. This way we need not be super-robust about keeping stdout clean, to not break XML parsing.Plugins: Avoid useless warning about PySide2 plugin usage if another Qt plugin is actually selected.
UI: Catch error of directories being used as data files where plain files are expected and point out that other options must be used.
User Manual: Added section about accessing files in standalone mode too, so people can make sure it works properly.
Onefile: Using
%TEMP%folder should not by itself prevent cached onefile mode, only really variable paths should. People may want to have this as some kind of temporary cache still.UI: Catch user error of using elements, that resolve to absolute values in the middle of path specs, so using e.g.
something/%PROGRAM%is now a mistake caught at compile time. These values can only be at the start of spec values naturally.Quality: Updated to newer version of
rstfmt.UI: Nicer error message when a forbidden import is requested as an implicit import by a plugin.
Python3.11: Adapted to allocator and exception state changes, but more will be needed to compile at all.
Visual Code: Find
clang-formatfrom the recommended C++ extension of Visual Code, which makes it finally available on macOS easily too.UI: Quote command line argument values as necessary when stating them in the logging. Otherwise they are not directly usable on the shell and also less readable.
Debian: Do not list fake modules as used debian packages codes, which could e.g. happen with the pre-load code of
pkg_resourcesif that is from a Debian package. Fake packages should not be mentioned for these lists though.Nuitka-Python: Added support to set link time flags coming from statically included packages.
For our
isorttrick of splitting files in two parts (mostly to setup import paths fornuitkapackage), make sure the second parts starts with a new line.Added more usable form
--output-filenameto specify the output filename, the short form has become barely usable after we switched to enforcing no space separation for command line arguments.UI: Check if output filename’s directory exists ahead of time, and error exit if not, otherwise compilation crashed only in the very end, trying to create the final result.
UI: When exiting with no error code, do not use red color or
FATALerror annotation, that is not justified.Quality: Make sure the Yaml auto-format does not change effective contents.
Quality: Added ability to limit autoformat by file type, which can be handy when e.g. only the yaml files should be scanned.
UI: Removed
--windows-onefile-tempdir-specalias of--onefile-tempdir-specoption, it is no longer Windows specific.
Cleanups
Prefer single quotes rather than double quotes in our package configuration Yaml files, otherwise esp. regular expressions with escapes become very confusing.
Move import hacks to general mechanism in Yaml package configuration files. This is for extra paths from package names or from directory paths relative to the package. This removes special purpose code from core code paths and allows their re-use.
Again more spelling cleanups have been done, to make the code cleaner to read and search.
Unified how plugins treat iteration over their value list, and how the
whencondition is applied for the various kinds of sections.Output compilation command that failed during coverage taking, which makes it unnecessary to attempt to reconstruct what happened from test modes.
Tests
Added coverage for comparisons that need argument swaps.
Allow more time in onefile keyboard signal test, otherwise it can be a race on slow machines, e.g. emulated machines.
Tests: Added support for running a local web server.
Summary
This release is mainly a consolidation of previous release. Optimization added in previous release did in fact introduce regressions, that needed to be addressed and were cause for relatively many hotfixes.
The Yaml nuitka package configuration feature is getting ever more powerful, but is not one bit more documented, such that the community as a whole is not yet capable of adding missing dependencies, data files, DLLs, and even anti-bloat patches.
New optimization was focused around compatibility with very few exceptions, where the non-automatic standard library work is standing out, and allows for smaller binaries in many cases.
Scalability has seen improvements through a few optimization, but mainly again with anti-bloat work being done. This is owed to the fact that consolidation was the name of the game.
For Anaconda specifically, a lot more software is covered, and
generally, cv2 and torch related tools are now working better,
but it seems DLL handling will remain problematic in many instances.
The compilation report contains much more information and is getting there is terms of completeness. At some point, we should ask for it in bug reports.