Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.5__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.5.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +30 -2
- nuitka/MainControl.py +62 -35
- nuitka/ModuleRegistry.py +11 -3
- nuitka/OptionParsing.py +78 -39
- nuitka/Options.py +142 -35
- nuitka/OutputDirectories.py +5 -0
- nuitka/PostProcessing.py +23 -14
- nuitka/Progress.py +2 -1
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +1 -0
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/__past__.py +5 -0
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +2 -1
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +4 -1
- nuitka/build/include/nuitka/allocator.h +27 -5
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +23 -23
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +0 -2
- nuitka/build/include/nuitka/helper/attributes.h +7 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helpers.h +10 -3
- nuitka/build/include/nuitka/prelude.h +6 -15
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +11 -5
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
- nuitka/build/static_src/CompiledCellType.c +7 -7
- nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
- nuitka/build/static_src/CompiledCoroutineType.c +2 -4
- nuitka/build/static_src/CompiledFrameType.c +109 -82
- nuitka/build/static_src/CompiledFunctionType.c +36 -9
- nuitka/build/static_src/CompiledGeneratorType.c +12 -10
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
- nuitka/build/static_src/CompiledMethodType.c +14 -13
- nuitka/build/static_src/HelpersAttributes.c +13 -15
- nuitka/build/static_src/HelpersBuiltin.c +16 -7
- nuitka/build/static_src/HelpersCalling.c +13 -13
- nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
- nuitka/build/static_src/HelpersComparisonEq.c +110 -110
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +110 -110
- nuitka/build/static_src/HelpersComparisonGt.c +110 -110
- nuitka/build/static_src/HelpersComparisonLe.c +110 -110
- nuitka/build/static_src/HelpersComparisonLt.c +110 -110
- nuitka/build/static_src/HelpersComparisonNe.c +110 -110
- nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
- nuitka/build/static_src/HelpersDictionaries.c +9 -0
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersLists.c +5 -1
- nuitka/build/static_src/HelpersMatching.c +95 -35
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
- nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +8 -4
- nuitka/build/static_src/InspectPatcher.c +14 -2
- nuitka/build/static_src/MainProgram.c +20 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +163 -140
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/OnefileBootstrap.c +100 -6
- nuitka/code_generation/AttributeCodes.py +12 -10
- nuitka/code_generation/CodeGeneration.py +6 -7
- nuitka/code_generation/ConstantCodes.py +53 -10
- nuitka/code_generation/Emission.py +1 -1
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +4 -5
- nuitka/code_generation/LoaderCodes.py +3 -0
- nuitka/code_generation/LocalsDictCodes.py +36 -14
- nuitka/code_generation/MatchCodes.py +23 -4
- nuitka/code_generation/ModuleCodes.py +1 -8
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +22 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +27 -9
- nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
- nuitka/freezer/DependsExe.py +3 -1
- nuitka/freezer/DllDependenciesMacOS.py +5 -12
- nuitka/freezer/IncludedDataFiles.py +15 -4
- nuitka/freezer/IncludedEntryPoints.py +8 -2
- nuitka/freezer/Onefile.py +6 -1
- nuitka/freezer/Standalone.py +9 -2
- nuitka/importing/Importing.py +14 -5
- nuitka/importing/Recursion.py +3 -0
- nuitka/nodes/AttributeNodesGenerated.py +21 -12
- nuitka/nodes/BuiltinOpenNodes.py +5 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
- nuitka/nodes/BuiltinRefNodes.py +41 -1
- nuitka/nodes/ChildrenHavingMixins.py +143 -355
- nuitka/nodes/ClassNodes.py +30 -12
- nuitka/nodes/CodeObjectSpecs.py +9 -0
- nuitka/nodes/ExpressionBasesGenerated.py +11 -11
- nuitka/nodes/FunctionNodes.py +7 -11
- nuitka/nodes/FutureSpecs.py +16 -3
- nuitka/nodes/GeneratorNodes.py +2 -2
- nuitka/nodes/HardImportNodesGenerated.py +11 -134
- nuitka/nodes/LocalsScopes.py +19 -23
- nuitka/nodes/MatchNodes.py +18 -7
- nuitka/nodes/ModuleAttributeNodes.py +1 -20
- nuitka/nodes/ModuleNodes.py +23 -6
- nuitka/nodes/NodeBases.py +3 -2
- nuitka/nodes/NodeMetaClasses.py +26 -10
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +11 -11
- nuitka/nodes/SubscriptNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +28 -2
- nuitka/optimizations/FunctionInlining.py +3 -6
- nuitka/optimizations/Optimization.py +13 -12
- nuitka/optimizations/TraceCollections.py +19 -4
- nuitka/plugins/PluginBase.py +121 -133
- nuitka/plugins/Plugins.py +92 -4
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
- nuitka/plugins/standard/DataFilesPlugin.py +15 -6
- nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
- nuitka/plugins/standard/DllFilesPlugin.py +5 -3
- nuitka/plugins/standard/ImplicitImports.py +34 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
- nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +489 -182
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
- nuitka/reports/Reports.py +53 -5
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +0 -6
- nuitka/tools/data_composer/DataComposer.py +29 -27
- nuitka/tools/environments/CreateEnvironment.py +1 -0
- nuitka/tools/environments/Virtualenv.py +25 -11
- nuitka/tools/general/find_module/FindModuleCode.py +13 -3
- nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
- nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
- nuitka/tools/specialize/CTypeDescriptions.py +13 -7
- nuitka/tools/specialize/SpecializePython.py +18 -1
- nuitka/tools/testing/Common.py +19 -6
- nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
- nuitka/tools/watch/AutoStage.py +144 -0
- nuitka/tools/watch/__main__.py +79 -32
- nuitka/tree/Building.py +105 -104
- nuitka/tree/ComplexCallHelperFunctions.py +16 -26
- nuitka/tree/InternalModule.py +8 -0
- nuitka/tree/ReformulationAssignmentStatements.py +29 -59
- nuitka/tree/ReformulationClasses.py +10 -17
- nuitka/tree/ReformulationClasses3.py +69 -43
- nuitka/tree/ReformulationComparisonExpressions.py +6 -16
- nuitka/tree/ReformulationContractionExpressions.py +14 -23
- nuitka/tree/ReformulationDictionaryCreation.py +6 -10
- nuitka/tree/ReformulationExecStatements.py +10 -10
- nuitka/tree/ReformulationForLoopStatements.py +6 -12
- nuitka/tree/ReformulationFunctionStatements.py +21 -28
- nuitka/tree/ReformulationImportStatements.py +8 -10
- nuitka/tree/ReformulationLambdaExpressions.py +3 -6
- nuitka/tree/ReformulationMatchStatements.py +166 -60
- nuitka/tree/ReformulationMultidist.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +1 -1
- nuitka/tree/ReformulationPrintStatements.py +3 -6
- nuitka/tree/ReformulationSequenceCreation.py +13 -26
- nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
- nuitka/tree/ReformulationWithStatements.py +12 -16
- nuitka/tree/SourceHandling.py +13 -8
- nuitka/tree/VariableClosure.py +5 -21
- nuitka/utils/Distributions.py +80 -11
- nuitka/utils/Download.py +38 -31
- nuitka/utils/Execution.py +13 -2
- nuitka/utils/FileOperations.py +55 -28
- nuitka/utils/Images.py +6 -1
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/ModuleNames.py +11 -5
- nuitka/utils/ReExecute.py +17 -13
- nuitka/utils/SharedLibraries.py +32 -8
- nuitka/utils/Signing.py +3 -1
- nuitka/utils/StaticLibraries.py +51 -41
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +29 -7
- /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.5.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/top_level.txt +0 -0
nuitka/Options.py
CHANGED
|
@@ -43,14 +43,17 @@ from nuitka.PythonFlavors import (
|
|
|
43
43
|
isUninstalledPython,
|
|
44
44
|
)
|
|
45
45
|
from nuitka.PythonVersions import (
|
|
46
|
+
getLaunchingSystemPrefixPath,
|
|
46
47
|
getNotYetSupportedPythonVersions,
|
|
47
48
|
getSupportedPythonVersions,
|
|
48
49
|
isDebugPython,
|
|
50
|
+
isPythonWithGil,
|
|
49
51
|
python_version,
|
|
50
52
|
python_version_str,
|
|
51
53
|
)
|
|
52
54
|
from nuitka.utils.Execution import getExecutablePath
|
|
53
55
|
from nuitka.utils.FileOperations import (
|
|
56
|
+
isLegalPath,
|
|
54
57
|
isPathExecutable,
|
|
55
58
|
openTextFile,
|
|
56
59
|
resolveShellPatternToFilenames,
|
|
@@ -60,6 +63,7 @@ from nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath
|
|
|
60
63
|
from nuitka.utils.Utils import (
|
|
61
64
|
getArchitecture,
|
|
62
65
|
getCPUCoreCount,
|
|
66
|
+
getLaunchingNuitkaProcessEnvironmentValue,
|
|
63
67
|
getLinuxDistribution,
|
|
64
68
|
getMacOSRelease,
|
|
65
69
|
getOS,
|
|
@@ -116,6 +120,9 @@ def checkPathSpec(value, arg_name, allow_disable):
|
|
|
116
120
|
% (arg_name, old, value)
|
|
117
121
|
)
|
|
118
122
|
|
|
123
|
+
# This changes the '/' to '\' on Windows at least.
|
|
124
|
+
value = os.path.normpath(value)
|
|
125
|
+
|
|
119
126
|
if "\n" in value or "\r" in value:
|
|
120
127
|
Tracing.options_logger.sysexit(
|
|
121
128
|
"Using a new line in value '%s=%r' value is not allowed."
|
|
@@ -221,6 +228,22 @@ start of '%s=%s', using that alone is not allowed."""
|
|
|
221
228
|
% (candidate, arg_name, value)
|
|
222
229
|
)
|
|
223
230
|
|
|
231
|
+
if value.startswith(candidate):
|
|
232
|
+
if value[len(candidate)] != os.path.sep:
|
|
233
|
+
Tracing.options_logger.sysexit(
|
|
234
|
+
"""Cannot use general system folder %s, without a path \
|
|
235
|
+
separator '%s=%s', just appending to these is not allowed, needs to be \
|
|
236
|
+
below them."""
|
|
237
|
+
% (candidate, arg_name, value)
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
is_legal, reason = isLegalPath(value)
|
|
241
|
+
if not is_legal:
|
|
242
|
+
Tracing.options_logger.sysexit(
|
|
243
|
+
"""Cannot use illegal paths '%s=%s', due to %s."""
|
|
244
|
+
% (arg_name, value, reason)
|
|
245
|
+
)
|
|
246
|
+
|
|
224
247
|
return value
|
|
225
248
|
|
|
226
249
|
|
|
@@ -273,6 +296,8 @@ def _getVersionInformationValues():
|
|
|
273
296
|
yield "Commercial: %s" % getCommercialVersion()
|
|
274
297
|
yield "Python: %s" % sys.version.split("\n", 1)[0]
|
|
275
298
|
yield "Flavor: %s" % getPythonFlavorName()
|
|
299
|
+
if python_version >= 0x3D0:
|
|
300
|
+
yield "GIL: %s" % ("yes" if isPythonWithGil() else "no")
|
|
276
301
|
yield "Executable: %s" % sys.executable
|
|
277
302
|
yield "OS: %s" % getOS()
|
|
278
303
|
yield "Arch: %s" % getArchitecture()
|
|
@@ -414,11 +439,17 @@ Error, the Python from Windows app store is not supported.""",
|
|
|
414
439
|
% " ".join(_quoteArg(arg) for arg in sys.argv[1:])
|
|
415
440
|
)
|
|
416
441
|
|
|
417
|
-
if
|
|
442
|
+
if (
|
|
443
|
+
getLaunchingNuitkaProcessEnvironmentValue("NUITKA_RE_EXECUTION")
|
|
444
|
+
and not isAllowedToReexecute()
|
|
445
|
+
):
|
|
418
446
|
Tracing.general.sysexit(
|
|
419
447
|
"Error, not allowed to re-execute, but that has happened."
|
|
420
448
|
)
|
|
421
449
|
|
|
450
|
+
# Force to persist this one early.
|
|
451
|
+
getLaunchingSystemPrefixPath()
|
|
452
|
+
|
|
422
453
|
if options.progress_bar:
|
|
423
454
|
Progress.enableProgressBar()
|
|
424
455
|
|
|
@@ -934,6 +965,13 @@ release will add it. In the mean time use '%s' instead."""
|
|
|
934
965
|
)
|
|
935
966
|
)
|
|
936
967
|
|
|
968
|
+
if not isPythonWithGil():
|
|
969
|
+
Tracing.general.warning(
|
|
970
|
+
"""\
|
|
971
|
+
The Python without GIL is only experimentally supported by \
|
|
972
|
+
and recommended only for use in Nuitka development and testing."""
|
|
973
|
+
)
|
|
974
|
+
|
|
937
975
|
default_reference_mode = (
|
|
938
976
|
"runtime" if shallMakeModule() or isStandaloneMode() else "original"
|
|
939
977
|
)
|
|
@@ -1003,7 +1041,7 @@ release will add it. In the mean time use '%s' instead."""
|
|
|
1003
1041
|
getJobLimit()
|
|
1004
1042
|
except ValueError:
|
|
1005
1043
|
Tracing.options_logger.sysexit(
|
|
1006
|
-
"For --jobs value, use
|
|
1044
|
+
"For '--jobs' value, use integer values only, not, but not '%s'."
|
|
1007
1045
|
% options.jobs
|
|
1008
1046
|
)
|
|
1009
1047
|
|
|
@@ -1052,7 +1090,8 @@ to work. You need to instead selectively add them with \
|
|
|
1052
1090
|
)
|
|
1053
1091
|
|
|
1054
1092
|
if (
|
|
1055
|
-
not
|
|
1093
|
+
not shallCreatePythonPgoInput()
|
|
1094
|
+
and not standalone_mode
|
|
1056
1095
|
and options.follow_all is None
|
|
1057
1096
|
and not options.follow_modules
|
|
1058
1097
|
and not options.follow_stdlib
|
|
@@ -1080,7 +1119,7 @@ make sure that is intended."""
|
|
|
1080
1119
|
options.static_libpython = "no"
|
|
1081
1120
|
|
|
1082
1121
|
if (
|
|
1083
|
-
not
|
|
1122
|
+
not isCPgoMode()
|
|
1084
1123
|
and not isPythonPgoMode()
|
|
1085
1124
|
and (getPgoArgs() or getPgoExecutable())
|
|
1086
1125
|
):
|
|
@@ -1088,15 +1127,19 @@ make sure that is intended."""
|
|
|
1088
1127
|
"Providing PGO arguments without enabling PGO mode has no effect."
|
|
1089
1128
|
)
|
|
1090
1129
|
|
|
1091
|
-
if
|
|
1130
|
+
if isCPgoMode():
|
|
1092
1131
|
if isStandaloneMode():
|
|
1093
1132
|
Tracing.optimization_logger.warning(
|
|
1094
|
-
"
|
|
1133
|
+
"""\
|
|
1134
|
+
Using C level PGO with standalone/onefile mode is not \
|
|
1135
|
+
currently working. Expect errors."""
|
|
1095
1136
|
)
|
|
1096
1137
|
|
|
1097
1138
|
if shallMakeModule():
|
|
1098
1139
|
Tracing.optimization_logger.warning(
|
|
1099
|
-
"
|
|
1140
|
+
"""\
|
|
1141
|
+
Using C level PGO with module mode is not currently \
|
|
1142
|
+
working. Expect errors."""
|
|
1100
1143
|
)
|
|
1101
1144
|
|
|
1102
1145
|
if (
|
|
@@ -1300,6 +1343,9 @@ def shallFollowNoImports():
|
|
|
1300
1343
|
|
|
1301
1344
|
def shallFollowAllImports():
|
|
1302
1345
|
""":returns: bool derived from ``--follow-imports``"""
|
|
1346
|
+
if shallCreatePythonPgoInput() and options.is_standalone:
|
|
1347
|
+
return True
|
|
1348
|
+
|
|
1303
1349
|
return options.is_standalone or options.follow_all is True
|
|
1304
1350
|
|
|
1305
1351
|
|
|
@@ -1512,6 +1558,10 @@ def getMainEntryPointFilenames():
|
|
|
1512
1558
|
return tuple(os.path.normpath(r).rstrip(os.path.sep) for r in result)
|
|
1513
1559
|
|
|
1514
1560
|
|
|
1561
|
+
def isMultidistMode():
|
|
1562
|
+
return options is not None and options.mains and len(options.mains) > 1
|
|
1563
|
+
|
|
1564
|
+
|
|
1515
1565
|
def shallOptimizeStringExec():
|
|
1516
1566
|
"""Inactive yet"""
|
|
1517
1567
|
return False
|
|
@@ -1554,7 +1604,7 @@ def _shallUseStaticLibPython():
|
|
|
1554
1604
|
|
|
1555
1605
|
# For Anaconda default to trying static lib python library, which
|
|
1556
1606
|
# normally is just not available or if it is even unusable.
|
|
1557
|
-
if isAnacondaPython() and not
|
|
1607
|
+
if isAnacondaPython() and not isWin32Windows():
|
|
1558
1608
|
return (
|
|
1559
1609
|
True,
|
|
1560
1610
|
"Nuitka on Anaconda needs package for static libpython installed. Execute 'conda install libpython-static'.",
|
|
@@ -1643,22 +1693,25 @@ def isShowScons():
|
|
|
1643
1693
|
|
|
1644
1694
|
def getJobLimit():
|
|
1645
1695
|
"""*int*, value of ``--jobs`` / "-j" or number of CPU kernels"""
|
|
1646
|
-
|
|
1647
|
-
if isLowMemory():
|
|
1648
|
-
return 1
|
|
1649
|
-
else:
|
|
1650
|
-
return getCPUCoreCount()
|
|
1696
|
+
jobs = options.jobs
|
|
1651
1697
|
|
|
1652
|
-
|
|
1698
|
+
# Low memory has a default of 1.
|
|
1699
|
+
if jobs is None and isLowMemory():
|
|
1700
|
+
return 1
|
|
1701
|
+
|
|
1702
|
+
if jobs is None:
|
|
1703
|
+
result = getCPUCoreCount()
|
|
1704
|
+
else:
|
|
1705
|
+
result = int(jobs)
|
|
1653
1706
|
|
|
1654
|
-
|
|
1655
|
-
|
|
1707
|
+
if result <= 0:
|
|
1708
|
+
result = max(1, getCPUCoreCount() + jobs)
|
|
1656
1709
|
|
|
1657
1710
|
return result
|
|
1658
1711
|
|
|
1659
1712
|
|
|
1660
1713
|
def getLtoMode():
|
|
1661
|
-
""":returns: bool derived from ``--lto``
|
|
1714
|
+
""":returns: bool derived from ``--lto``"""
|
|
1662
1715
|
return options.lto
|
|
1663
1716
|
|
|
1664
1717
|
|
|
@@ -1797,6 +1850,23 @@ def getExperimentalIndications():
|
|
|
1797
1850
|
return ()
|
|
1798
1851
|
|
|
1799
1852
|
|
|
1853
|
+
def getDebugModeIndications():
|
|
1854
|
+
result = []
|
|
1855
|
+
|
|
1856
|
+
for debug_option_value_name in ("debug_immortal",):
|
|
1857
|
+
if debug_option_value_name == "debug_immortal" and python_version < 0x3C0:
|
|
1858
|
+
continue
|
|
1859
|
+
|
|
1860
|
+
if _isDebug():
|
|
1861
|
+
if getattr(options, debug_option_value_name) is not False:
|
|
1862
|
+
result.append(debug_option_value_name)
|
|
1863
|
+
else:
|
|
1864
|
+
if getattr(options, debug_option_value_name) is True:
|
|
1865
|
+
result.append(debug_option_value_name)
|
|
1866
|
+
|
|
1867
|
+
return result
|
|
1868
|
+
|
|
1869
|
+
|
|
1800
1870
|
def shallExplainImports():
|
|
1801
1871
|
""":returns: bool derived from ``--explain-imports``"""
|
|
1802
1872
|
return options is not None and options.explain_imports
|
|
@@ -1804,12 +1874,18 @@ def shallExplainImports():
|
|
|
1804
1874
|
|
|
1805
1875
|
def isStandaloneMode():
|
|
1806
1876
|
""":returns: bool derived from ``--standalone``"""
|
|
1807
|
-
|
|
1877
|
+
if shallCreatePythonPgoInput():
|
|
1878
|
+
return False
|
|
1879
|
+
|
|
1880
|
+
return bool(options.is_standalone or options.list_package_dlls)
|
|
1808
1881
|
|
|
1809
1882
|
|
|
1810
1883
|
def isOnefileMode():
|
|
1811
1884
|
""":returns: bool derived from ``--onefile``"""
|
|
1812
|
-
|
|
1885
|
+
if shallCreatePythonPgoInput():
|
|
1886
|
+
return False
|
|
1887
|
+
|
|
1888
|
+
return bool(options.is_onefile)
|
|
1813
1889
|
|
|
1814
1890
|
|
|
1815
1891
|
def isAcceleratedMode():
|
|
@@ -1824,6 +1900,9 @@ def isOnefileTempDirMode():
|
|
|
1824
1900
|
Using cached onefile execution when the spec doesn't contain
|
|
1825
1901
|
volatile things.
|
|
1826
1902
|
"""
|
|
1903
|
+
if shallCreatePythonPgoInput():
|
|
1904
|
+
return False
|
|
1905
|
+
|
|
1827
1906
|
spec = getOnefileTempDirSpec()
|
|
1828
1907
|
|
|
1829
1908
|
for candidate in (
|
|
@@ -1838,8 +1917,11 @@ def isOnefileTempDirMode():
|
|
|
1838
1917
|
return False
|
|
1839
1918
|
|
|
1840
1919
|
|
|
1841
|
-
def
|
|
1842
|
-
""":returns: bool derived from ``--pgo``"""
|
|
1920
|
+
def isCPgoMode():
|
|
1921
|
+
""":returns: bool derived from ``--pgo-c``"""
|
|
1922
|
+
if shallCreatePythonPgoInput():
|
|
1923
|
+
return False
|
|
1924
|
+
|
|
1843
1925
|
return options.is_c_pgo
|
|
1844
1926
|
|
|
1845
1927
|
|
|
@@ -1853,7 +1935,7 @@ def getPythonPgoInput():
|
|
|
1853
1935
|
return options.python_pgo_input
|
|
1854
1936
|
|
|
1855
1937
|
|
|
1856
|
-
def
|
|
1938
|
+
def shallCreatePythonPgoInput():
|
|
1857
1939
|
return isPythonPgoMode() and getPythonPgoInput() is None
|
|
1858
1940
|
|
|
1859
1941
|
|
|
@@ -1883,8 +1965,7 @@ def getOnefileTempDirSpec():
|
|
|
1883
1965
|
options.onefile_tempdir_spec or "{TEMP}" + os.path.sep + "onefile_{PID}_{TIME}"
|
|
1884
1966
|
)
|
|
1885
1967
|
|
|
1886
|
-
|
|
1887
|
-
return os.path.normpath(result)
|
|
1968
|
+
return result
|
|
1888
1969
|
|
|
1889
1970
|
|
|
1890
1971
|
def getOnefileChildGraceTime():
|
|
@@ -2073,6 +2154,16 @@ def getFileVersionTuple():
|
|
|
2073
2154
|
return _parseVersionNumber(options.file_version)
|
|
2074
2155
|
|
|
2075
2156
|
|
|
2157
|
+
def getProductFileVersion():
|
|
2158
|
+
if options.product_version:
|
|
2159
|
+
if options.file_version:
|
|
2160
|
+
return "%s-%s" % (options.product_version, options.file_version)
|
|
2161
|
+
else:
|
|
2162
|
+
return options.product_version
|
|
2163
|
+
else:
|
|
2164
|
+
return options.file_version
|
|
2165
|
+
|
|
2166
|
+
|
|
2076
2167
|
def getWindowsSplashScreen():
|
|
2077
2168
|
""":returns: bool derived from ``--onefile-windows-splash-screen-image``"""
|
|
2078
2169
|
return options.splash_screen_image
|
|
@@ -2100,6 +2191,9 @@ def getMacOSTargetArch():
|
|
|
2100
2191
|
|
|
2101
2192
|
def shallCreateAppBundle():
|
|
2102
2193
|
"""*bool* shall create an application bundle, derived from ``--macos-create-app-bundle`` value"""
|
|
2194
|
+
if shallCreatePythonPgoInput():
|
|
2195
|
+
return False
|
|
2196
|
+
|
|
2103
2197
|
return options.macos_create_bundle and isMacOS()
|
|
2104
2198
|
|
|
2105
2199
|
|
|
@@ -2370,22 +2464,18 @@ def shallUseProgressBar():
|
|
|
2370
2464
|
|
|
2371
2465
|
def getForcedStdoutPath():
|
|
2372
2466
|
"""*str* force program stdout output into that filename"""
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
if result is not None:
|
|
2376
|
-
result = os.path.normpath(result)
|
|
2467
|
+
if shallCreatePythonPgoInput():
|
|
2468
|
+
return False
|
|
2377
2469
|
|
|
2378
|
-
return
|
|
2470
|
+
return options.force_stdout_spec
|
|
2379
2471
|
|
|
2380
2472
|
|
|
2381
2473
|
def getForcedStderrPath():
|
|
2382
2474
|
"""*str* force program stderr output into that filename"""
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
if result is not None:
|
|
2386
|
-
result = os.path.normpath(result)
|
|
2475
|
+
if shallCreatePythonPgoInput():
|
|
2476
|
+
return False
|
|
2387
2477
|
|
|
2388
|
-
return
|
|
2478
|
+
return options.force_stderr_spec
|
|
2389
2479
|
|
|
2390
2480
|
|
|
2391
2481
|
def shallShowSourceModifications(module_name):
|
|
@@ -2479,6 +2569,17 @@ def shallShowExecutedCommands():
|
|
|
2479
2569
|
return isExperimental("show-commands")
|
|
2480
2570
|
|
|
2481
2571
|
|
|
2572
|
+
def getTargetPythonDescription():
|
|
2573
|
+
""":returns: tuple(python_version,OS/arch) string derived from ``--target``"""
|
|
2574
|
+
if options.target_spec is not None:
|
|
2575
|
+
# TODO: Only one we are working on right now.
|
|
2576
|
+
assert options.target_spec == "wasi"
|
|
2577
|
+
|
|
2578
|
+
return python_version, "wasi"
|
|
2579
|
+
|
|
2580
|
+
return None
|
|
2581
|
+
|
|
2582
|
+
|
|
2482
2583
|
def getFcfProtectionMode():
|
|
2483
2584
|
""":returns: string derived from ``--fcf-protection``"""
|
|
2484
2585
|
return options.cf_protection
|
|
@@ -2486,7 +2587,13 @@ def getFcfProtectionMode():
|
|
|
2486
2587
|
|
|
2487
2588
|
def getModuleParameter(module_name, parameter_name):
|
|
2488
2589
|
""":returns: string derived from ``--module-parameter``"""
|
|
2489
|
-
|
|
2590
|
+
|
|
2591
|
+
module_name_prefix = module_name.getTopLevelPackageName().asString()
|
|
2592
|
+
|
|
2593
|
+
if parameter_name.startswith(module_name_prefix + "-"):
|
|
2594
|
+
option_name = parameter_name
|
|
2595
|
+
else:
|
|
2596
|
+
option_name = module_name_prefix + "-" + parameter_name
|
|
2490
2597
|
|
|
2491
2598
|
for module_option in options.module_parameters:
|
|
2492
2599
|
module_option_name, module_option_value = module_option.split("=", 1)
|
nuitka/OutputDirectories.py
CHANGED
|
@@ -34,6 +34,11 @@ def setMainModule(main_module):
|
|
|
34
34
|
_main_module = main_module
|
|
35
35
|
|
|
36
36
|
|
|
37
|
+
def hasMainModule():
|
|
38
|
+
"""For reporting to check if there is anything to talk about."""
|
|
39
|
+
return _main_module is not None
|
|
40
|
+
|
|
41
|
+
|
|
37
42
|
def getSourceDirectoryPath(onefile=False):
|
|
38
43
|
"""Return path inside the build directory."""
|
|
39
44
|
|
nuitka/PostProcessing.py
CHANGED
|
@@ -12,12 +12,7 @@ import sys
|
|
|
12
12
|
from nuitka import Options, OutputDirectories
|
|
13
13
|
from nuitka.build.DataComposerInterface import getConstantBlobFilename
|
|
14
14
|
from nuitka.ModuleRegistry import getImportedModuleNames
|
|
15
|
-
from nuitka.PythonVersions import
|
|
16
|
-
getPythonABI,
|
|
17
|
-
getTargetPythonDLLPath,
|
|
18
|
-
python_version,
|
|
19
|
-
python_version_str,
|
|
20
|
-
)
|
|
15
|
+
from nuitka.PythonVersions import getTargetPythonDLLPath, python_version
|
|
21
16
|
from nuitka.Tracing import postprocessing_logger
|
|
22
17
|
from nuitka.utils.Execution import wrapCommandForDebuggerForExec
|
|
23
18
|
from nuitka.utils.FileOperations import (
|
|
@@ -35,6 +30,8 @@ from nuitka.utils.MacOSApp import createPlistInfoFile
|
|
|
35
30
|
from nuitka.utils.SharedLibraries import (
|
|
36
31
|
callInstallNameTool,
|
|
37
32
|
cleanupHeaderForAndroid,
|
|
33
|
+
getOtoolDependencyOutput,
|
|
34
|
+
parseOtoolListingOutput,
|
|
38
35
|
)
|
|
39
36
|
from nuitka.utils.Utils import isAndroidBasedLinux, isMacOS, isWin32Windows
|
|
40
37
|
from nuitka.utils.WindowsResources import (
|
|
@@ -317,10 +314,26 @@ def executePostProcessing():
|
|
|
317
314
|
and not Options.shallMakeModule()
|
|
318
315
|
and not Options.shallUseStaticLibPython()
|
|
319
316
|
):
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
317
|
+
for dependency in parseOtoolListingOutput(
|
|
318
|
+
getOtoolDependencyOutput(result_filename, [])
|
|
319
|
+
):
|
|
320
|
+
if os.path.basename(dependency).lower().startswith(("python", "libpython")):
|
|
321
|
+
python_dll_filename = dependency
|
|
322
|
+
break
|
|
323
|
+
else:
|
|
324
|
+
postprocessing_logger.sysexit(
|
|
325
|
+
"""
|
|
326
|
+
Error, expected 'libpython dependency not found. Please report the bug."""
|
|
327
|
+
)
|
|
328
|
+
|
|
329
|
+
python_lib_path = os.path.dirname(python_dll_filename)
|
|
330
|
+
python_dll_path = python_dll_filename
|
|
331
|
+
|
|
332
|
+
if not os.path.exists(python_lib_path):
|
|
333
|
+
python_lib_path = os.path.join(sys.prefix, "lib")
|
|
334
|
+
python_dll_path = os.path.join(
|
|
335
|
+
python_lib_path, os.path.basename(python_dll_filename)
|
|
336
|
+
)
|
|
324
337
|
|
|
325
338
|
# Note: For CPython, and potentially others, the rpath for the Python
|
|
326
339
|
# library needs to be set, so it will be detected as a dependency
|
|
@@ -332,10 +345,6 @@ def executePostProcessing():
|
|
|
332
345
|
python_dll_filename,
|
|
333
346
|
python_dll_path,
|
|
334
347
|
),
|
|
335
|
-
(
|
|
336
|
-
"@rpath/Python3.framework/Versions/%s/Python3" % python_version_str,
|
|
337
|
-
python_dll_path,
|
|
338
|
-
),
|
|
339
348
|
),
|
|
340
349
|
id_path=None,
|
|
341
350
|
rpath=python_lib_path,
|
nuitka/Progress.py
CHANGED
nuitka/PythonFlavors.py
CHANGED
|
@@ -113,6 +113,20 @@ def isHomebrewPython():
|
|
|
113
113
|
return False
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
def getHomebrewInstallPath():
|
|
117
|
+
assert isHomebrewPython()
|
|
118
|
+
|
|
119
|
+
candidate = getSystemPrefixPath()
|
|
120
|
+
|
|
121
|
+
while candidate != "/":
|
|
122
|
+
if os.path.isdir(os.path.join(candidate, "Cellar")):
|
|
123
|
+
return candidate
|
|
124
|
+
|
|
125
|
+
candidate = os.path.dirname(candidate)
|
|
126
|
+
|
|
127
|
+
sys.exit("Error, failed to locate homebrew installation path.")
|
|
128
|
+
|
|
129
|
+
|
|
116
130
|
def isRyePython():
|
|
117
131
|
if isMacOS():
|
|
118
132
|
import sysconfig
|
|
@@ -271,10 +285,14 @@ def isCPythonOfficialPackage():
|
|
|
271
285
|
sys_prefix = getSystemPrefixPath()
|
|
272
286
|
|
|
273
287
|
# For macOS however, it's very knowable.
|
|
274
|
-
if isMacOS()
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
288
|
+
if isMacOS():
|
|
289
|
+
for candidate in (
|
|
290
|
+
"/Library/Frameworks/Python.framework/Versions/",
|
|
291
|
+
"/Library/Frameworks/PythonT.framework/Versions/",
|
|
292
|
+
):
|
|
293
|
+
|
|
294
|
+
if isFilenameBelowPath(path=candidate, filename=sys_prefix):
|
|
295
|
+
return True
|
|
278
296
|
|
|
279
297
|
# For Windows, we check registry.
|
|
280
298
|
if isWin32Windows():
|
nuitka/PythonVersions.py
CHANGED
|
@@ -104,6 +104,7 @@ python_version_full_str = ".".join(str(s) for s in sys.version_info[0:3])
|
|
|
104
104
|
python_version_str = ".".join(str(s) for s in sys.version_info[0:2])
|
|
105
105
|
|
|
106
106
|
|
|
107
|
+
# TODO: Move error construction helpers to separate node making helpers module.
|
|
107
108
|
def getErrorMessageExecWithNestedFunction():
|
|
108
109
|
"""Error message of the concrete Python in case an exec occurs in a
|
|
109
110
|
function that takes a closure variable.
|
|
@@ -161,6 +162,13 @@ def getUnboundLocalErrorErrorTemplate():
|
|
|
161
162
|
return getUnboundLocalErrorErrorTemplate.result
|
|
162
163
|
|
|
163
164
|
|
|
165
|
+
def getDictFromkeysNoArgErrorMessage():
|
|
166
|
+
try:
|
|
167
|
+
dict.fromkeys()
|
|
168
|
+
except TypeError as e:
|
|
169
|
+
return e.args[0]
|
|
170
|
+
|
|
171
|
+
|
|
164
172
|
_needs_set_literal_reverse_insertion = None
|
|
165
173
|
|
|
166
174
|
|
|
@@ -253,6 +261,12 @@ def getPythonABI():
|
|
|
253
261
|
return abiflags
|
|
254
262
|
|
|
255
263
|
|
|
264
|
+
def getLaunchingSystemPrefixPath():
|
|
265
|
+
from nuitka.utils.Utils import getLaunchingNuitkaProcessEnvironmentValue
|
|
266
|
+
|
|
267
|
+
return getLaunchingNuitkaProcessEnvironmentValue("NUITKA_SYS_PREFIX")
|
|
268
|
+
|
|
269
|
+
|
|
256
270
|
_the_sys_prefix = None
|
|
257
271
|
|
|
258
272
|
|
|
@@ -472,6 +486,10 @@ def getModuleLinkerLibs():
|
|
|
472
486
|
return result
|
|
473
487
|
|
|
474
488
|
|
|
489
|
+
def isPythonWithGil():
|
|
490
|
+
return python_version < 0x3D0 or sys.flags.gil
|
|
491
|
+
|
|
492
|
+
|
|
475
493
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
476
494
|
# integrates with CPython, but also works on its own.
|
|
477
495
|
#
|
nuitka/Tracing.py
CHANGED
nuitka/TreeXML.py
CHANGED
|
@@ -7,7 +7,7 @@ Means to create XML elements from Nuitka tree nodes and to convert the
|
|
|
7
7
|
XML tree to ASCII or output it.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
from nuitka.__past__ import StringIO
|
|
10
|
+
from nuitka.__past__ import BytesIO, StringIO
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def _indent(elem, level=0, more_sibs=False):
|
|
@@ -93,8 +93,11 @@ def toString(tree):
|
|
|
93
93
|
return result
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
def fromString(text):
|
|
97
|
-
|
|
96
|
+
def fromString(text, use_lxml=False):
|
|
97
|
+
if type(text) is str:
|
|
98
|
+
return fromFile(StringIO(text), use_lxml=use_lxml)
|
|
99
|
+
else:
|
|
100
|
+
return fromFile(BytesIO(text), use_lxml=use_lxml)
|
|
98
101
|
|
|
99
102
|
|
|
100
103
|
def fromFile(file_handle, use_lxml=False):
|