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.

Files changed (213) hide show
  1. Nuitka_winsvc-2.3.9.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
  2. {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
  3. {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +213 -210
  4. {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
  5. nuitka/CacheCleanup.py +6 -1
  6. nuitka/HardImportRegistry.py +29 -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/PythonFlavors.py +22 -4
  14. nuitka/PythonVersions.py +18 -0
  15. nuitka/Tracing.py +26 -23
  16. nuitka/TreeXML.py +6 -3
  17. nuitka/Version.py +1 -1
  18. nuitka/__main__.py +55 -10
  19. nuitka/build/Backend.scons +6 -1
  20. nuitka/build/CCompilerVersion.scons +1 -0
  21. nuitka/build/Onefile.scons +4 -0
  22. nuitka/build/SconsCaching.py +1 -0
  23. nuitka/build/SconsCompilerSettings.py +1 -0
  24. nuitka/build/SconsHacks.py +5 -1
  25. nuitka/build/SconsInterface.py +2 -0
  26. nuitka/build/SconsUtils.py +5 -2
  27. nuitka/build/include/nuitka/allocator.h +27 -5
  28. nuitka/build/include/nuitka/calling.h +1 -1
  29. nuitka/build/include/nuitka/compiled_frame.h +23 -23
  30. nuitka/build/include/nuitka/compiled_method.h +1 -1
  31. nuitka/build/include/nuitka/exception_groups.h +0 -2
  32. nuitka/build/include/nuitka/helper/attributes.h +7 -1
  33. nuitka/build/include/nuitka/helper/subscripts.h +1 -1
  34. nuitka/build/include/nuitka/helpers.h +7 -4
  35. nuitka/build/include/nuitka/prelude.h +6 -10
  36. nuitka/build/include/nuitka/printing.h +2 -0
  37. nuitka/build/include/nuitka/unfreezing.h +5 -5
  38. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  39. nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
  40. nuitka/build/static_src/CompiledCellType.c +7 -7
  41. nuitka/build/static_src/CompiledCodeHelpers.c +51 -36
  42. nuitka/build/static_src/CompiledCoroutineType.c +2 -4
  43. nuitka/build/static_src/CompiledFrameType.c +109 -82
  44. nuitka/build/static_src/CompiledFunctionType.c +36 -9
  45. nuitka/build/static_src/CompiledGeneratorType.c +12 -10
  46. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
  47. nuitka/build/static_src/CompiledMethodType.c +14 -13
  48. nuitka/build/static_src/HelpersAttributes.c +13 -15
  49. nuitka/build/static_src/HelpersBuiltin.c +18 -9
  50. nuitka/build/static_src/HelpersCalling.c +13 -13
  51. nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
  52. nuitka/build/static_src/HelpersComparisonEq.c +110 -110
  53. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
  54. nuitka/build/static_src/HelpersComparisonGe.c +110 -110
  55. nuitka/build/static_src/HelpersComparisonGt.c +110 -110
  56. nuitka/build/static_src/HelpersComparisonLe.c +110 -110
  57. nuitka/build/static_src/HelpersComparisonLt.c +110 -110
  58. nuitka/build/static_src/HelpersComparisonNe.c +110 -110
  59. nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
  60. nuitka/build/static_src/HelpersDictionaries.c +9 -0
  61. nuitka/build/static_src/HelpersFiles.c +2 -2
  62. nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
  63. nuitka/build/static_src/HelpersHeapStorage.c +4 -0
  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/MainProgram.c +28 -9
  85. nuitka/build/static_src/MetaPathBasedLoader.c +126 -110
  86. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
  87. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +30 -1
  88. nuitka/build/static_src/OnefileBootstrap.c +34 -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/GlobalConstants.py +6 -6
  93. nuitka/code_generation/Indentation.py +3 -4
  94. nuitka/code_generation/LoaderCodes.py +3 -0
  95. nuitka/code_generation/LocalsDictCodes.py +36 -14
  96. nuitka/code_generation/MatchCodes.py +23 -4
  97. nuitka/code_generation/ModuleCodes.py +0 -7
  98. nuitka/code_generation/Namify.py +2 -0
  99. nuitka/code_generation/PackageResourceCodes.py +5 -1
  100. nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
  101. nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
  102. nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
  103. nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
  104. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
  105. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
  106. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  107. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
  108. nuitka/freezer/DependsExe.py +3 -1
  109. nuitka/freezer/DllDependenciesMacOS.py +28 -14
  110. nuitka/freezer/IncludedDataFiles.py +12 -3
  111. nuitka/freezer/IncludedEntryPoints.py +8 -2
  112. nuitka/freezer/Onefile.py +6 -1
  113. nuitka/freezer/Standalone.py +9 -2
  114. nuitka/importing/Importing.py +14 -5
  115. nuitka/importing/Recursion.py +3 -0
  116. nuitka/nodes/AttributeNodesGenerated.py +21 -12
  117. nuitka/nodes/BuiltinOpenNodes.py +5 -0
  118. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
  119. nuitka/nodes/BuiltinRefNodes.py +41 -1
  120. nuitka/nodes/ChildrenHavingMixins.py +143 -355
  121. nuitka/nodes/ClassNodes.py +30 -12
  122. nuitka/nodes/CodeObjectSpecs.py +9 -0
  123. nuitka/nodes/ExpressionBasesGenerated.py +11 -11
  124. nuitka/nodes/FunctionNodes.py +11 -12
  125. nuitka/nodes/FutureSpecs.py +16 -3
  126. nuitka/nodes/GeneratorNodes.py +2 -2
  127. nuitka/nodes/HardImportNodesGenerated.py +11 -134
  128. nuitka/nodes/LocalsScopes.py +19 -23
  129. nuitka/nodes/MatchNodes.py +18 -7
  130. nuitka/nodes/ModuleAttributeNodes.py +1 -20
  131. nuitka/nodes/ModuleNodes.py +23 -6
  132. nuitka/nodes/NodeBases.py +13 -11
  133. nuitka/nodes/NodeMetaClasses.py +26 -10
  134. nuitka/nodes/ReturnNodes.py +1 -1
  135. nuitka/nodes/StatementBasesGenerated.py +11 -11
  136. nuitka/nodes/SubscriptNodes.py +4 -4
  137. nuitka/nodes/VariableAssignNodes.py +1 -1
  138. nuitka/nodes/VariableRefNodes.py +28 -2
  139. nuitka/nodes/shapes/BuiltinTypeShapes.py +21 -1
  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 +91 -3
  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 +491 -186
  157. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +17 -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 +9 -1
  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 +22 -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 +21 -9
  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 +69 -41
  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.9.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
  211. {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
  212. {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
  213. {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
nuitka/utils/ReExecute.py CHANGED
@@ -12,8 +12,6 @@ spell-checker: ignore execl, Popen
12
12
  import os
13
13
  import sys
14
14
 
15
- from nuitka.Options import shallExecuteImmediately
16
-
17
15
 
18
16
  def callExecProcess(args, uac):
19
17
  """Do exec in a portable way preserving exit code.
@@ -57,6 +55,10 @@ def callExecProcess(args, uac):
57
55
  os.execl(*args)
58
56
 
59
57
 
58
+ def setLaunchingNuitkaProcessEnvironmentValue(environment_variable_name, value):
59
+ os.environ[environment_variable_name] = str(os.getpid()) + ":" + value
60
+
61
+
60
62
  def reExecuteNuitka(pgo_filename):
61
63
  # Execute with full path as the process name, so it can find itself and its
62
64
  # libraries.
@@ -75,18 +77,18 @@ def reExecuteNuitka(pgo_filename):
75
77
 
76
78
  args += ["-S", our_filename]
77
79
 
78
- os.environ["NUITKA_BINARY_NAME"] = sys.modules["__main__"].__file__
79
- os.environ["NUITKA_PACKAGE_HOME"] = os.path.dirname(
80
- os.path.abspath(sys.modules["nuitka"].__path__[0])
80
+ setLaunchingNuitkaProcessEnvironmentValue(
81
+ "NUITKA_BINARY_NAME", sys.modules["__main__"].__file__
82
+ )
83
+ setLaunchingNuitkaProcessEnvironmentValue(
84
+ "NUITKA_PACKAGE_HOME",
85
+ os.path.dirname(os.path.abspath(sys.modules["nuitka"].__path__[0])),
81
86
  )
82
87
 
83
88
  if pgo_filename is not None:
84
89
  args.append("--pgo-python-input=%s" % pgo_filename)
85
90
  else:
86
- os.environ["NUITKA_SYS_PREFIX"] = sys.prefix
87
-
88
- if shallExecuteImmediately():
89
- args.append("--run")
91
+ setLaunchingNuitkaProcessEnvironmentValue("NUITKA_SYS_PREFIX", sys.prefix)
90
92
 
91
93
  # Same arguments as before.
92
94
  args += sys.argv[1:]
@@ -103,7 +105,7 @@ def reExecuteNuitka(pgo_filename):
103
105
  if site_filename.endswith(".pyc"):
104
106
  site_filename = site_filename[:-4] + ".py"
105
107
 
106
- os.environ["NUITKA_SITE_FILENAME"] = site_filename
108
+ setLaunchingNuitkaProcessEnvironmentValue("NUITKA_SITE_FILENAME", site_filename)
107
109
 
108
110
  # Note: As side effect, this might modify the "sys.path" too.
109
111
  os.environ["NUITKA_PTH_IMPORTED"] = repr(detectPthImportedPackages())
@@ -112,21 +114,23 @@ def reExecuteNuitka(pgo_filename):
112
114
  if user_site is not None:
113
115
  os.environ["NUITKA_USER_SITE"] = repr(user_site)
114
116
 
115
- os.environ["NUITKA_PYTHONPATH"] = repr(sys.path)
117
+ setLaunchingNuitkaProcessEnvironmentValue("NUITKA_PYTHONPATH", repr(sys.path))
116
118
 
117
119
  # In some environments, initial "sys.path" does not contain enough to load
118
120
  # "ast" module, which however we use to decode "NUITKA_PYTHONPATH", this
119
121
  # helps solve the chicken and egg problem.
120
122
  import ast
121
123
 
122
- os.environ["NUITKA_PYTHONPATH_AST"] = os.path.dirname(ast.__file__)
124
+ setLaunchingNuitkaProcessEnvironmentValue(
125
+ "NUITKA_PYTHONPATH_AST", os.path.dirname(ast.__file__)
126
+ )
123
127
 
124
128
  if sys.flags.no_site:
125
129
  os.environ["NUITKA_NOSITE_FLAG"] = "1"
126
130
 
127
131
  os.environ["PYTHONHASHSEED"] = "0"
128
132
 
129
- os.environ["NUITKA_REEXECUTION"] = "1"
133
+ setLaunchingNuitkaProcessEnvironmentValue("NUITKA_RE_EXECUTION", "1")
130
134
 
131
135
  # Does not return:
132
136
  callExecProcess(args, uac=False)
@@ -17,11 +17,7 @@ from nuitka.Options import getMacOSTargetArch, isShowInclusion, isUnstripped
17
17
  from nuitka.PythonVersions import python_version
18
18
  from nuitka.Tracing import inclusion_logger, postprocessing_logger
19
19
 
20
- from .Execution import (
21
- executeToolChecked,
22
- withEnvironmentPathAdded,
23
- withEnvironmentVarOverridden,
24
- )
20
+ from .Execution import executeToolChecked, withEnvironmentPathAdded
25
21
  from .FileOperations import (
26
22
  addFileExecutablePermission,
27
23
  changeFilenameExtension,
@@ -87,13 +83,12 @@ def locateDLL(dll_name):
87
83
  name=dll_name, paths=["/lib", "/usr/lib", "/usr/local/lib"]
88
84
  )
89
85
 
90
- with withEnvironmentVarOverridden("LANG", "C"):
91
- # TODO: Could and probably should cache "ldconfig -p" output to avoid forks
92
- output = executeToolChecked(
93
- logger=postprocessing_logger,
94
- command=("/sbin/ldconfig", "-p"),
95
- absence_message=_ldconfig_usage,
96
- )
86
+ # TODO: Could and probably should cache "ldconfig -p" output to avoid forks
87
+ output = executeToolChecked(
88
+ logger=postprocessing_logger,
89
+ command=("/sbin/ldconfig", "-p"),
90
+ absence_message=_ldconfig_usage,
91
+ )
97
92
 
98
93
  dll_map = {}
99
94
 
@@ -292,6 +287,23 @@ def getOtoolDependencyOutput(filename, package_specific_dirs):
292
287
  return _getOToolCommandOutput("-L", filename)
293
288
 
294
289
 
290
+ def parseOtoolListingOutput(output):
291
+ paths = OrderedSet()
292
+
293
+ for line in output.split(b"\n")[1:]:
294
+ if str is not bytes:
295
+ line = line.decode("utf8")
296
+
297
+ if not line:
298
+ continue
299
+
300
+ filename = line.split(" (", 1)[0].strip()
301
+
302
+ paths.add(filename)
303
+
304
+ return paths
305
+
306
+
295
307
  def _getDLLVersionMacOS(filename):
296
308
  output = _getOToolCommandOutput("-D", filename).splitlines()
297
309
 
@@ -349,14 +361,25 @@ def getSharedLibraryRPATH(filename):
349
361
 
350
362
 
351
363
  def _filterPatchelfErrorOutput(stderr):
364
+ non_errors = []
365
+
366
+ def isNonErrorExit(line):
367
+ if b"cannot find section '.dynamic'" in line:
368
+ non_errors.append(line)
369
+
370
+ return True
371
+
372
+ return False
373
+
352
374
  stderr = b"\n".join(
353
375
  line
354
376
  for line in stderr.splitlines()
355
377
  if line
356
378
  if b"warning: working around" not in line
379
+ if not isNonErrorExit(line)
357
380
  )
358
381
 
359
- return None, stderr
382
+ return (0 if non_errors else None), stderr
360
383
 
361
384
 
362
385
  _patchelf_usage = """\
@@ -383,13 +406,12 @@ installed. Use 'apt/dnf/yum install patchelf' first.""",
383
406
 
384
407
  def _setSharedLibraryRPATHElf(filename, rpath):
385
408
  # patchelf --set-rpath "$ORIGIN/path/to/library" <executable>
386
- with withEnvironmentVarOverridden("LANG", "C"):
387
- executeToolChecked(
388
- logger=postprocessing_logger,
389
- command=("patchelf", "--set-rpath", rpath, filename),
390
- stderr_filter=_filterPatchelfErrorOutput,
391
- absence_message=_patchelf_usage,
392
- )
409
+ executeToolChecked(
410
+ logger=postprocessing_logger,
411
+ command=("patchelf", "--set-rpath", rpath, filename),
412
+ stderr_filter=_filterPatchelfErrorOutput,
413
+ absence_message=_patchelf_usage,
414
+ )
393
415
 
394
416
 
395
417
  def _filterInstallNameToolErrorOutput(stderr):
@@ -464,24 +486,31 @@ def callInstallNameTool(filename, mapping, id_path, rpath):
464
486
  This is obviously macOS specific.
465
487
  """
466
488
  command = ["install_name_tool"]
489
+
490
+ needs_call = False
467
491
  for old_path, new_path in mapping:
468
- command += ("-change", old_path, new_path)
492
+ if old_path != new_path:
493
+ command += ("-change", old_path, new_path)
494
+ needs_call = True
469
495
 
470
496
  if rpath is not None:
471
497
  command += ("-add_rpath", os.path.join(rpath, "."))
498
+ needs_call = True
472
499
 
473
500
  if id_path is not None:
474
501
  command += ("-id", id_path)
502
+ needs_call = True
475
503
 
476
504
  command.append(filename)
477
505
 
478
- with withMadeWritableFileMode(filename):
479
- executeToolChecked(
480
- logger=postprocessing_logger,
481
- command=command,
482
- absence_message=_install_name_tool_usage,
483
- stderr_filter=_filterInstallNameToolErrorOutput,
484
- )
506
+ if needs_call:
507
+ with withMadeWritableFileMode(filename):
508
+ executeToolChecked(
509
+ logger=postprocessing_logger,
510
+ command=command,
511
+ absence_message=_install_name_tool_usage,
512
+ stderr_filter=_filterInstallNameToolErrorOutput,
513
+ )
485
514
 
486
515
 
487
516
  def getPyWin32Dir():
@@ -788,20 +817,19 @@ def cleanupHeaderForAndroid(filename):
788
817
  created by default.
789
818
  """
790
819
 
791
- with withEnvironmentVarOverridden("LANG", "C"):
792
- executeToolChecked(
793
- logger=postprocessing_logger,
794
- command=("patchelf", "--shrink-rpath", filename),
795
- stderr_filter=_filterPatchelfErrorOutput,
796
- absence_message=_patchelf_usage,
797
- )
820
+ executeToolChecked(
821
+ logger=postprocessing_logger,
822
+ command=("patchelf", "--shrink-rpath", filename),
823
+ stderr_filter=_filterPatchelfErrorOutput,
824
+ absence_message=_patchelf_usage,
825
+ )
798
826
 
799
- executeToolChecked(
800
- logger=postprocessing_logger,
801
- command=("termux-elf-cleaner", "--quiet", filename),
802
- absence_message=_termux_elf_cleaner_usage,
803
- optional=True,
804
- )
827
+ executeToolChecked(
828
+ logger=postprocessing_logger,
829
+ command=("termux-elf-cleaner", "--quiet", filename),
830
+ absence_message=_termux_elf_cleaner_usage,
831
+ optional=True,
832
+ )
805
833
 
806
834
 
807
835
  _nm_usage = """\
nuitka/utils/Signing.py CHANGED
@@ -48,6 +48,7 @@ def detectMacIdentity():
48
48
  if str is not bytes:
49
49
  output = output.decode("utf8")
50
50
 
51
+ signing_name = None
51
52
  result = None
52
53
 
53
54
  for line in output.splitlines():
@@ -96,7 +97,8 @@ def addMacOSCodeSignature(filenames):
96
97
  identity = detectMacIdentity()
97
98
 
98
99
  command = [
99
- "codesign",
100
+ # Need to avoid Anaconda codesign.
101
+ "/usr/bin/codesign",
100
102
  "-s",
101
103
  identity,
102
104
  "--force",
@@ -12,6 +12,7 @@ from nuitka.PythonFlavors import (
12
12
  isAnacondaPython,
13
13
  isDebianPackagePython,
14
14
  isNuitkaPython,
15
+ isRyePython,
15
16
  )
16
17
  from nuitka.PythonVersions import (
17
18
  getPythonABI,
@@ -22,7 +23,12 @@ from nuitka.PythonVersions import (
22
23
  from nuitka.Tracing import general
23
24
 
24
25
  from .FileOperations import getFileContentByLine, getFileList
25
- from .Utils import getLinuxDistribution, isDebianBasedLinux, isWin32Windows
26
+ from .Utils import (
27
+ getLinuxDistribution,
28
+ isDebianBasedLinux,
29
+ isMacOS,
30
+ isWin32Windows,
31
+ )
26
32
 
27
33
  _ldconf_paths = None
28
34
 
@@ -38,14 +44,15 @@ def locateStaticLinkLibrary(dll_name):
38
44
 
39
45
  def _locateStaticLinkLibrary(dll_name):
40
46
  # singleton, pylint: disable=global-statement
47
+
41
48
  #
42
49
  global _ldconf_paths
43
50
 
44
51
  if _ldconf_paths is None:
45
52
  _ldconf_paths = OrderedSet()
46
53
 
47
- for conf_filemame in getFileList("/etc/ld.so.conf.d", only_suffixes=".conf"):
48
- for conf_line in getFileContentByLine(conf_filemame):
54
+ for conf_filename in getFileList("/etc/ld.so.conf.d", only_suffixes=".conf"):
55
+ for conf_line in getFileContentByLine(conf_filename):
49
56
  conf_line = conf_line.split("#", 1)[0]
50
57
  conf_line = conf_line.strip()
51
58
 
@@ -142,53 +149,56 @@ def _getSystemStaticLibPythonPath():
142
149
  for candidate in candidates:
143
150
  if os.path.exists(candidate):
144
151
  return candidate
145
- else:
146
- candidate = os.path.join(
147
- sys_prefix, "lib", "libpython" + python_abi_version + ".a"
148
- )
149
152
 
150
- if os.path.exists(candidate):
151
- return candidate
153
+ return None
152
154
 
153
- # For Python2 this works. TODO: Figure out Debian and Python3.
154
- if (
155
- python_version < 0x300
156
- and isDebianPackagePython()
157
- and isDebianSuitableForStaticLinking()
158
- ):
159
- candidate = locateStaticLinkLibrary("python" + python_abi_version)
160
- else:
161
- candidate = None
155
+ if isMacOS() and isRyePython():
156
+ return None
162
157
 
163
- if candidate is not None and os.path.exists(candidate):
164
- # Also check libz, can be missing
165
- if not locateStaticLinkLibrary("z"):
166
- general.warning(
167
- "Error, missing 'libz-dev' installation needed for static lib-python."
168
- )
158
+ candidate = os.path.join(sys_prefix, "lib", "libpython" + python_abi_version + ".a")
169
159
 
170
- return candidate
160
+ if os.path.exists(candidate):
161
+ return candidate
171
162
 
172
- # This is not necessarily only for Python3 on Debian, but maybe others as well,
173
- # but that's what's been tested.
174
- if python_version >= 0x300 and isDebianPackagePython() and isDebianBasedLinux():
175
- candidate = os.path.join(
176
- _getSysConfigVarLIBPL(),
177
- "libpython" + python_abi_version + "-pic.a",
163
+ # For Python2 this works. TODO: Figure out Debian and Python3.
164
+ if (
165
+ python_version < 0x300
166
+ and isDebianPackagePython()
167
+ and isDebianSuitableForStaticLinking()
168
+ ):
169
+ candidate = locateStaticLinkLibrary("python" + python_abi_version)
170
+ else:
171
+ candidate = None
172
+
173
+ if candidate is not None and os.path.exists(candidate):
174
+ # Also check libz, can be missing
175
+ if not locateStaticLinkLibrary("z"):
176
+ general.warning(
177
+ "Error, missing 'libz-dev' installation needed for static lib-python."
178
178
  )
179
179
 
180
- if os.path.exists(candidate):
181
- return candidate
180
+ return candidate
182
181
 
183
- libpl = _getSysConfigVarLIBPL()
184
- if libpl is not None:
185
- candidate = os.path.join(
186
- libpl,
187
- "libpython" + python_abi_version + ".a",
188
- )
182
+ # This is not necessarily only for Python3 on Debian, but maybe others as well,
183
+ # but that's what's been tested. spell-checker: ignore libpl
184
+ if python_version >= 0x300 and isDebianPackagePython() and isDebianBasedLinux():
185
+ candidate = os.path.join(
186
+ _getSysConfigVarLIBPL(),
187
+ "libpython" + python_abi_version + "-pic.a",
188
+ )
189
189
 
190
- if os.path.exists(candidate):
191
- return candidate
190
+ if os.path.exists(candidate):
191
+ return candidate
192
+
193
+ libpl = _getSysConfigVarLIBPL()
194
+ if libpl is not None:
195
+ candidate = os.path.join(
196
+ libpl,
197
+ "libpython" + python_abi_version + ".a",
198
+ )
199
+
200
+ if os.path.exists(candidate):
201
+ return candidate
192
202
 
193
203
  return None
194
204
 
nuitka/utils/Timing.py CHANGED
@@ -83,7 +83,7 @@ class TimerReport(object):
83
83
  )
84
84
 
85
85
  if exception_type is None and above_threshold and self.decider():
86
- self.logger.info(self.message % self.timer.getDelta())
86
+ self.logger.info(self.message % self.timer.getDelta(), keep_format=True)
87
87
 
88
88
 
89
89
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
nuitka/utils/Utils.py CHANGED
@@ -376,7 +376,13 @@ def withNoWarning():
376
376
 
377
377
 
378
378
  def decoratorRetries(
379
- logger, purpose, consequence, attempts=5, sleep_time=1, exception_type=OSError
379
+ logger,
380
+ purpose,
381
+ consequence,
382
+ extra_recommendation=None,
383
+ attempts=5,
384
+ sleep_time=1,
385
+ exception_type=OSError,
380
386
  ):
381
387
  """Make retries for errors on Windows.
382
388
 
@@ -384,6 +390,10 @@ def decoratorRetries(
384
390
  a virus checker warning.
385
391
  """
386
392
 
393
+ recommendation = "Disable Anti-Virus, e.g. Windows Defender for build folders."
394
+ if extra_recommendation is not None:
395
+ recommendation = "%s. %s" % (extra_recommendation, recommendation)
396
+
387
397
  def inner(func):
388
398
  if os.name != "nt":
389
399
  return func
@@ -398,8 +408,9 @@ def decoratorRetries(
398
408
  logger.warning(
399
409
  """\
400
410
  Failed to %s in attempt %d due to %s.
401
- Disable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a second of delay."""
402
- % (purpose, attempt, str(e))
411
+ %s
412
+ Retrying after a second of delay."""
413
+ % (purpose, attempt, str(e), recommendation)
403
414
  )
404
415
 
405
416
  else:
@@ -407,15 +418,17 @@ Disable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a se
407
418
  logger.warning(
408
419
  """\
409
420
  Failed to %s in attempt %d.
410
- Disable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a second of delay."""
411
- % (purpose, attempt)
421
+ %s
422
+ Retrying after a second of delay."""
423
+ % (purpose, attempt, recommendation)
412
424
  )
413
425
  else:
414
426
  logger.warning(
415
427
  """\
416
428
  Failed to %s in attempt %d with error code %d.
417
- Disable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a second of delay."""
418
- % (purpose, attempt, e.errno)
429
+ %s
430
+ Retrying after a second of delay."""
431
+ % (purpose, attempt, e.errno, recommendation)
419
432
  )
420
433
 
421
434
  time.sleep(sleep_time)
@@ -443,6 +456,15 @@ def raiseWindowsError(message):
443
456
  )
444
457
 
445
458
 
459
+ def getLaunchingNuitkaProcessEnvironmentValue(environment_variable_name):
460
+ # Hack, we need this to bootstrap and it's actually living in __main__
461
+ # module of nuitka package and renamed to where we can get at easily for
462
+ # other uses. pylint: disable=no-name-in-module,redefined-outer-name
463
+ from nuitka import getLaunchingNuitkaProcessEnvironmentValue
464
+
465
+ return getLaunchingNuitkaProcessEnvironmentValue(environment_variable_name)
466
+
467
+
446
468
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
447
469
  # integrates with CPython, but also works on its own.
448
470
  #