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.

Files changed (213) hide show
  1. Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.5.data/scripts/nuitka-run.cmd +1 -1
  2. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/METADATA +1 -1
  3. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/RECORD +213 -210
  4. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/WHEEL +1 -1
  5. nuitka/CacheCleanup.py +6 -1
  6. nuitka/HardImportRegistry.py +30 -2
  7. nuitka/MainControl.py +62 -35
  8. nuitka/ModuleRegistry.py +11 -3
  9. nuitka/OptionParsing.py +78 -39
  10. nuitka/Options.py +142 -35
  11. nuitka/OutputDirectories.py +5 -0
  12. nuitka/PostProcessing.py +23 -14
  13. nuitka/Progress.py +2 -1
  14. nuitka/PythonFlavors.py +22 -4
  15. nuitka/PythonVersions.py +18 -0
  16. nuitka/Tracing.py +1 -0
  17. nuitka/TreeXML.py +6 -3
  18. nuitka/Version.py +1 -1
  19. nuitka/__main__.py +55 -10
  20. nuitka/__past__.py +5 -0
  21. nuitka/build/Backend.scons +6 -1
  22. nuitka/build/CCompilerVersion.scons +1 -0
  23. nuitka/build/Onefile.scons +4 -0
  24. nuitka/build/SconsCaching.py +2 -1
  25. nuitka/build/SconsCompilerSettings.py +1 -0
  26. nuitka/build/SconsHacks.py +5 -1
  27. nuitka/build/SconsInterface.py +2 -0
  28. nuitka/build/SconsUtils.py +4 -1
  29. nuitka/build/include/nuitka/allocator.h +27 -5
  30. nuitka/build/include/nuitka/calling.h +1 -1
  31. nuitka/build/include/nuitka/compiled_frame.h +23 -23
  32. nuitka/build/include/nuitka/compiled_method.h +1 -1
  33. nuitka/build/include/nuitka/exception_groups.h +0 -2
  34. nuitka/build/include/nuitka/helper/attributes.h +7 -1
  35. nuitka/build/include/nuitka/helper/subscripts.h +1 -1
  36. nuitka/build/include/nuitka/helpers.h +10 -3
  37. nuitka/build/include/nuitka/prelude.h +6 -15
  38. nuitka/build/include/nuitka/printing.h +2 -0
  39. nuitka/build/include/nuitka/unfreezing.h +11 -5
  40. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  41. nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
  42. nuitka/build/static_src/CompiledCellType.c +7 -7
  43. nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
  44. nuitka/build/static_src/CompiledCoroutineType.c +2 -4
  45. nuitka/build/static_src/CompiledFrameType.c +109 -82
  46. nuitka/build/static_src/CompiledFunctionType.c +36 -9
  47. nuitka/build/static_src/CompiledGeneratorType.c +12 -10
  48. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
  49. nuitka/build/static_src/CompiledMethodType.c +14 -13
  50. nuitka/build/static_src/HelpersAttributes.c +13 -15
  51. nuitka/build/static_src/HelpersBuiltin.c +16 -7
  52. nuitka/build/static_src/HelpersCalling.c +13 -13
  53. nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
  54. nuitka/build/static_src/HelpersComparisonEq.c +110 -110
  55. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
  56. nuitka/build/static_src/HelpersComparisonGe.c +110 -110
  57. nuitka/build/static_src/HelpersComparisonGt.c +110 -110
  58. nuitka/build/static_src/HelpersComparisonLe.c +110 -110
  59. nuitka/build/static_src/HelpersComparisonLt.c +110 -110
  60. nuitka/build/static_src/HelpersComparisonNe.c +110 -110
  61. nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
  62. nuitka/build/static_src/HelpersDictionaries.c +9 -0
  63. nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
  64. nuitka/build/static_src/HelpersImport.c +1 -1
  65. nuitka/build/static_src/HelpersLists.c +5 -1
  66. nuitka/build/static_src/HelpersMatching.c +95 -35
  67. nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
  68. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
  69. nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
  70. nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
  71. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
  72. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
  73. nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
  74. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
  75. nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
  76. nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
  77. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
  78. nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
  79. nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
  80. nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
  81. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
  82. nuitka/build/static_src/HelpersSequences.c +1 -1
  83. nuitka/build/static_src/HelpersTypes.c +8 -4
  84. nuitka/build/static_src/InspectPatcher.c +14 -2
  85. nuitka/build/static_src/MainProgram.c +20 -1
  86. nuitka/build/static_src/MetaPathBasedLoader.c +163 -140
  87. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
  88. nuitka/build/static_src/OnefileBootstrap.c +100 -6
  89. nuitka/code_generation/AttributeCodes.py +12 -10
  90. nuitka/code_generation/CodeGeneration.py +6 -7
  91. nuitka/code_generation/ConstantCodes.py +53 -10
  92. nuitka/code_generation/Emission.py +1 -1
  93. nuitka/code_generation/GlobalConstants.py +6 -6
  94. nuitka/code_generation/Indentation.py +4 -5
  95. nuitka/code_generation/LoaderCodes.py +3 -0
  96. nuitka/code_generation/LocalsDictCodes.py +36 -14
  97. nuitka/code_generation/MatchCodes.py +23 -4
  98. nuitka/code_generation/ModuleCodes.py +1 -8
  99. nuitka/code_generation/Namify.py +2 -0
  100. nuitka/code_generation/PackageResourceCodes.py +5 -1
  101. nuitka/code_generation/templates/CodeTemplatesConstants.py +22 -4
  102. nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
  103. nuitka/code_generation/templates/CodeTemplatesModules.py +27 -9
  104. nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
  105. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
  106. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
  107. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  108. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
  109. nuitka/freezer/DependsExe.py +3 -1
  110. nuitka/freezer/DllDependenciesMacOS.py +5 -12
  111. nuitka/freezer/IncludedDataFiles.py +15 -4
  112. nuitka/freezer/IncludedEntryPoints.py +8 -2
  113. nuitka/freezer/Onefile.py +6 -1
  114. nuitka/freezer/Standalone.py +9 -2
  115. nuitka/importing/Importing.py +14 -5
  116. nuitka/importing/Recursion.py +3 -0
  117. nuitka/nodes/AttributeNodesGenerated.py +21 -12
  118. nuitka/nodes/BuiltinOpenNodes.py +5 -0
  119. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
  120. nuitka/nodes/BuiltinRefNodes.py +41 -1
  121. nuitka/nodes/ChildrenHavingMixins.py +143 -355
  122. nuitka/nodes/ClassNodes.py +30 -12
  123. nuitka/nodes/CodeObjectSpecs.py +9 -0
  124. nuitka/nodes/ExpressionBasesGenerated.py +11 -11
  125. nuitka/nodes/FunctionNodes.py +7 -11
  126. nuitka/nodes/FutureSpecs.py +16 -3
  127. nuitka/nodes/GeneratorNodes.py +2 -2
  128. nuitka/nodes/HardImportNodesGenerated.py +11 -134
  129. nuitka/nodes/LocalsScopes.py +19 -23
  130. nuitka/nodes/MatchNodes.py +18 -7
  131. nuitka/nodes/ModuleAttributeNodes.py +1 -20
  132. nuitka/nodes/ModuleNodes.py +23 -6
  133. nuitka/nodes/NodeBases.py +3 -2
  134. nuitka/nodes/NodeMetaClasses.py +26 -10
  135. nuitka/nodes/ReturnNodes.py +1 -1
  136. nuitka/nodes/StatementBasesGenerated.py +11 -11
  137. nuitka/nodes/SubscriptNodes.py +4 -4
  138. nuitka/nodes/VariableAssignNodes.py +1 -1
  139. nuitka/nodes/VariableRefNodes.py +28 -2
  140. nuitka/optimizations/FunctionInlining.py +3 -6
  141. nuitka/optimizations/Optimization.py +13 -12
  142. nuitka/optimizations/TraceCollections.py +19 -4
  143. nuitka/plugins/PluginBase.py +121 -133
  144. nuitka/plugins/Plugins.py +92 -4
  145. nuitka/plugins/YamlPluginBase.py +121 -0
  146. nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
  147. nuitka/plugins/standard/DataFilesPlugin.py +15 -6
  148. nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
  149. nuitka/plugins/standard/DllFilesPlugin.py +5 -3
  150. nuitka/plugins/standard/ImplicitImports.py +34 -20
  151. nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
  152. nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
  153. nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
  154. nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
  155. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  156. nuitka/plugins/standard/standard.nuitka-package.config.yml +489 -182
  157. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
  158. nuitka/reports/Reports.py +53 -5
  159. nuitka/specs/BuiltinParameterSpecs.py +1 -1
  160. nuitka/specs/HardImportSpecs.py +0 -6
  161. nuitka/tools/data_composer/DataComposer.py +29 -27
  162. nuitka/tools/environments/CreateEnvironment.py +1 -0
  163. nuitka/tools/environments/Virtualenv.py +25 -11
  164. nuitka/tools/general/find_module/FindModuleCode.py +13 -3
  165. nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
  166. nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
  167. nuitka/tools/specialize/CTypeDescriptions.py +13 -7
  168. nuitka/tools/specialize/SpecializePython.py +18 -1
  169. nuitka/tools/testing/Common.py +19 -6
  170. nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
  171. nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
  172. nuitka/tools/watch/AutoStage.py +144 -0
  173. nuitka/tools/watch/__main__.py +79 -32
  174. nuitka/tree/Building.py +105 -104
  175. nuitka/tree/ComplexCallHelperFunctions.py +16 -26
  176. nuitka/tree/InternalModule.py +8 -0
  177. nuitka/tree/ReformulationAssignmentStatements.py +29 -59
  178. nuitka/tree/ReformulationClasses.py +10 -17
  179. nuitka/tree/ReformulationClasses3.py +69 -43
  180. nuitka/tree/ReformulationComparisonExpressions.py +6 -16
  181. nuitka/tree/ReformulationContractionExpressions.py +14 -23
  182. nuitka/tree/ReformulationDictionaryCreation.py +6 -10
  183. nuitka/tree/ReformulationExecStatements.py +10 -10
  184. nuitka/tree/ReformulationForLoopStatements.py +6 -12
  185. nuitka/tree/ReformulationFunctionStatements.py +21 -28
  186. nuitka/tree/ReformulationImportStatements.py +8 -10
  187. nuitka/tree/ReformulationLambdaExpressions.py +3 -6
  188. nuitka/tree/ReformulationMatchStatements.py +166 -60
  189. nuitka/tree/ReformulationMultidist.py +3 -1
  190. nuitka/tree/ReformulationNamespacePackages.py +1 -1
  191. nuitka/tree/ReformulationPrintStatements.py +3 -6
  192. nuitka/tree/ReformulationSequenceCreation.py +13 -26
  193. nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
  194. nuitka/tree/ReformulationWithStatements.py +12 -16
  195. nuitka/tree/SourceHandling.py +13 -8
  196. nuitka/tree/VariableClosure.py +5 -21
  197. nuitka/utils/Distributions.py +80 -11
  198. nuitka/utils/Download.py +38 -31
  199. nuitka/utils/Execution.py +13 -2
  200. nuitka/utils/FileOperations.py +55 -28
  201. nuitka/utils/Images.py +6 -1
  202. nuitka/utils/Importing.py +1 -1
  203. nuitka/utils/ModuleNames.py +11 -5
  204. nuitka/utils/ReExecute.py +17 -13
  205. nuitka/utils/SharedLibraries.py +32 -8
  206. nuitka/utils/Signing.py +3 -1
  207. nuitka/utils/StaticLibraries.py +51 -41
  208. nuitka/utils/Timing.py +1 -1
  209. nuitka/utils/Utils.py +29 -7
  210. /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.5.data/scripts/nuitka.cmd +0 -0
  211. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/LICENSE.txt +0 -0
  212. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/entry_points.txt +0 -0
  213. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (72.1.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win_amd64
5
5
 
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(cache_dir, ignore_errors=False)
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
 
@@ -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,
@@ -117,6 +120,7 @@ hard_modules_trust_with_side_effects = set(
117
120
  [
118
121
  "site",
119
122
  "tensorflow",
123
+ "importlib_metadata",
120
124
  # TODO: Disabled for now, keyword only arguments and star list argument are
121
125
  # having ordering issues for call matching and code generation.
122
126
  # "networkx.utils.decorators"
@@ -161,8 +165,10 @@ module_sys_trust = {
161
165
  "maxsize": trust_constant,
162
166
  "byteorder": trust_constant,
163
167
  "builtin_module_names": trust_constant,
164
- "stdout": trust_exist,
165
- "stderr": trust_exist,
168
+ # TODO: Their lookups would have to be nodes, and copy with them being
169
+ # potentially unassigned.
170
+ # "stdout": trust_exist,
171
+ # "stderr": trust_exist,
166
172
  "exit": trust_node,
167
173
  }
168
174
 
@@ -175,6 +181,7 @@ else:
175
181
  module_builtins_trust = {}
176
182
  if python_version >= 0x300:
177
183
  module_builtins_trust["open"] = trust_node
184
+ trust_node_factory[("builtins", "open")] = makeBuiltinOpenRefNode
178
185
 
179
186
  if python_version < 0x300:
180
187
  module_sys_trust["exc_type"] = trust_may_exist
@@ -192,6 +199,27 @@ module_typing_trust = {
192
199
  "TYPE_CHECKING": trust_constant,
193
200
  }
194
201
 
202
+
203
+ def makeTypingModuleTrust():
204
+ result = {}
205
+
206
+ if python_version >= 0x350:
207
+ import typing
208
+
209
+ constant_typing_values = ("TYPE_CHECKING", "Text")
210
+ for name in typing.__all__:
211
+ if name not in constant_typing_values:
212
+ trust = trust_exist
213
+ if Options.is_debug:
214
+ assert not isConstant(getattr(typing, name))
215
+ else:
216
+ trust = trust_constant
217
+ if Options.is_debug:
218
+ assert isConstant(getattr(typing, name))
219
+
220
+ result[name] = trust
221
+
222
+
195
223
  module_os_trust = {
196
224
  "name": trust_constant,
197
225
  "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,too-many-locals
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 len(main_filenames) > 1:
138
+ if Options.isMultidistMode():
141
139
  assert not Options.shallMakeModule()
142
140
 
143
141
  main_module = buildMainModuleTree(
144
- # TODO: Should not be given.
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(distribution_name, distribution)
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(path=standalone_dir, ignore_errors=True)
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"), ignore_errors=True
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
- package_name,
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, package_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
- _exit_code = _runPgoBinary()
532
+ exit_code_pgo = _runPgoBinary()
530
533
 
531
534
  pgo_data_collected = os.path.exists(msvc_pgc_filename)
532
535
  else:
533
- _exit_code = _runPgoBinary()
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
- general.sysexit(
544
- "Error, no PGO information produced, did the created binary run at all?"
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
- general.info("Successfully collected C level PGO information.", style="blue")
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
- "Error, no Python PGO information produced, did the created binary run (exit code %d) as expected?"
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.shallCreatePgoInput():
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.isPgoMode():
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.isPgoMode():
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.shallCreatePgoInput():
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(path=dist_dir, ignore_errors=False)
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(path=source_dir, ignore_errors=False)
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", ("pass_number", "time_used")
282
+ "ModuleOptimizationTimingInfo",
283
+ ("pass_number", "time_used", "micro_passes", "merge_counts"),
283
284
  )
284
285
 
285
286
 
286
- def addModuleOptimizationTimeInformation(module_name, pass_number, time_used):
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(pass_number=pass_number, time_used=time_used)
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. Defaults to the
956
- system CPU count.""",
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-dependency-tool",
1351
+ "--windows-console-mode",
1364
1352
  action="store",
1365
- dest="dependency_tool",
1353
+ dest="console_mode",
1354
+ choices=("force", "disable", "attach"),
1355
+ metavar="CONSOLE_MODE",
1366
1356
  default=None,
1367
- help=SUPPRESS_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():