Nuitka-winsvc 2.3.9__cp311-cp311-win_amd64.whl → 2.4.1__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.9.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +29 -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/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +26 -23
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +1 -0
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +5 -2
- 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 +7 -4
- nuitka/build/include/nuitka/prelude.h +6 -10
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +5 -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 +51 -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 +18 -9
- 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/HelpersFiles.c +2 -2
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersHeapStorage.c +4 -0
- 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/MainProgram.c +28 -9
- nuitka/build/static_src/MetaPathBasedLoader.c +126 -110
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +30 -1
- nuitka/build/static_src/OnefileBootstrap.c +34 -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/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +3 -4
- 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 +0 -7
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
- 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 +28 -14
- nuitka/freezer/IncludedDataFiles.py +12 -3
- 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 +11 -12
- 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 +13 -11
- 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/nodes/shapes/BuiltinTypeShapes.py +21 -1
- 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 +91 -3
- 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 +491 -186
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +17 -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 +9 -1
- 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 +22 -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 +21 -9
- 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 +69 -41
- 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.9.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
nuitka/CacheCleanup.py
CHANGED
|
@@ -22,7 +22,12 @@ def _cleanCacheDirectory(cache_name, cache_dir):
|
|
|
22
22
|
cache_logger.info(
|
|
23
23
|
"Cleaning cache '%s' directory '%s'." % (cache_name, cache_dir)
|
|
24
24
|
)
|
|
25
|
-
removeDirectory(
|
|
25
|
+
removeDirectory(
|
|
26
|
+
cache_dir,
|
|
27
|
+
logger=cache_logger,
|
|
28
|
+
ignore_errors=False,
|
|
29
|
+
extra_recommendation=None,
|
|
30
|
+
)
|
|
26
31
|
cache_logger.info("Done.")
|
|
27
32
|
|
|
28
33
|
|
nuitka/HardImportRegistry.py
CHANGED
|
@@ -10,6 +10,9 @@ know how to handle these.
|
|
|
10
10
|
import os
|
|
11
11
|
import sys
|
|
12
12
|
|
|
13
|
+
from nuitka import Options
|
|
14
|
+
from nuitka.Constants import isConstant
|
|
15
|
+
from nuitka.nodes.BuiltinOpenNodes import makeBuiltinOpenRefNode
|
|
13
16
|
from nuitka.nodes.ConstantRefNodes import ExpressionConstantSysVersionInfoRef
|
|
14
17
|
from nuitka.PythonVersions import (
|
|
15
18
|
getFutureModuleKeys,
|
|
@@ -161,8 +164,10 @@ module_sys_trust = {
|
|
|
161
164
|
"maxsize": trust_constant,
|
|
162
165
|
"byteorder": trust_constant,
|
|
163
166
|
"builtin_module_names": trust_constant,
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
# TODO: Their lookups would have to be nodes, and copy with them being
|
|
168
|
+
# potentially unassigned.
|
|
169
|
+
# "stdout": trust_exist,
|
|
170
|
+
# "stderr": trust_exist,
|
|
166
171
|
"exit": trust_node,
|
|
167
172
|
}
|
|
168
173
|
|
|
@@ -175,6 +180,7 @@ else:
|
|
|
175
180
|
module_builtins_trust = {}
|
|
176
181
|
if python_version >= 0x300:
|
|
177
182
|
module_builtins_trust["open"] = trust_node
|
|
183
|
+
trust_node_factory[("builtins", "open")] = makeBuiltinOpenRefNode
|
|
178
184
|
|
|
179
185
|
if python_version < 0x300:
|
|
180
186
|
module_sys_trust["exc_type"] = trust_may_exist
|
|
@@ -192,6 +198,27 @@ module_typing_trust = {
|
|
|
192
198
|
"TYPE_CHECKING": trust_constant,
|
|
193
199
|
}
|
|
194
200
|
|
|
201
|
+
|
|
202
|
+
def makeTypingModuleTrust():
|
|
203
|
+
result = {}
|
|
204
|
+
|
|
205
|
+
if python_version >= 0x350:
|
|
206
|
+
import typing
|
|
207
|
+
|
|
208
|
+
constant_typing_values = ("TYPE_CHECKING", "Text")
|
|
209
|
+
for name in typing.__all__:
|
|
210
|
+
if name not in constant_typing_values:
|
|
211
|
+
trust = trust_exist
|
|
212
|
+
if Options.is_debug:
|
|
213
|
+
assert not isConstant(getattr(typing, name))
|
|
214
|
+
else:
|
|
215
|
+
trust = trust_constant
|
|
216
|
+
if Options.is_debug:
|
|
217
|
+
assert isConstant(getattr(typing, name))
|
|
218
|
+
|
|
219
|
+
result[name] = trust
|
|
220
|
+
|
|
221
|
+
|
|
195
222
|
module_os_trust = {
|
|
196
223
|
"name": trust_constant,
|
|
197
224
|
"listdir": trust_node,
|
nuitka/MainControl.py
CHANGED
|
@@ -69,7 +69,7 @@ from nuitka.PythonVersions import (
|
|
|
69
69
|
python_version_str,
|
|
70
70
|
)
|
|
71
71
|
from nuitka.Serialization import ConstantAccessor
|
|
72
|
-
from nuitka.Tracing import general, inclusion_logger
|
|
72
|
+
from nuitka.Tracing import general, inclusion_logger, pgo_logger
|
|
73
73
|
from nuitka.tree import SyntaxErrors
|
|
74
74
|
from nuitka.tree.ReformulationMultidist import createMultidistMainSourceCode
|
|
75
75
|
from nuitka.utils import InstanceCounters
|
|
@@ -130,24 +130,19 @@ def _createMainModule():
|
|
|
130
130
|
directory paths.
|
|
131
131
|
|
|
132
132
|
"""
|
|
133
|
-
# Many cases and details to deal with, pylint: disable=too-many-branches
|
|
133
|
+
# Many cases and details to deal with, pylint: disable=too-many-branches
|
|
134
134
|
|
|
135
135
|
Plugins.onBeforeCodeParsing()
|
|
136
136
|
|
|
137
|
-
main_filenames = Options.getMainEntryPointFilenames()
|
|
138
|
-
|
|
139
137
|
# First, build the raw node tree from the source code.
|
|
140
|
-
if
|
|
138
|
+
if Options.isMultidistMode():
|
|
141
139
|
assert not Options.shallMakeModule()
|
|
142
140
|
|
|
143
141
|
main_module = buildMainModuleTree(
|
|
144
|
-
|
|
145
|
-
filename=main_filenames[0],
|
|
146
|
-
source_code=createMultidistMainSourceCode(main_filenames),
|
|
142
|
+
source_code=createMultidistMainSourceCode(),
|
|
147
143
|
)
|
|
148
144
|
else:
|
|
149
145
|
main_module = buildMainModuleTree(
|
|
150
|
-
filename=main_filenames[0],
|
|
151
146
|
source_code=None,
|
|
152
147
|
)
|
|
153
148
|
|
|
@@ -162,7 +157,11 @@ def _createMainModule():
|
|
|
162
157
|
% distribution_name
|
|
163
158
|
)
|
|
164
159
|
|
|
165
|
-
addDistributionMetadataValue(
|
|
160
|
+
addDistributionMetadataValue(
|
|
161
|
+
distribution_name=distribution_name,
|
|
162
|
+
distribution=distribution,
|
|
163
|
+
reason="user requested",
|
|
164
|
+
)
|
|
166
165
|
|
|
167
166
|
# First remove old object files and old generated files, old binary or
|
|
168
167
|
# module, and standalone mode program directory if any, they can only do
|
|
@@ -175,11 +174,19 @@ def _createMainModule():
|
|
|
175
174
|
# Prepare the ".dist" directory, throwing away what was there before.
|
|
176
175
|
if Options.isStandaloneMode():
|
|
177
176
|
standalone_dir = OutputDirectories.getStandaloneDirectoryPath(bundle=False)
|
|
178
|
-
resetDirectory(
|
|
177
|
+
resetDirectory(
|
|
178
|
+
path=standalone_dir,
|
|
179
|
+
logger=general,
|
|
180
|
+
ignore_errors=True,
|
|
181
|
+
extra_recommendation="Stop previous binary.",
|
|
182
|
+
)
|
|
179
183
|
|
|
180
184
|
if Options.shallCreateAppBundle():
|
|
181
185
|
resetDirectory(
|
|
182
|
-
path=changeFilenameExtension(standalone_dir, ".app"),
|
|
186
|
+
path=changeFilenameExtension(standalone_dir, ".app"),
|
|
187
|
+
logger=general,
|
|
188
|
+
ignore_errors=True,
|
|
189
|
+
extra_recommendation=None,
|
|
183
190
|
)
|
|
184
191
|
|
|
185
192
|
# Delete result file, to avoid confusion with previous build and to
|
|
@@ -253,15 +260,11 @@ def _createMainModule():
|
|
|
253
260
|
checkFreezingModuleSet()
|
|
254
261
|
|
|
255
262
|
# Check if distribution meta data is included, that cannot be used.
|
|
256
|
-
for distribution_name, (
|
|
257
|
-
|
|
258
|
-
_metadata,
|
|
259
|
-
_entry_points,
|
|
260
|
-
) in getDistributionMetadataValues():
|
|
261
|
-
if not ModuleRegistry.hasDoneModule(package_name):
|
|
263
|
+
for distribution_name, meta_data_value in getDistributionMetadataValues():
|
|
264
|
+
if not ModuleRegistry.hasDoneModule(meta_data_value.module_name):
|
|
262
265
|
inclusion_logger.sysexit(
|
|
263
266
|
"Error, including metadata for distribution '%s' without including related package '%s'."
|
|
264
|
-
% (distribution_name,
|
|
267
|
+
% (distribution_name, meta_data_value.module_name)
|
|
265
268
|
)
|
|
266
269
|
|
|
267
270
|
# Allow plugins to comment on final module set.
|
|
@@ -526,11 +529,11 @@ def _runCPgoBinary():
|
|
|
526
529
|
source_dir=OutputDirectories.getSourceDirectoryPath(), key="PATH"
|
|
527
530
|
),
|
|
528
531
|
):
|
|
529
|
-
|
|
532
|
+
exit_code_pgo = _runPgoBinary()
|
|
530
533
|
|
|
531
534
|
pgo_data_collected = os.path.exists(msvc_pgc_filename)
|
|
532
535
|
else:
|
|
533
|
-
|
|
536
|
+
exit_code_pgo = _runPgoBinary()
|
|
534
537
|
|
|
535
538
|
# gcc file suffix, spell-checker: ignore gcda
|
|
536
539
|
gcc_constants_pgo_filename = os.path.join(
|
|
@@ -539,12 +542,21 @@ def _runCPgoBinary():
|
|
|
539
542
|
|
|
540
543
|
pgo_data_collected = os.path.exists(gcc_constants_pgo_filename)
|
|
541
544
|
|
|
545
|
+
if exit_code_pgo != 0:
|
|
546
|
+
pgo_logger.warning(
|
|
547
|
+
"""\
|
|
548
|
+
Error, the C PGO compiled program error exited. Make sure it works \
|
|
549
|
+
fully before using '--pgo-c' option."""
|
|
550
|
+
)
|
|
551
|
+
|
|
542
552
|
if not pgo_data_collected:
|
|
543
|
-
|
|
544
|
-
"
|
|
553
|
+
pgo_logger.sysexit(
|
|
554
|
+
"""\
|
|
555
|
+
Error, no C PGO compiled program did not produce expected information, \
|
|
556
|
+
did the created binary run at all?"""
|
|
545
557
|
)
|
|
546
558
|
|
|
547
|
-
|
|
559
|
+
pgo_logger.info("Successfully collected C level PGO information.", style="blue")
|
|
548
560
|
|
|
549
561
|
|
|
550
562
|
def _runPythonPgoBinary():
|
|
@@ -559,7 +571,9 @@ def _runPythonPgoBinary():
|
|
|
559
571
|
|
|
560
572
|
if not os.path.exists(pgo_filename):
|
|
561
573
|
general.sysexit(
|
|
562
|
-
"
|
|
574
|
+
"""\
|
|
575
|
+
Error, no Python PGO information produced, did the created binary
|
|
576
|
+
run (exit code %d) as expected?"""
|
|
563
577
|
% exit_code
|
|
564
578
|
)
|
|
565
579
|
|
|
@@ -621,6 +635,8 @@ def runSconsBackend():
|
|
|
621
635
|
if Options.isOnefileTempDirMode():
|
|
622
636
|
options["onefile_temp_mode"] = asBoolStr(True)
|
|
623
637
|
|
|
638
|
+
# TODO: Some things are going to hate that, we might need to bundle
|
|
639
|
+
# for accelerated mode still.
|
|
624
640
|
if Options.shallCreateAppBundle():
|
|
625
641
|
options["macos_bundle_mode"] = asBoolStr(True)
|
|
626
642
|
|
|
@@ -630,6 +646,9 @@ def runSconsBackend():
|
|
|
630
646
|
if Options.getForcedStderrPath():
|
|
631
647
|
options["forced_stderr_path"] = Options.getForcedStderrPath()
|
|
632
648
|
|
|
649
|
+
if Options.isProfile():
|
|
650
|
+
options["profile_mode"] = asBoolStr(True)
|
|
651
|
+
|
|
633
652
|
if Options.shallTreatUninstalledPython():
|
|
634
653
|
options["uninstalled_python"] = asBoolStr(True)
|
|
635
654
|
|
|
@@ -638,9 +657,6 @@ def runSconsBackend():
|
|
|
638
657
|
len(ModuleRegistry.getUncompiledTechnicalModules())
|
|
639
658
|
)
|
|
640
659
|
|
|
641
|
-
if Options.isProfile():
|
|
642
|
-
options["profile_mode"] = asBoolStr(True)
|
|
643
|
-
|
|
644
660
|
if hasPythonFlagNoWarnings():
|
|
645
661
|
options["no_python_warnings"] = asBoolStr(True)
|
|
646
662
|
|
|
@@ -707,7 +723,7 @@ def runSconsBackend():
|
|
|
707
723
|
# Allow plugins to build definitions.
|
|
708
724
|
env_values.update(Plugins.getBuildDefinitions())
|
|
709
725
|
|
|
710
|
-
if Options.
|
|
726
|
+
if Options.shallCreatePythonPgoInput():
|
|
711
727
|
options["pgo_mode"] = "python"
|
|
712
728
|
|
|
713
729
|
result = runScons(
|
|
@@ -726,11 +742,11 @@ def runSconsBackend():
|
|
|
726
742
|
return True, options
|
|
727
743
|
|
|
728
744
|
# Need to restart compilation from scratch here.
|
|
729
|
-
if Options.
|
|
745
|
+
if Options.isCPgoMode():
|
|
730
746
|
# For C level PGO, we have a 2 pass system. TODO: Make it more global for onefile
|
|
731
747
|
# and standalone mode proper support, which might need data files to be
|
|
732
748
|
# there, which currently are not yet there, so it won't run.
|
|
733
|
-
if Options.
|
|
749
|
+
if Options.isCPgoMode():
|
|
734
750
|
options["pgo_mode"] = "generate"
|
|
735
751
|
|
|
736
752
|
result = runScons(
|
|
@@ -996,7 +1012,7 @@ def _main():
|
|
|
996
1012
|
)
|
|
997
1013
|
|
|
998
1014
|
# Relaunch in case of Python PGO input to be produced.
|
|
999
|
-
if Options.
|
|
1015
|
+
if Options.shallCreatePythonPgoInput():
|
|
1000
1016
|
# Will not return.
|
|
1001
1017
|
pgo_filename = OutputDirectories.getPgoRunInputFilename()
|
|
1002
1018
|
general.info(
|
|
@@ -1036,7 +1052,6 @@ def _main():
|
|
|
1036
1052
|
copyDataFiles(standalone_entry_points=getStandaloneEntryPoints())
|
|
1037
1053
|
|
|
1038
1054
|
if Options.isStandaloneMode():
|
|
1039
|
-
|
|
1040
1055
|
Plugins.onStandaloneDistributionFinished(dist_dir)
|
|
1041
1056
|
|
|
1042
1057
|
if Options.isOnefileMode():
|
|
@@ -1045,7 +1060,12 @@ def _main():
|
|
|
1045
1060
|
if Options.isRemoveBuildDir():
|
|
1046
1061
|
general.info("Removing dist folder '%s'." % dist_dir)
|
|
1047
1062
|
|
|
1048
|
-
removeDirectory(
|
|
1063
|
+
removeDirectory(
|
|
1064
|
+
path=dist_dir,
|
|
1065
|
+
logger=general,
|
|
1066
|
+
ignore_errors=False,
|
|
1067
|
+
extra_recommendation=None,
|
|
1068
|
+
)
|
|
1049
1069
|
else:
|
|
1050
1070
|
general.info(
|
|
1051
1071
|
"Keeping dist folder '%s' for inspection, no need to use it."
|
|
@@ -1062,7 +1082,12 @@ def _main():
|
|
|
1062
1082
|
readSconsReport(source_dir)
|
|
1063
1083
|
readSconsErrorReport(source_dir)
|
|
1064
1084
|
|
|
1065
|
-
removeDirectory(
|
|
1085
|
+
removeDirectory(
|
|
1086
|
+
path=source_dir,
|
|
1087
|
+
logger=general,
|
|
1088
|
+
ignore_errors=False,
|
|
1089
|
+
extra_recommendation=None,
|
|
1090
|
+
)
|
|
1066
1091
|
assert not os.path.exists(source_dir)
|
|
1067
1092
|
else:
|
|
1068
1093
|
general.info("Keeping build directory '%s'." % source_dir)
|
|
@@ -1131,6 +1156,8 @@ def main():
|
|
|
1131
1156
|
except BaseException:
|
|
1132
1157
|
try:
|
|
1133
1158
|
writeCompilationReports(aborted=True)
|
|
1159
|
+
except KeyboardInterrupt:
|
|
1160
|
+
general.warning("""Report writing was prevented by user interrupt.""")
|
|
1134
1161
|
except BaseException as e: # Catch all the things, pylint: disable=broad-except
|
|
1135
1162
|
general.warning(
|
|
1136
1163
|
"""\
|
nuitka/ModuleRegistry.py
CHANGED
|
@@ -279,14 +279,22 @@ def getModuleInfluences(module_name):
|
|
|
279
279
|
module_timing_infos = {}
|
|
280
280
|
|
|
281
281
|
ModuleOptimizationTimingInfo = collections.namedtuple(
|
|
282
|
-
"ModuleOptimizationTimingInfo",
|
|
282
|
+
"ModuleOptimizationTimingInfo",
|
|
283
|
+
("pass_number", "time_used", "micro_passes", "merge_counts"),
|
|
283
284
|
)
|
|
284
285
|
|
|
285
286
|
|
|
286
|
-
def addModuleOptimizationTimeInformation(
|
|
287
|
+
def addModuleOptimizationTimeInformation(
|
|
288
|
+
module_name, pass_number, time_used, micro_passes, merge_counts
|
|
289
|
+
):
|
|
287
290
|
module_timing_info = list(module_timing_infos.get(module_name, []))
|
|
288
291
|
module_timing_info.append(
|
|
289
|
-
ModuleOptimizationTimingInfo(
|
|
292
|
+
ModuleOptimizationTimingInfo(
|
|
293
|
+
pass_number=pass_number,
|
|
294
|
+
time_used=time_used,
|
|
295
|
+
micro_passes=micro_passes,
|
|
296
|
+
merge_counts=merge_counts,
|
|
297
|
+
)
|
|
290
298
|
)
|
|
291
299
|
module_timing_infos[module_name] = tuple(module_timing_info)
|
|
292
300
|
|
nuitka/OptionParsing.py
CHANGED
|
@@ -19,6 +19,7 @@ import sys
|
|
|
19
19
|
from string import Formatter
|
|
20
20
|
|
|
21
21
|
from nuitka.PythonFlavors import getPythonFlavorName
|
|
22
|
+
from nuitka.PythonVersions import isPythonWithGil
|
|
22
23
|
from nuitka.utils.CommandLineOptions import SUPPRESS_HELP, makeOptionsParser
|
|
23
24
|
from nuitka.utils.FileOperations import getFileContentByLine
|
|
24
25
|
from nuitka.utils.Utils import (
|
|
@@ -764,6 +765,25 @@ Executing all self checks possible to find errors in Nuitka, do not use for
|
|
|
764
765
|
production. Defaults to off.""",
|
|
765
766
|
)
|
|
766
767
|
|
|
768
|
+
debug_group.add_option(
|
|
769
|
+
"--no-debug-immortal-assumptions",
|
|
770
|
+
action="store_false",
|
|
771
|
+
dest="debug_immortal",
|
|
772
|
+
default=None,
|
|
773
|
+
help="""\
|
|
774
|
+
Disable check normally done with "--debug". With Python3.12+ do not check known
|
|
775
|
+
immortal object assumptions. Some C libraries corrupt them. Defaults to check
|
|
776
|
+
being made if "--debug" is on.""",
|
|
777
|
+
)
|
|
778
|
+
|
|
779
|
+
debug_group.add_option(
|
|
780
|
+
"--debug-immortal-assumptions",
|
|
781
|
+
action="store_true",
|
|
782
|
+
dest="debug_immortal",
|
|
783
|
+
default=None,
|
|
784
|
+
help=SUPPRESS_HELP,
|
|
785
|
+
)
|
|
786
|
+
|
|
767
787
|
debug_group.add_option(
|
|
768
788
|
"--unstripped",
|
|
769
789
|
"--unstriped",
|
|
@@ -952,8 +972,9 @@ c_compiler_group.add_option(
|
|
|
952
972
|
metavar="N",
|
|
953
973
|
default=None,
|
|
954
974
|
help="""\
|
|
955
|
-
Specify the allowed number of parallel C compiler jobs.
|
|
956
|
-
system CPU
|
|
975
|
+
Specify the allowed number of parallel C compiler jobs. Negative values
|
|
976
|
+
are system CPU minus the given value. Defaults to the full system CPU
|
|
977
|
+
count unless low memory mode is activated, then it defaults to 1.""",
|
|
957
978
|
)
|
|
958
979
|
|
|
959
980
|
c_compiler_group.add_option(
|
|
@@ -1082,7 +1103,7 @@ del caching_group
|
|
|
1082
1103
|
pgo_group = parser.add_option_group("PGO compilation choices")
|
|
1083
1104
|
|
|
1084
1105
|
pgo_group.add_option(
|
|
1085
|
-
"--pgo",
|
|
1106
|
+
"--pgo-c",
|
|
1086
1107
|
action="store_true",
|
|
1087
1108
|
dest="is_c_pgo",
|
|
1088
1109
|
default=False,
|
|
@@ -1293,39 +1314,6 @@ del tracing_group
|
|
|
1293
1314
|
|
|
1294
1315
|
os_group = parser.add_option_group("General OS controls")
|
|
1295
1316
|
|
|
1296
|
-
os_group.add_option(
|
|
1297
|
-
"--disable-console",
|
|
1298
|
-
"--macos-disable-console",
|
|
1299
|
-
"--windows-disable-console",
|
|
1300
|
-
action="store_true",
|
|
1301
|
-
dest="disable_console",
|
|
1302
|
-
default=None,
|
|
1303
|
-
help=SUPPRESS_HELP,
|
|
1304
|
-
)
|
|
1305
|
-
|
|
1306
|
-
os_group.add_option(
|
|
1307
|
-
"--enable-console",
|
|
1308
|
-
action="store_false",
|
|
1309
|
-
dest="disable_console",
|
|
1310
|
-
default=None,
|
|
1311
|
-
help=SUPPRESS_HELP,
|
|
1312
|
-
)
|
|
1313
|
-
|
|
1314
|
-
os_group.add_option(
|
|
1315
|
-
"--windows-console-mode",
|
|
1316
|
-
action="store",
|
|
1317
|
-
dest="console_mode",
|
|
1318
|
-
choices=("force", "disable", "attach"),
|
|
1319
|
-
metavar="CONSOLE_MODE",
|
|
1320
|
-
default=None,
|
|
1321
|
-
help="""\
|
|
1322
|
-
Select console mode to use. Default mode is 'force' and creates a
|
|
1323
|
-
console window if not available, i.e. the program was started from one. With
|
|
1324
|
-
'disable' it doesn't create or use a console. With 'attach' an existing console
|
|
1325
|
-
will be used for outputs. Default is 'force'.
|
|
1326
|
-
""",
|
|
1327
|
-
)
|
|
1328
|
-
|
|
1329
1317
|
os_group.add_option(
|
|
1330
1318
|
"--force-stdout-spec",
|
|
1331
1319
|
"--windows-force-stdout-spec",
|
|
@@ -1360,11 +1348,18 @@ del os_group
|
|
|
1360
1348
|
windows_group = parser.add_option_group("Windows specific controls")
|
|
1361
1349
|
|
|
1362
1350
|
windows_group.add_option(
|
|
1363
|
-
"--windows-
|
|
1351
|
+
"--windows-console-mode",
|
|
1364
1352
|
action="store",
|
|
1365
|
-
dest="
|
|
1353
|
+
dest="console_mode",
|
|
1354
|
+
choices=("force", "disable", "attach"),
|
|
1355
|
+
metavar="CONSOLE_MODE",
|
|
1366
1356
|
default=None,
|
|
1367
|
-
help=
|
|
1357
|
+
help="""\
|
|
1358
|
+
Select console mode to use. Default mode is 'force' and creates a
|
|
1359
|
+
console window unless the program was started from one. With 'disable'
|
|
1360
|
+
it doesn't create or use a console at all. With 'attach' an existing
|
|
1361
|
+
console will be used for outputs. Default is 'force'.
|
|
1362
|
+
""",
|
|
1368
1363
|
)
|
|
1369
1364
|
|
|
1370
1365
|
windows_group.add_option(
|
|
@@ -1418,6 +1413,32 @@ Request Windows User Control, to enforce running from a few folders only, remote
|
|
|
1418
1413
|
desktop access. (Windows only). Defaults to off.""",
|
|
1419
1414
|
)
|
|
1420
1415
|
|
|
1416
|
+
windows_group.add_option(
|
|
1417
|
+
"--disable-console",
|
|
1418
|
+
"--macos-disable-console",
|
|
1419
|
+
"--windows-disable-console",
|
|
1420
|
+
action="store_true",
|
|
1421
|
+
dest="disable_console",
|
|
1422
|
+
default=None,
|
|
1423
|
+
help=SUPPRESS_HELP,
|
|
1424
|
+
)
|
|
1425
|
+
|
|
1426
|
+
windows_group.add_option(
|
|
1427
|
+
"--enable-console",
|
|
1428
|
+
action="store_false",
|
|
1429
|
+
dest="disable_console",
|
|
1430
|
+
default=None,
|
|
1431
|
+
help=SUPPRESS_HELP,
|
|
1432
|
+
)
|
|
1433
|
+
|
|
1434
|
+
windows_group.add_option(
|
|
1435
|
+
"--windows-dependency-tool",
|
|
1436
|
+
action="store",
|
|
1437
|
+
dest="dependency_tool",
|
|
1438
|
+
default=None,
|
|
1439
|
+
help=SUPPRESS_HELP,
|
|
1440
|
+
)
|
|
1441
|
+
|
|
1421
1442
|
windows_group.add_option(
|
|
1422
1443
|
"--windows-service",
|
|
1423
1444
|
action="store_true",
|
|
@@ -1799,6 +1820,23 @@ Default empty.""",
|
|
|
1799
1820
|
|
|
1800
1821
|
del plugin_group
|
|
1801
1822
|
|
|
1823
|
+
target_group = parser.add_option_group("Cross compilation")
|
|
1824
|
+
|
|
1825
|
+
|
|
1826
|
+
target_group.add_option(
|
|
1827
|
+
"--target",
|
|
1828
|
+
action="store",
|
|
1829
|
+
dest="target_desc",
|
|
1830
|
+
metavar="TARGET_DESC",
|
|
1831
|
+
default=None,
|
|
1832
|
+
help="""\
|
|
1833
|
+
Cross compilation target. Highly experimental and in development, not
|
|
1834
|
+
supposed to work yet. We are working on '--target=wasi' and nothing
|
|
1835
|
+
else yet.""",
|
|
1836
|
+
)
|
|
1837
|
+
|
|
1838
|
+
del target_group
|
|
1839
|
+
|
|
1802
1840
|
|
|
1803
1841
|
def _considerPluginOptions(logger):
|
|
1804
1842
|
# Cyclic dependency on plugins during parsing of command line.
|
|
@@ -1878,6 +1916,7 @@ def _expandProjectArg(arg, filename_arg, for_eval):
|
|
|
1878
1916
|
"Version": getNuitkaVersion(),
|
|
1879
1917
|
"Commercial": wrap(getCommercialVersion()),
|
|
1880
1918
|
"MAIN_DIRECTORY": wrap(os.path.dirname(filename_arg) or "."),
|
|
1919
|
+
"GIL": isPythonWithGil(),
|
|
1881
1920
|
}
|
|
1882
1921
|
|
|
1883
1922
|
if isLinux():
|