Nuitka-winsvc 2.7.7__cp313-cp313-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 (995) hide show
  1. nuitka/Builtins.py +259 -0
  2. nuitka/BytecodeCaching.py +184 -0
  3. nuitka/Bytecodes.py +109 -0
  4. nuitka/CacheCleanup.py +54 -0
  5. nuitka/Constants.py +425 -0
  6. nuitka/Errors.py +93 -0
  7. nuitka/HardImportRegistry.py +408 -0
  8. nuitka/MainControl.py +1201 -0
  9. nuitka/ModuleRegistry.py +364 -0
  10. nuitka/OptionParsing.py +2473 -0
  11. nuitka/Options.py +2948 -0
  12. nuitka/OutputDirectories.py +201 -0
  13. nuitka/PostProcessing.py +551 -0
  14. nuitka/Progress.py +252 -0
  15. nuitka/PythonFlavors.py +426 -0
  16. nuitka/PythonOperators.py +146 -0
  17. nuitka/PythonVersions.py +513 -0
  18. nuitka/Serialization.py +291 -0
  19. nuitka/SourceCodeReferences.py +176 -0
  20. nuitka/Tracing.py +579 -0
  21. nuitka/TreeXML.py +141 -0
  22. nuitka/Variables.py +515 -0
  23. nuitka/Version.py +88 -0
  24. nuitka/__init__.py +19 -0
  25. nuitka/__main__.py +224 -0
  26. nuitka/__past__.py +217 -0
  27. nuitka/build/Backend.scons +1111 -0
  28. nuitka/build/CCompilerVersion.scons +281 -0
  29. nuitka/build/DataComposerInterface.py +116 -0
  30. nuitka/build/Offsets.scons +626 -0
  31. nuitka/build/Onefile.scons +564 -0
  32. nuitka/build/SconsCaching.py +451 -0
  33. nuitka/build/SconsCompilerSettings.py +1133 -0
  34. nuitka/build/SconsHacks.py +215 -0
  35. nuitka/build/SconsInterface.py +664 -0
  36. nuitka/build/SconsProgress.py +100 -0
  37. nuitka/build/SconsSpawn.py +436 -0
  38. nuitka/build/SconsUtils.py +939 -0
  39. nuitka/build/__init__.py +19 -0
  40. nuitka/build/include/nuitka/allocator.h +450 -0
  41. nuitka/build/include/nuitka/builtins.h +97 -0
  42. nuitka/build/include/nuitka/calling.h +123 -0
  43. nuitka/build/include/nuitka/checkers.h +39 -0
  44. nuitka/build/include/nuitka/checksum_tools.h +28 -0
  45. nuitka/build/include/nuitka/compiled_asyncgen.h +281 -0
  46. nuitka/build/include/nuitka/compiled_cell.h +64 -0
  47. nuitka/build/include/nuitka/compiled_coroutine.h +271 -0
  48. nuitka/build/include/nuitka/compiled_frame.h +502 -0
  49. nuitka/build/include/nuitka/compiled_function.h +170 -0
  50. nuitka/build/include/nuitka/compiled_generator.h +287 -0
  51. nuitka/build/include/nuitka/compiled_method.h +54 -0
  52. nuitka/build/include/nuitka/constants.h +251 -0
  53. nuitka/build/include/nuitka/constants_blob.h +34 -0
  54. nuitka/build/include/nuitka/debug_settings.h +60 -0
  55. nuitka/build/include/nuitka/environment_variables.h +30 -0
  56. nuitka/build/include/nuitka/environment_variables_system.h +51 -0
  57. nuitka/build/include/nuitka/exception_groups.h +167 -0
  58. nuitka/build/include/nuitka/exceptions.h +1458 -0
  59. nuitka/build/include/nuitka/filesystem_paths.h +117 -0
  60. nuitka/build/include/nuitka/freelists.h +92 -0
  61. nuitka/build/include/nuitka/hedley.h +1774 -0
  62. nuitka/build/include/nuitka/helper/attributes.h +90 -0
  63. nuitka/build/include/nuitka/helper/boolean.h +86 -0
  64. nuitka/build/include/nuitka/helper/bytearrays.h +34 -0
  65. nuitka/build/include/nuitka/helper/bytes.h +28 -0
  66. nuitka/build/include/nuitka/helper/calling_generated.h +132 -0
  67. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  68. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  69. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  70. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  71. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  72. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  73. nuitka/build/include/nuitka/helper/comparisons_eq.h +247 -0
  74. nuitka/build/include/nuitka/helper/comparisons_ge.h +197 -0
  75. nuitka/build/include/nuitka/helper/comparisons_gt.h +197 -0
  76. nuitka/build/include/nuitka/helper/comparisons_le.h +247 -0
  77. nuitka/build/include/nuitka/helper/comparisons_lt.h +247 -0
  78. nuitka/build/include/nuitka/helper/comparisons_ne.h +197 -0
  79. nuitka/build/include/nuitka/helper/complex.h +46 -0
  80. nuitka/build/include/nuitka/helper/dictionaries.h +481 -0
  81. nuitka/build/include/nuitka/helper/floats.h +32 -0
  82. nuitka/build/include/nuitka/helper/import_hard.h +121 -0
  83. nuitka/build/include/nuitka/helper/indexes.h +47 -0
  84. nuitka/build/include/nuitka/helper/ints.h +165 -0
  85. nuitka/build/include/nuitka/helper/iterators.h +376 -0
  86. nuitka/build/include/nuitka/helper/lists.h +94 -0
  87. nuitka/build/include/nuitka/helper/lists_generated.h +36 -0
  88. nuitka/build/include/nuitka/helper/mappings.h +39 -0
  89. nuitka/build/include/nuitka/helper/operations.h +114 -0
  90. nuitka/build/include/nuitka/helper/operations_binary_add.h +240 -0
  91. nuitka/build/include/nuitka/helper/operations_binary_bitand.h +108 -0
  92. nuitka/build/include/nuitka/helper/operations_binary_bitor.h +108 -0
  93. nuitka/build/include/nuitka/helper/operations_binary_bitxor.h +108 -0
  94. nuitka/build/include/nuitka/helper/operations_binary_divmod.h +103 -0
  95. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  96. nuitka/build/include/nuitka/helper/operations_binary_floordiv.h +103 -0
  97. nuitka/build/include/nuitka/helper/operations_binary_lshift.h +99 -0
  98. nuitka/build/include/nuitka/helper/operations_binary_matmult.h +60 -0
  99. nuitka/build/include/nuitka/helper/operations_binary_mod.h +304 -0
  100. nuitka/build/include/nuitka/helper/operations_binary_mult.h +247 -0
  101. nuitka/build/include/nuitka/helper/operations_binary_olddiv.h +125 -0
  102. nuitka/build/include/nuitka/helper/operations_binary_pow.h +90 -0
  103. nuitka/build/include/nuitka/helper/operations_binary_rshift.h +99 -0
  104. nuitka/build/include/nuitka/helper/operations_binary_sub.h +117 -0
  105. nuitka/build/include/nuitka/helper/operations_binary_truediv.h +103 -0
  106. nuitka/build/include/nuitka/helper/operations_builtin_types.h +247 -0
  107. nuitka/build/include/nuitka/helper/operations_inplace_add.h +173 -0
  108. nuitka/build/include/nuitka/helper/operations_inplace_bitand.h +76 -0
  109. nuitka/build/include/nuitka/helper/operations_inplace_bitor.h +76 -0
  110. nuitka/build/include/nuitka/helper/operations_inplace_bitxor.h +76 -0
  111. nuitka/build/include/nuitka/helper/operations_inplace_floordiv.h +95 -0
  112. nuitka/build/include/nuitka/helper/operations_inplace_lshift.h +62 -0
  113. nuitka/build/include/nuitka/helper/operations_inplace_matmult.h +60 -0
  114. nuitka/build/include/nuitka/helper/operations_inplace_mod.h +218 -0
  115. nuitka/build/include/nuitka/helper/operations_inplace_mult.h +184 -0
  116. nuitka/build/include/nuitka/helper/operations_inplace_olddiv.h +115 -0
  117. nuitka/build/include/nuitka/helper/operations_inplace_pow.h +87 -0
  118. nuitka/build/include/nuitka/helper/operations_inplace_rshift.h +62 -0
  119. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +102 -0
  120. nuitka/build/include/nuitka/helper/operations_inplace_truediv.h +95 -0
  121. nuitka/build/include/nuitka/helper/raising.h +114 -0
  122. nuitka/build/include/nuitka/helper/rangeobjects.h +66 -0
  123. nuitka/build/include/nuitka/helper/richcomparisons.h +35 -0
  124. nuitka/build/include/nuitka/helper/sequences.h +33 -0
  125. nuitka/build/include/nuitka/helper/sets.h +25 -0
  126. nuitka/build/include/nuitka/helper/slices.h +314 -0
  127. nuitka/build/include/nuitka/helper/strings.h +30 -0
  128. nuitka/build/include/nuitka/helper/subscripts.h +390 -0
  129. nuitka/build/include/nuitka/helper/tuples.h +187 -0
  130. nuitka/build/include/nuitka/helpers.h +417 -0
  131. nuitka/build/include/nuitka/importing.h +149 -0
  132. nuitka/build/include/nuitka/incbin.h +402 -0
  133. nuitka/build/include/nuitka/jit_sources.h +25 -0
  134. nuitka/build/include/nuitka/prelude.h +626 -0
  135. nuitka/build/include/nuitka/printing.h +84 -0
  136. nuitka/build/include/nuitka/python_pgo.h +57 -0
  137. nuitka/build/include/nuitka/safe_string_ops.h +57 -0
  138. nuitka/build/include/nuitka/threading.h +142 -0
  139. nuitka/build/include/nuitka/tracing.h +82 -0
  140. nuitka/build/include/nuitka/type_aliases.h +30 -0
  141. nuitka/build/include/nuitka/unfreezing.h +91 -0
  142. nuitka/build/inline_copy/appdirs/LICENSE.txt +23 -0
  143. nuitka/build/inline_copy/appdirs/appdirs.py +611 -0
  144. nuitka/build/inline_copy/atomicwrites/LICENSE +19 -0
  145. nuitka/build/inline_copy/atomicwrites/atomicwrites.py +226 -0
  146. nuitka/build/inline_copy/bin/scons.py +58 -0
  147. nuitka/build/inline_copy/clcache/clcache/LICENSE +30 -0
  148. nuitka/build/inline_copy/clcache/clcache/__init__.py +4 -0
  149. nuitka/build/inline_copy/clcache/clcache/caching.py +2008 -0
  150. nuitka/build/inline_copy/colorama/LICENSE.txt +27 -0
  151. nuitka/build/inline_copy/colorama/colorama/__init__.py +6 -0
  152. nuitka/build/inline_copy/colorama/colorama/ansi.py +102 -0
  153. nuitka/build/inline_copy/colorama/colorama/ansitowin32.py +258 -0
  154. nuitka/build/inline_copy/colorama/colorama/initialise.py +80 -0
  155. nuitka/build/inline_copy/colorama/colorama/win32.py +152 -0
  156. nuitka/build/inline_copy/colorama/colorama/winterm.py +169 -0
  157. nuitka/build/inline_copy/glob2/LICENSE +27 -0
  158. nuitka/build/inline_copy/glob2/glob2/__init__.py +5 -0
  159. nuitka/build/inline_copy/glob2/glob2/compat.py +167 -0
  160. nuitka/build/inline_copy/glob2/glob2/fnmatch.py +141 -0
  161. nuitka/build/inline_copy/glob2/glob2/impl.py +216 -0
  162. nuitka/build/inline_copy/jinja2/LICENSE.rst +28 -0
  163. nuitka/build/inline_copy/jinja2/README.rst +2 -0
  164. nuitka/build/inline_copy/jinja2/jinja2/__init__.py +72 -0
  165. nuitka/build/inline_copy/jinja2/jinja2/_compat.py +105 -0
  166. nuitka/build/inline_copy/jinja2/jinja2/_identifier.py +2 -0
  167. nuitka/build/inline_copy/jinja2/jinja2/bccache.py +361 -0
  168. nuitka/build/inline_copy/jinja2/jinja2/compiler.py +1721 -0
  169. nuitka/build/inline_copy/jinja2/jinja2/constants.py +32 -0
  170. nuitka/build/inline_copy/jinja2/jinja2/debug.py +378 -0
  171. nuitka/build/inline_copy/jinja2/jinja2/defaults.py +56 -0
  172. nuitka/build/inline_copy/jinja2/jinja2/environment.py +1276 -0
  173. nuitka/build/inline_copy/jinja2/jinja2/exceptions.py +146 -0
  174. nuitka/build/inline_copy/jinja2/jinja2/ext.py +627 -0
  175. nuitka/build/inline_copy/jinja2/jinja2/filters.py +1190 -0
  176. nuitka/build/inline_copy/jinja2/jinja2/idtracking.py +286 -0
  177. nuitka/build/inline_copy/jinja2/jinja2/lexer.py +739 -0
  178. nuitka/build/inline_copy/jinja2/jinja2/loaders.py +483 -0
  179. nuitka/build/inline_copy/jinja2/jinja2/meta.py +106 -0
  180. nuitka/build/inline_copy/jinja2/jinja2/nativetypes.py +220 -0
  181. nuitka/build/inline_copy/jinja2/jinja2/nodes.py +999 -0
  182. nuitka/build/inline_copy/jinja2/jinja2/optimizer.py +49 -0
  183. nuitka/build/inline_copy/jinja2/jinja2/parser.py +903 -0
  184. nuitka/build/inline_copy/jinja2/jinja2/runtime.py +808 -0
  185. nuitka/build/inline_copy/jinja2/jinja2/sandbox.py +488 -0
  186. nuitka/build/inline_copy/jinja2/jinja2/tests.py +174 -0
  187. nuitka/build/inline_copy/jinja2/jinja2/utils.py +642 -0
  188. nuitka/build/inline_copy/jinja2/jinja2/visitor.py +87 -0
  189. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Action.py +1475 -0
  190. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Builder.py +905 -0
  191. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/CacheDir.py +314 -0
  192. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Conftest.py +805 -0
  193. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Debug.py +251 -0
  194. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Defaults.py +646 -0
  195. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Environment.py +2561 -0
  196. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/EnvironmentValues.py +119 -0
  197. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Errors.py +222 -0
  198. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Executor.py +660 -0
  199. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Job.py +439 -0
  200. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Memoize.py +242 -0
  201. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Alias.py +176 -0
  202. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/FS.py +3861 -0
  203. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/Python.py +195 -0
  204. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Node/__init__.py +1784 -0
  205. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/PathList.py +224 -0
  206. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/__init__.py +341 -0
  207. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/aix.py +81 -0
  208. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/cygwin.py +61 -0
  209. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/darwin.py +70 -0
  210. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/hpux.py +45 -0
  211. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/irix.py +41 -0
  212. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/mingw.py +33 -0
  213. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/os2.py +55 -0
  214. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/posix.py +124 -0
  215. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/sunos.py +47 -0
  216. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/virtualenv.py +115 -0
  217. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Platform/win32.py +429 -0
  218. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConf.py +1119 -0
  219. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/SConsign.py +453 -0
  220. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/C.py +226 -0
  221. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Dir.py +131 -0
  222. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/Prog.py +114 -0
  223. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/RC.py +57 -0
  224. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Scanner/__init__.py +436 -0
  225. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Interactive.py +372 -0
  226. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/Main.py +1469 -0
  227. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConsOptions.py +1071 -0
  228. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/SConscript.py +686 -0
  229. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Script/__init__.py +425 -0
  230. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Subst.py +979 -0
  231. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Taskmaster.py +1062 -0
  232. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/386asm.py +61 -0
  233. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/GettextCommon.py +429 -0
  234. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/__init__.py +52 -0
  235. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/arch.py +66 -0
  236. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/common.py +371 -0
  237. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/netframework.py +83 -0
  238. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/sdk.py +411 -0
  239. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vc.py +994 -0
  240. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/MSCommon/vs.py +608 -0
  241. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/PharLapCommon.py +116 -0
  242. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/__init__.py +882 -0
  243. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixc++.py +43 -0
  244. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcc.py +74 -0
  245. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixcxx.py +77 -0
  246. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/aixlink.py +78 -0
  247. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/applelink.py +209 -0
  248. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ar.py +63 -0
  249. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/as.py +49 -0
  250. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/asm.py +78 -0
  251. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/bcc32.py +81 -0
  252. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/c++.py +44 -0
  253. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cc.py +105 -0
  254. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clang.py +91 -0
  255. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangCommon/__init__.py +18 -0
  256. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/clangxx.py +99 -0
  257. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cxx.py +95 -0
  258. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/cyglink.py +212 -0
  259. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/default.py +50 -0
  260. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/filesystem.py +98 -0
  261. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/g++.py +45 -0
  262. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gas.py +56 -0
  263. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gcc.py +110 -0
  264. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gettext_tool.py +69 -0
  265. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gnulink.py +70 -0
  266. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/gxx.py +78 -0
  267. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpc++.py +45 -0
  268. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcc.py +53 -0
  269. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hpcxx.py +88 -0
  270. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/hplink.py +72 -0
  271. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icc.py +59 -0
  272. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/icl.py +52 -0
  273. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink.py +55 -0
  274. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/ilink32.py +60 -0
  275. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/install.py +510 -0
  276. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/intelc.py +617 -0
  277. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/link.py +72 -0
  278. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/LoadableModule.py +131 -0
  279. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/SharedLibrary.py +218 -0
  280. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkCommon/__init__.py +171 -0
  281. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/linkloc.py +112 -0
  282. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/m4.py +63 -0
  283. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/masm.py +77 -0
  284. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mingw.py +232 -0
  285. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgfmt.py +132 -0
  286. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msginit.py +137 -0
  287. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msgmerge.py +125 -0
  288. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslib.py +73 -0
  289. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mslink.py +339 -0
  290. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mssdk.py +50 -0
  291. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvc.py +325 -0
  292. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/msvs.py +2116 -0
  293. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwcc.py +207 -0
  294. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/mwld.py +108 -0
  295. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/nasm.py +72 -0
  296. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rmic.py +139 -0
  297. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/rpcgen.py +70 -0
  298. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgiar.py +68 -0
  299. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgic++.py +43 -0
  300. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicc.py +53 -0
  301. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgicxx.py +61 -0
  302. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sgilink.py +59 -0
  303. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunar.py +64 -0
  304. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunc++.py +45 -0
  305. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncc.py +58 -0
  306. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/suncxx.py +153 -0
  307. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/sunlink.py +79 -0
  308. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tar.py +73 -0
  309. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/textfile.py +198 -0
  310. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/tlib.py +53 -0
  311. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/wix.py +104 -0
  312. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/xgettext.py +337 -0
  313. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Tool/zip.py +120 -0
  314. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Util.py +2134 -0
  315. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/ConfigureCache.py +171 -0
  316. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/__init__.py +0 -0
  317. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Utilities/sconsign.py +494 -0
  318. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/BoolVariable.py +96 -0
  319. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/EnumVariable.py +110 -0
  320. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/ListVariable.py +152 -0
  321. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PackageVariable.py +107 -0
  322. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/PathVariable.py +158 -0
  323. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Variables/__init__.py +334 -0
  324. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/Warnings.py +238 -0
  325. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/__init__.py +9 -0
  326. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/__init__.py +104 -0
  327. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/_scons_dbm.py +42 -0
  328. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/compat/win32.py +101 -0
  329. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/cpp.py +640 -0
  330. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/dblite.py +295 -0
  331. nuitka/build/inline_copy/lib/scons-4.3.0/SCons/exitfuncs.py +59 -0
  332. nuitka/build/inline_copy/markupsafe/LICENSE.rst +28 -0
  333. nuitka/build/inline_copy/markupsafe/markupsafe/__init__.py +327 -0
  334. nuitka/build/inline_copy/markupsafe/markupsafe/_compat.py +33 -0
  335. nuitka/build/inline_copy/markupsafe/markupsafe/_constants.py +264 -0
  336. nuitka/build/inline_copy/markupsafe/markupsafe/_native.py +69 -0
  337. nuitka/build/inline_copy/pefile/LICENSE.txt +21 -0
  338. nuitka/build/inline_copy/pefile/ordlookup/__init__.py +41 -0
  339. nuitka/build/inline_copy/pefile/ordlookup/oleaut32.py +400 -0
  340. nuitka/build/inline_copy/pefile/ordlookup/ws2_32.py +120 -0
  341. nuitka/build/inline_copy/pefile/pefile.py +8034 -0
  342. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +3272 -0
  343. nuitka/build/inline_copy/pkg_resources/pkg_resources/py31compat.py +21 -0
  344. nuitka/build/inline_copy/python_hacl/LICENSE.txt +201 -0
  345. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.c +1430 -0
  346. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_MD5.h +66 -0
  347. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.c +463 -0
  348. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA1.h +66 -0
  349. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.c +1273 -0
  350. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA2.h +204 -0
  351. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.c +734 -0
  352. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Hash_SHA3.h +131 -0
  353. nuitka/build/inline_copy/python_hacl/hacl_312/Hacl_Streaming_Types.h +83 -0
  354. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt128_Verified.h +346 -0
  355. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/FStar_UInt_8_16_32_64.h +107 -0
  356. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/fstar_uint128_struct_endianness.h +68 -0
  357. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/internal/target.h +293 -0
  358. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/lowstar_endianness.h +231 -0
  359. nuitka/build/inline_copy/python_hacl/hacl_312/include/krml/types.h +14 -0
  360. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_MD5.h +56 -0
  361. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA1.h +56 -0
  362. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA2.h +164 -0
  363. nuitka/build/inline_copy/python_hacl/hacl_312/internal/Hacl_Hash_SHA3.h +65 -0
  364. nuitka/build/inline_copy/python_hacl/hacl_312/python_hacl_namespaces.h +89 -0
  365. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  366. nuitka/build/inline_copy/stubgen/six.py +998 -0
  367. nuitka/build/inline_copy/stubgen/stubgen.py +484 -0
  368. nuitka/build/inline_copy/tqdm/tqdm/__init__.py +40 -0
  369. nuitka/build/inline_copy/tqdm/tqdm/_main.py +9 -0
  370. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +97 -0
  371. nuitka/build/inline_copy/tqdm/tqdm/_tqdm.py +9 -0
  372. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_notebook.py +9 -0
  373. nuitka/build/inline_copy/tqdm/tqdm/_tqdm_pandas.py +24 -0
  374. nuitka/build/inline_copy/tqdm/tqdm/_utils.py +12 -0
  375. nuitka/build/inline_copy/tqdm/tqdm/auto.py +44 -0
  376. nuitka/build/inline_copy/tqdm/tqdm/autonotebook.py +28 -0
  377. nuitka/build/inline_copy/tqdm/tqdm/dask.py +46 -0
  378. nuitka/build/inline_copy/tqdm/tqdm/notebook.py +316 -0
  379. nuitka/build/inline_copy/tqdm/tqdm/std.py +1524 -0
  380. nuitka/build/inline_copy/tqdm/tqdm/tk.py +207 -0
  381. nuitka/build/inline_copy/tqdm/tqdm/utils.py +351 -0
  382. nuitka/build/inline_copy/tqdm/tqdm/version.py +2 -0
  383. nuitka/build/inline_copy/yaml/LICENSE +20 -0
  384. nuitka/build/inline_copy/yaml/yaml/__init__.py +427 -0
  385. nuitka/build/inline_copy/yaml/yaml/composer.py +139 -0
  386. nuitka/build/inline_copy/yaml/yaml/constructor.py +748 -0
  387. nuitka/build/inline_copy/yaml/yaml/cyaml.py +101 -0
  388. nuitka/build/inline_copy/yaml/yaml/dumper.py +62 -0
  389. nuitka/build/inline_copy/yaml/yaml/emitter.py +1137 -0
  390. nuitka/build/inline_copy/yaml/yaml/error.py +75 -0
  391. nuitka/build/inline_copy/yaml/yaml/events.py +86 -0
  392. nuitka/build/inline_copy/yaml/yaml/loader.py +63 -0
  393. nuitka/build/inline_copy/yaml/yaml/nodes.py +49 -0
  394. nuitka/build/inline_copy/yaml/yaml/parser.py +589 -0
  395. nuitka/build/inline_copy/yaml/yaml/reader.py +185 -0
  396. nuitka/build/inline_copy/yaml/yaml/representer.py +389 -0
  397. nuitka/build/inline_copy/yaml/yaml/resolver.py +227 -0
  398. nuitka/build/inline_copy/yaml/yaml/scanner.py +1435 -0
  399. nuitka/build/inline_copy/yaml/yaml/serializer.py +111 -0
  400. nuitka/build/inline_copy/yaml/yaml/tokens.py +104 -0
  401. nuitka/build/inline_copy/zlib/LICENSE +22 -0
  402. nuitka/build/inline_copy/zlib/crc32.c +1049 -0
  403. nuitka/build/inline_copy/zlib/crc32.h +9446 -0
  404. nuitka/build/inline_copy/zlib/zconf.h +551 -0
  405. nuitka/build/inline_copy/zlib/zlib.h +1938 -0
  406. nuitka/build/inline_copy/zlib/zutil.h +275 -0
  407. nuitka/build/inline_copy/zstd/LICENSE.txt +30 -0
  408. nuitka/build/inline_copy/zstd/common/bitstream.h +463 -0
  409. nuitka/build/inline_copy/zstd/common/compiler.h +288 -0
  410. nuitka/build/inline_copy/zstd/common/cpu.h +213 -0
  411. nuitka/build/inline_copy/zstd/common/debug.h +107 -0
  412. nuitka/build/inline_copy/zstd/common/entropy_common.c +360 -0
  413. nuitka/build/inline_copy/zstd/common/error_private.c +56 -0
  414. nuitka/build/inline_copy/zstd/common/error_private.h +80 -0
  415. nuitka/build/inline_copy/zstd/common/fse.h +715 -0
  416. nuitka/build/inline_copy/zstd/common/fse_decompress.c +393 -0
  417. nuitka/build/inline_copy/zstd/common/huf.h +361 -0
  418. nuitka/build/inline_copy/zstd/common/mem.h +426 -0
  419. nuitka/build/inline_copy/zstd/common/xxhash.c +826 -0
  420. nuitka/build/inline_copy/zstd/common/xxhash.h +285 -0
  421. nuitka/build/inline_copy/zstd/common/zstd_common.c +83 -0
  422. nuitka/build/inline_copy/zstd/common/zstd_deps.h +111 -0
  423. nuitka/build/inline_copy/zstd/common/zstd_errors.h +95 -0
  424. nuitka/build/inline_copy/zstd/common/zstd_internal.h +478 -0
  425. nuitka/build/inline_copy/zstd/decompress/huf_decompress.c +1350 -0
  426. nuitka/build/inline_copy/zstd/decompress/zstd_ddict.c +244 -0
  427. nuitka/build/inline_copy/zstd/decompress/zstd_ddict.h +44 -0
  428. nuitka/build/inline_copy/zstd/decompress/zstd_decompress.c +1930 -0
  429. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.c +1540 -0
  430. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_block.h +62 -0
  431. nuitka/build/inline_copy/zstd/decompress/zstd_decompress_internal.h +190 -0
  432. nuitka/build/inline_copy/zstd/zstd.h +2391 -0
  433. nuitka/build/static_src/CompiledAsyncgenType.c +2211 -0
  434. nuitka/build/static_src/CompiledCellType.c +300 -0
  435. nuitka/build/static_src/CompiledCodeHelpers.c +2160 -0
  436. nuitka/build/static_src/CompiledCoroutineType.c +1946 -0
  437. nuitka/build/static_src/CompiledFrameType.c +1337 -0
  438. nuitka/build/static_src/CompiledFunctionType.c +3320 -0
  439. nuitka/build/static_src/CompiledGeneratorType.c +1997 -0
  440. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2117 -0
  441. nuitka/build/static_src/CompiledMethodType.c +614 -0
  442. nuitka/build/static_src/GenerateHeadersMain.c +30 -0
  443. nuitka/build/static_src/HelpersAllocator.c +939 -0
  444. nuitka/build/static_src/HelpersAttributes.c +1241 -0
  445. nuitka/build/static_src/HelpersBuiltin.c +901 -0
  446. nuitka/build/static_src/HelpersBuiltinTypeMethods.c +3594 -0
  447. nuitka/build/static_src/HelpersBytes.c +107 -0
  448. nuitka/build/static_src/HelpersCalling.c +397 -0
  449. nuitka/build/static_src/HelpersCallingGenerated.c +14361 -0
  450. nuitka/build/static_src/HelpersChecksumTools.c +59 -0
  451. nuitka/build/static_src/HelpersClasses.c +91 -0
  452. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  453. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  454. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  455. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  456. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  457. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  458. nuitka/build/static_src/HelpersComparisonEq.c +12070 -0
  459. nuitka/build/static_src/HelpersComparisonEqUtils.c +169 -0
  460. nuitka/build/static_src/HelpersComparisonGe.c +11871 -0
  461. nuitka/build/static_src/HelpersComparisonGt.c +11855 -0
  462. nuitka/build/static_src/HelpersComparisonLe.c +11957 -0
  463. nuitka/build/static_src/HelpersComparisonLt.c +11941 -0
  464. nuitka/build/static_src/HelpersComparisonNe.c +11979 -0
  465. nuitka/build/static_src/HelpersConsole.c +124 -0
  466. nuitka/build/static_src/HelpersConstantsBlob.c +1487 -0
  467. nuitka/build/static_src/HelpersDeepcopy.c +636 -0
  468. nuitka/build/static_src/HelpersDictionaries.c +1739 -0
  469. nuitka/build/static_src/HelpersDictionariesGenerated.c +738 -0
  470. nuitka/build/static_src/HelpersDumpBacktraces.c +63 -0
  471. nuitka/build/static_src/HelpersEnvironmentVariables.c +65 -0
  472. nuitka/build/static_src/HelpersEnvironmentVariablesSystem.c +97 -0
  473. nuitka/build/static_src/HelpersExceptions.c +298 -0
  474. nuitka/build/static_src/HelpersFiles.c +353 -0
  475. nuitka/build/static_src/HelpersFilesystemPaths.c +1322 -0
  476. nuitka/build/static_src/HelpersFloats.c +92 -0
  477. nuitka/build/static_src/HelpersHeapStorage.c +68 -0
  478. nuitka/build/static_src/HelpersImport.c +506 -0
  479. nuitka/build/static_src/HelpersImportHard.c +526 -0
  480. nuitka/build/static_src/HelpersJitSources.c +48 -0
  481. nuitka/build/static_src/HelpersLists.c +899 -0
  482. nuitka/build/static_src/HelpersListsGenerated.c +564 -0
  483. nuitka/build/static_src/HelpersMappings.c +46 -0
  484. nuitka/build/static_src/HelpersMatching.c +192 -0
  485. nuitka/build/static_src/HelpersOperationBinaryAdd.c +6477 -0
  486. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +703 -0
  487. nuitka/build/static_src/HelpersOperationBinaryBitand.c +2738 -0
  488. nuitka/build/static_src/HelpersOperationBinaryBitor.c +2738 -0
  489. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +2738 -0
  490. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +2406 -0
  491. nuitka/build/static_src/HelpersOperationBinaryDivmodUtils.c +33 -0
  492. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  493. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +2422 -0
  494. nuitka/build/static_src/HelpersOperationBinaryInplaceAdd.c +220 -0
  495. nuitka/build/static_src/HelpersOperationBinaryLshift.c +2846 -0
  496. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +453 -0
  497. nuitka/build/static_src/HelpersOperationBinaryMod.c +6549 -0
  498. nuitka/build/static_src/HelpersOperationBinaryMult.c +6438 -0
  499. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +125 -0
  500. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +2355 -0
  501. nuitka/build/static_src/HelpersOperationBinaryPow.c +2743 -0
  502. nuitka/build/static_src/HelpersOperationBinaryPowUtils.c +26 -0
  503. nuitka/build/static_src/HelpersOperationBinaryRshift.c +2706 -0
  504. nuitka/build/static_src/HelpersOperationBinarySub.c +2649 -0
  505. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +2415 -0
  506. nuitka/build/static_src/HelpersOperationInplaceAdd.c +5211 -0
  507. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +144 -0
  508. nuitka/build/static_src/HelpersOperationInplaceBitand.c +1826 -0
  509. nuitka/build/static_src/HelpersOperationInplaceBitor.c +1826 -0
  510. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +1826 -0
  511. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +2605 -0
  512. nuitka/build/static_src/HelpersOperationInplaceLshift.c +1594 -0
  513. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +603 -0
  514. nuitka/build/static_src/HelpersOperationInplaceMod.c +4762 -0
  515. nuitka/build/static_src/HelpersOperationInplaceMult.c +4689 -0
  516. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +2553 -0
  517. nuitka/build/static_src/HelpersOperationInplacePow.c +2807 -0
  518. nuitka/build/static_src/HelpersOperationInplaceRshift.c +1534 -0
  519. nuitka/build/static_src/HelpersOperationInplaceSub.c +2894 -0
  520. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +2612 -0
  521. nuitka/build/static_src/HelpersProfiling.c +104 -0
  522. nuitka/build/static_src/HelpersPythonPgo.c +113 -0
  523. nuitka/build/static_src/HelpersRaising.c +447 -0
  524. nuitka/build/static_src/HelpersSafeStrings.c +185 -0
  525. nuitka/build/static_src/HelpersSequences.c +134 -0
  526. nuitka/build/static_src/HelpersSlices.c +73 -0
  527. nuitka/build/static_src/HelpersStrings.c +998 -0
  528. nuitka/build/static_src/HelpersTuples.c +148 -0
  529. nuitka/build/static_src/HelpersTypes.c +329 -0
  530. nuitka/build/static_src/InspectPatcher.c +439 -0
  531. nuitka/build/static_src/MainProgram.c +2060 -0
  532. nuitka/build/static_src/MetaPathBasedLoader.c +2290 -0
  533. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +125 -0
  534. nuitka/build/static_src/MetaPathBasedLoaderResourceReader.c +158 -0
  535. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +785 -0
  536. nuitka/build/static_src/OnefileBootstrap.c +1580 -0
  537. nuitka/build/static_src/OnefileSplashScreen.cpp +275 -0
  538. nuitka/code_generation/AsyncgenCodes.py +186 -0
  539. nuitka/code_generation/AttributeCodes.py +357 -0
  540. nuitka/code_generation/BinaryOperationHelperDefinitions.py +720 -0
  541. nuitka/code_generation/BranchCodes.py +67 -0
  542. nuitka/code_generation/BuiltinCodes.py +529 -0
  543. nuitka/code_generation/CallCodes.py +1186 -0
  544. nuitka/code_generation/ClassCodes.py +156 -0
  545. nuitka/code_generation/CodeGeneration.py +1078 -0
  546. nuitka/code_generation/CodeHelperSelection.py +81 -0
  547. nuitka/code_generation/CodeHelpers.py +455 -0
  548. nuitka/code_generation/CodeObjectCodes.py +165 -0
  549. nuitka/code_generation/ComparisonCodes.py +569 -0
  550. nuitka/code_generation/ComparisonHelperDefinitions.py +146 -0
  551. nuitka/code_generation/ConditionalCodes.py +236 -0
  552. nuitka/code_generation/ConstantCodes.py +243 -0
  553. nuitka/code_generation/Contexts.py +1248 -0
  554. nuitka/code_generation/CoroutineCodes.py +253 -0
  555. nuitka/code_generation/CtypesCodes.py +46 -0
  556. nuitka/code_generation/DictCodes.py +918 -0
  557. nuitka/code_generation/Emission.py +75 -0
  558. nuitka/code_generation/ErrorCodes.py +281 -0
  559. nuitka/code_generation/EvalCodes.py +444 -0
  560. nuitka/code_generation/ExceptionCodes.py +337 -0
  561. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +227 -0
  562. nuitka/code_generation/ExpressionCodes.py +61 -0
  563. nuitka/code_generation/FrameCodes.py +518 -0
  564. nuitka/code_generation/FunctionCodes.py +858 -0
  565. nuitka/code_generation/GeneratorCodes.py +218 -0
  566. nuitka/code_generation/GlobalConstants.py +249 -0
  567. nuitka/code_generation/GlobalsLocalsCodes.py +211 -0
  568. nuitka/code_generation/IdCodes.py +53 -0
  569. nuitka/code_generation/ImportCodes.py +468 -0
  570. nuitka/code_generation/Indentation.py +45 -0
  571. nuitka/code_generation/IndexCodes.py +50 -0
  572. nuitka/code_generation/InjectCCodes.py +28 -0
  573. nuitka/code_generation/IntegerCodes.py +110 -0
  574. nuitka/code_generation/IteratorCodes.py +378 -0
  575. nuitka/code_generation/JitCodes.py +44 -0
  576. nuitka/code_generation/LabelCodes.py +68 -0
  577. nuitka/code_generation/LineNumberCodes.py +91 -0
  578. nuitka/code_generation/ListCodes.py +502 -0
  579. nuitka/code_generation/LoaderCodes.py +193 -0
  580. nuitka/code_generation/LocalsDictCodes.py +359 -0
  581. nuitka/code_generation/LoopCodes.py +88 -0
  582. nuitka/code_generation/MatchCodes.py +67 -0
  583. nuitka/code_generation/ModuleCodes.py +247 -0
  584. nuitka/code_generation/Namify.py +260 -0
  585. nuitka/code_generation/NetworkxCodes.py +51 -0
  586. nuitka/code_generation/OperationCodes.py +398 -0
  587. nuitka/code_generation/PackageResourceCodes.py +986 -0
  588. nuitka/code_generation/PrintCodes.py +93 -0
  589. nuitka/code_generation/PythonAPICodes.py +215 -0
  590. nuitka/code_generation/RaisingCodes.py +481 -0
  591. nuitka/code_generation/Reports.py +115 -0
  592. nuitka/code_generation/ReturnCodes.py +143 -0
  593. nuitka/code_generation/SetCodes.py +196 -0
  594. nuitka/code_generation/SliceCodes.py +465 -0
  595. nuitka/code_generation/StringCodes.py +303 -0
  596. nuitka/code_generation/SubscriptCodes.py +263 -0
  597. nuitka/code_generation/TensorflowCodes.py +54 -0
  598. nuitka/code_generation/TryCodes.py +326 -0
  599. nuitka/code_generation/TupleCodes.py +115 -0
  600. nuitka/code_generation/TypeAliasCodes.py +120 -0
  601. nuitka/code_generation/VariableCodes.py +519 -0
  602. nuitka/code_generation/VariableDeclarations.py +279 -0
  603. nuitka/code_generation/YieldCodes.py +253 -0
  604. nuitka/code_generation/__init__.py +19 -0
  605. nuitka/code_generation/c_types/CTypeBases.py +177 -0
  606. nuitka/code_generation/c_types/CTypeBooleans.py +104 -0
  607. nuitka/code_generation/c_types/CTypeCFloats.py +57 -0
  608. nuitka/code_generation/c_types/CTypeCLongs.py +45 -0
  609. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +109 -0
  610. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +150 -0
  611. nuitka/code_generation/c_types/CTypeNuitkaInts.py +200 -0
  612. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +107 -0
  613. nuitka/code_generation/c_types/CTypePyObjectPointers.py +572 -0
  614. nuitka/code_generation/c_types/CTypeVoids.py +92 -0
  615. nuitka/code_generation/c_types/__init__.py +19 -0
  616. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +106 -0
  617. nuitka/code_generation/templates/CodeTemplatesConstants.py +296 -0
  618. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +109 -0
  619. nuitka/code_generation/templates/CodeTemplatesExceptions.py +84 -0
  620. nuitka/code_generation/templates/CodeTemplatesFrames.py +235 -0
  621. nuitka/code_generation/templates/CodeTemplatesFunction.py +117 -0
  622. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +130 -0
  623. nuitka/code_generation/templates/CodeTemplatesIterators.py +40 -0
  624. nuitka/code_generation/templates/CodeTemplatesLoader.py +180 -0
  625. nuitka/code_generation/templates/CodeTemplatesModules.py +710 -0
  626. nuitka/code_generation/templates/CodeTemplatesVariables.py +388 -0
  627. nuitka/code_generation/templates/TemplateDebugWrapper.py +80 -0
  628. nuitka/code_generation/templates/__init__.py +19 -0
  629. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +321 -0
  630. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +143 -0
  631. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +677 -0
  632. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +165 -0
  633. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +38 -0
  634. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +41 -0
  635. nuitka/code_generation/templates_c/HelperBuiltinMethodOperation.c.j2 +53 -0
  636. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +364 -0
  637. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +37 -0
  638. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +53 -0
  639. nuitka/code_generation/templates_c/HelperObjectTools.c.j2 +20 -0
  640. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +148 -0
  641. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  642. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +352 -0
  643. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +115 -0
  644. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  645. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +31 -0
  646. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +32 -0
  647. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +112 -0
  648. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +157 -0
  649. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +115 -0
  650. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +99 -0
  651. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +115 -0
  652. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +281 -0
  653. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +420 -0
  654. nuitka/code_generation/templates_c/HelperSlotsBytes.c.j2 +51 -0
  655. nuitka/code_generation/templates_c/HelperSlotsCommon.c.j2 +71 -0
  656. nuitka/code_generation/templates_c/HelperSlotsFloat.c.j2 +327 -0
  657. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +411 -0
  658. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +59 -0
  659. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +229 -0
  660. nuitka/code_generation/templates_c/HelperSlotsSet.c.j2 +47 -0
  661. nuitka/code_generation/templates_c/HelperSlotsStr.c.j2 +55 -0
  662. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +58 -0
  663. nuitka/code_generation/templates_c/HelperSlotsUnicode.c.j2 +62 -0
  664. nuitka/containers/Namedtuples.py +51 -0
  665. nuitka/containers/OrderedDicts.py +191 -0
  666. nuitka/containers/OrderedSets.py +123 -0
  667. nuitka/containers/OrderedSetsFallback.py +139 -0
  668. nuitka/containers/__init__.py +19 -0
  669. nuitka/distutils/Build.py +76 -0
  670. nuitka/distutils/DistutilCommands.py +438 -0
  671. nuitka/distutils/__init__.py +19 -0
  672. nuitka/finalizations/Finalization.py +35 -0
  673. nuitka/finalizations/FinalizeMarkups.py +136 -0
  674. nuitka/finalizations/__init__.py +19 -0
  675. nuitka/freezer/DependsExe.py +257 -0
  676. nuitka/freezer/DllDependenciesCommon.py +97 -0
  677. nuitka/freezer/DllDependenciesMacOS.py +444 -0
  678. nuitka/freezer/DllDependenciesPosix.py +242 -0
  679. nuitka/freezer/DllDependenciesWin32.py +315 -0
  680. nuitka/freezer/ImportDetection.py +359 -0
  681. nuitka/freezer/IncludedDataFiles.py +689 -0
  682. nuitka/freezer/IncludedEntryPoints.py +376 -0
  683. nuitka/freezer/Onefile.py +296 -0
  684. nuitka/freezer/Standalone.py +520 -0
  685. nuitka/freezer/__init__.py +19 -0
  686. nuitka/importing/IgnoreListing.py +449 -0
  687. nuitka/importing/ImportCache.py +95 -0
  688. nuitka/importing/ImportResolving.py +186 -0
  689. nuitka/importing/Importing.py +1200 -0
  690. nuitka/importing/PreloadedPackages.py +164 -0
  691. nuitka/importing/Recursion.py +611 -0
  692. nuitka/importing/StandardLibrary.py +429 -0
  693. nuitka/importing/__init__.py +19 -0
  694. nuitka/nodes/AsyncgenNodes.py +107 -0
  695. nuitka/nodes/AttributeLookupNodes.py +124 -0
  696. nuitka/nodes/AttributeNodes.py +386 -0
  697. nuitka/nodes/AttributeNodesGenerated.py +10734 -0
  698. nuitka/nodes/BuiltinAllNodes.py +115 -0
  699. nuitka/nodes/BuiltinAnyNodes.py +124 -0
  700. nuitka/nodes/BuiltinComplexNodes.py +83 -0
  701. nuitka/nodes/BuiltinDecodingNodes.py +52 -0
  702. nuitka/nodes/BuiltinDecoratorNodes.py +85 -0
  703. nuitka/nodes/BuiltinDictNodes.py +140 -0
  704. nuitka/nodes/BuiltinFormatNodes.py +159 -0
  705. nuitka/nodes/BuiltinHashNodes.py +63 -0
  706. nuitka/nodes/BuiltinInputNodes.py +39 -0
  707. nuitka/nodes/BuiltinIntegerNodes.py +170 -0
  708. nuitka/nodes/BuiltinIteratorNodes.py +391 -0
  709. nuitka/nodes/BuiltinLenNodes.py +61 -0
  710. nuitka/nodes/BuiltinNextNodes.py +111 -0
  711. nuitka/nodes/BuiltinOpenNodes.py +148 -0
  712. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +7367 -0
  713. nuitka/nodes/BuiltinRangeNodes.py +690 -0
  714. nuitka/nodes/BuiltinRefNodes.py +314 -0
  715. nuitka/nodes/BuiltinSumNodes.py +104 -0
  716. nuitka/nodes/BuiltinTypeNodes.py +454 -0
  717. nuitka/nodes/BuiltinVarsNodes.py +44 -0
  718. nuitka/nodes/BytesNodes.py +829 -0
  719. nuitka/nodes/CallNodes.py +217 -0
  720. nuitka/nodes/Checkers.py +55 -0
  721. nuitka/nodes/ChildrenHavingMixins.py +21576 -0
  722. nuitka/nodes/ClassNodes.py +286 -0
  723. nuitka/nodes/CodeObjectSpecs.py +230 -0
  724. nuitka/nodes/ComparisonNodes.py +687 -0
  725. nuitka/nodes/ConditionalNodes.py +884 -0
  726. nuitka/nodes/ConstantRefNodes.py +1717 -0
  727. nuitka/nodes/ContainerMakingNodes.py +408 -0
  728. nuitka/nodes/ContainerOperationNodes.py +87 -0
  729. nuitka/nodes/CoroutineNodes.py +144 -0
  730. nuitka/nodes/CtypesNodes.py +51 -0
  731. nuitka/nodes/DictionaryNodes.py +1513 -0
  732. nuitka/nodes/ExceptionNodes.py +393 -0
  733. nuitka/nodes/ExecEvalNodes.py +229 -0
  734. nuitka/nodes/ExpressionBases.py +1301 -0
  735. nuitka/nodes/ExpressionBasesGenerated.py +2103 -0
  736. nuitka/nodes/ExpressionShapeMixins.py +886 -0
  737. nuitka/nodes/FrameNodes.py +413 -0
  738. nuitka/nodes/FunctionAttributeNodes.py +102 -0
  739. nuitka/nodes/FunctionNodes.py +1303 -0
  740. nuitka/nodes/FutureSpecs.py +224 -0
  741. nuitka/nodes/GeneratorNodes.py +201 -0
  742. nuitka/nodes/GlobalsLocalsNodes.py +209 -0
  743. nuitka/nodes/HardImportNodesGenerated.py +3599 -0
  744. nuitka/nodes/ImportHardNodes.py +185 -0
  745. nuitka/nodes/ImportNodes.py +1366 -0
  746. nuitka/nodes/IndicatorMixins.py +79 -0
  747. nuitka/nodes/InjectCNodes.py +51 -0
  748. nuitka/nodes/IterationHandles.py +407 -0
  749. nuitka/nodes/KeyValuePairNodes.py +378 -0
  750. nuitka/nodes/ListOperationNodes.py +525 -0
  751. nuitka/nodes/LocalsDictNodes.py +717 -0
  752. nuitka/nodes/LocalsScopes.py +505 -0
  753. nuitka/nodes/LoopNodes.py +445 -0
  754. nuitka/nodes/MatchNodes.py +60 -0
  755. nuitka/nodes/ModuleAttributeNodes.py +180 -0
  756. nuitka/nodes/ModuleNodes.py +1137 -0
  757. nuitka/nodes/NetworkxNodes.py +45 -0
  758. nuitka/nodes/NodeBases.py +890 -0
  759. nuitka/nodes/NodeMakingHelpers.py +481 -0
  760. nuitka/nodes/NodeMetaClasses.py +172 -0
  761. nuitka/nodes/OperatorNodes.py +944 -0
  762. nuitka/nodes/OperatorNodesUnary.py +403 -0
  763. nuitka/nodes/OsSysNodes.py +215 -0
  764. nuitka/nodes/OutlineNodes.py +372 -0
  765. nuitka/nodes/PackageMetadataNodes.py +982 -0
  766. nuitka/nodes/PackageResourceNodes.py +424 -0
  767. nuitka/nodes/PrintNodes.py +105 -0
  768. nuitka/nodes/ReturnNodes.py +255 -0
  769. nuitka/nodes/SideEffectNodes.py +139 -0
  770. nuitka/nodes/SliceNodes.py +386 -0
  771. nuitka/nodes/StatementBasesGenerated.py +3419 -0
  772. nuitka/nodes/StatementNodes.py +316 -0
  773. nuitka/nodes/StrNodes.py +919 -0
  774. nuitka/nodes/StringConcatenationNodes.py +103 -0
  775. nuitka/nodes/SubscriptNodes.py +245 -0
  776. nuitka/nodes/TensorflowNodes.py +38 -0
  777. nuitka/nodes/TryNodes.py +519 -0
  778. nuitka/nodes/TypeMatchNodes.py +65 -0
  779. nuitka/nodes/TypeNodes.py +390 -0
  780. nuitka/nodes/VariableAssignNodes.py +1177 -0
  781. nuitka/nodes/VariableDelNodes.py +320 -0
  782. nuitka/nodes/VariableNameNodes.py +153 -0
  783. nuitka/nodes/VariableRefNodes.py +895 -0
  784. nuitka/nodes/VariableReleaseNodes.py +153 -0
  785. nuitka/nodes/YieldNodes.py +121 -0
  786. nuitka/nodes/__init__.py +19 -0
  787. nuitka/nodes/shapes/BuiltinTypeShapes.py +4290 -0
  788. nuitka/nodes/shapes/ControlFlowDescriptions.py +199 -0
  789. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  790. nuitka/nodes/shapes/ShapeMixins.py +255 -0
  791. nuitka/nodes/shapes/StandardShapes.py +1384 -0
  792. nuitka/nodes/shapes/__init__.py +19 -0
  793. nuitka/optimizations/BytecodeDemotion.py +105 -0
  794. nuitka/optimizations/FunctionInlining.py +110 -0
  795. nuitka/optimizations/Graphs.py +70 -0
  796. nuitka/optimizations/Optimization.py +363 -0
  797. nuitka/optimizations/OptimizeBuiltinCalls.py +1582 -0
  798. nuitka/optimizations/Tags.py +76 -0
  799. nuitka/optimizations/TraceCollections.py +1257 -0
  800. nuitka/optimizations/ValueTraces.py +980 -0
  801. nuitka/optimizations/__init__.py +19 -0
  802. nuitka/pgo/PGO.py +160 -0
  803. nuitka/pgo/__init__.py +19 -0
  804. nuitka/plugins/PluginBase.py +1924 -0
  805. nuitka/plugins/Plugins.py +2007 -0
  806. nuitka/plugins/YamlPluginBase.py +121 -0
  807. nuitka/plugins/__init__.py +19 -0
  808. nuitka/plugins/standard/AntiBloatPlugin.py +1024 -0
  809. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +95 -0
  810. nuitka/plugins/standard/DataFilesPlugin.py +311 -0
  811. nuitka/plugins/standard/DelvewheelPlugin.py +150 -0
  812. nuitka/plugins/standard/DillPlugin/DillPlugin.c +37 -0
  813. nuitka/plugins/standard/DillPlugin/cloudpickle-postLoad.py +67 -0
  814. nuitka/plugins/standard/DillPlugin/dill-postLoad.py +223 -0
  815. nuitka/plugins/standard/DillPlugin.py +137 -0
  816. nuitka/plugins/standard/DllFilesPlugin.py +527 -0
  817. nuitka/plugins/standard/EnumPlugin.py +64 -0
  818. nuitka/plugins/standard/EventletPlugin.py +57 -0
  819. nuitka/plugins/standard/GeventPlugin.py +64 -0
  820. nuitka/plugins/standard/GiPlugin.py +118 -0
  821. nuitka/plugins/standard/GlfwPlugin.py +138 -0
  822. nuitka/plugins/standard/ImplicitImports.py +845 -0
  823. nuitka/plugins/standard/KivyPlugin.py +141 -0
  824. nuitka/plugins/standard/MatplotlibPlugin.py +256 -0
  825. nuitka/plugins/standard/MultiprocessingPlugin.py +199 -0
  826. nuitka/plugins/standard/NumpyPlugin.py +35 -0
  827. nuitka/plugins/standard/OptionsNannyPlugin.py +158 -0
  828. nuitka/plugins/standard/PbrPlugin.py +62 -0
  829. nuitka/plugins/standard/PkgResourcesPlugin.py +162 -0
  830. nuitka/plugins/standard/PlaywrightPlugin.py +179 -0
  831. nuitka/plugins/standard/PmwPlugin.py +248 -0
  832. nuitka/plugins/standard/PySidePyQtPlugin.py +1666 -0
  833. nuitka/plugins/standard/PywebViewPlugin.py +81 -0
  834. nuitka/plugins/standard/SpacyPlugin.py +137 -0
  835. nuitka/plugins/standard/TensorflowPlugin.py +35 -0
  836. nuitka/plugins/standard/TkinterPlugin.py +416 -0
  837. nuitka/plugins/standard/TorchPlugin.py +35 -0
  838. nuitka/plugins/standard/TransformersPlugin.py +121 -0
  839. nuitka/plugins/standard/TrioPlugin.py +33 -0
  840. nuitka/plugins/standard/UpxPlugin.py +174 -0
  841. nuitka/plugins/standard/__init__.py +19 -0
  842. nuitka/plugins/standard/standard.nuitka-package.config.yml +9313 -0
  843. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +78 -0
  844. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +468 -0
  845. nuitka/reports/CompilationReportReader.py +83 -0
  846. nuitka/reports/LicenseReport.rst.j2 +41 -0
  847. nuitka/reports/Reports.py +961 -0
  848. nuitka/reports/__init__.py +19 -0
  849. nuitka/specs/BuiltinBytesOperationSpecs.py +180 -0
  850. nuitka/specs/BuiltinDictOperationSpecs.py +82 -0
  851. nuitka/specs/BuiltinListOperationSpecs.py +80 -0
  852. nuitka/specs/BuiltinParameterSpecs.py +831 -0
  853. nuitka/specs/BuiltinStrOperationSpecs.py +181 -0
  854. nuitka/specs/BuiltinTypeOperationSpecs.py +34 -0
  855. nuitka/specs/BuiltinUnicodeOperationSpecs.py +123 -0
  856. nuitka/specs/HardImportSpecs.py +236 -0
  857. nuitka/specs/ParameterSpecs.py +630 -0
  858. nuitka/specs/__init__.py +19 -0
  859. nuitka/tools/Basics.py +55 -0
  860. nuitka/tools/__init__.py +19 -0
  861. nuitka/tools/commercial/__init__.py +21 -0
  862. nuitka/tools/data_composer/DataComposer.py +593 -0
  863. nuitka/tools/data_composer/__init__.py +19 -0
  864. nuitka/tools/data_composer/__main__.py +41 -0
  865. nuitka/tools/environments/CreateEnvironment.py +69 -0
  866. nuitka/tools/environments/Virtualenv.py +158 -0
  867. nuitka/tools/environments/__init__.py +19 -0
  868. nuitka/tools/general/__init__.py +19 -0
  869. nuitka/tools/general/dll_report/__init__.py +19 -0
  870. nuitka/tools/general/dll_report/__main__.py +83 -0
  871. nuitka/tools/general/find_module/FindModuleCode.py +127 -0
  872. nuitka/tools/general/find_module/__init__.py +19 -0
  873. nuitka/tools/general/generate_header/GenerateHeader.py +73 -0
  874. nuitka/tools/general/generate_header/__init__.py +19 -0
  875. nuitka/tools/onefile_compressor/OnefileCompressor.py +390 -0
  876. nuitka/tools/onefile_compressor/__init__.py +19 -0
  877. nuitka/tools/onefile_compressor/__main__.py +41 -0
  878. nuitka/tools/podman/Podman.py +55 -0
  879. nuitka/tools/podman/__init__.py +19 -0
  880. nuitka/tools/podman/__main__.py +425 -0
  881. nuitka/tools/profiler/__init__.py +19 -0
  882. nuitka/tools/profiler/__main__.py +93 -0
  883. nuitka/tools/scanning/DisplayDistributions.py +39 -0
  884. nuitka/tools/scanning/DisplayPackageDLLs.py +151 -0
  885. nuitka/tools/scanning/DisplayPackageData.py +73 -0
  886. nuitka/tools/scanning/__init__.py +19 -0
  887. nuitka/tools/specialize/CTypeDescriptions.py +1928 -0
  888. nuitka/tools/specialize/Common.py +380 -0
  889. nuitka/tools/specialize/SpecializeC.py +1483 -0
  890. nuitka/tools/specialize/SpecializePython.py +1151 -0
  891. nuitka/tools/specialize/__init__.py +19 -0
  892. nuitka/tools/testing/Common.py +2007 -0
  893. nuitka/tools/testing/Constructs.py +53 -0
  894. nuitka/tools/testing/DocTests.py +156 -0
  895. nuitka/tools/testing/OutputComparison.py +313 -0
  896. nuitka/tools/testing/Pythons.py +34 -0
  897. nuitka/tools/testing/RuntimeTracing.py +260 -0
  898. nuitka/tools/testing/SearchModes.py +208 -0
  899. nuitka/tools/testing/Valgrind.py +103 -0
  900. nuitka/tools/testing/__init__.py +19 -0
  901. nuitka/tools/testing/check_reference_counts/__init__.py +19 -0
  902. nuitka/tools/testing/check_reference_counts/__main__.py +107 -0
  903. nuitka/tools/testing/compare_with_cpython/__init__.py +19 -0
  904. nuitka/tools/testing/compare_with_cpython/__main__.py +942 -0
  905. nuitka/tools/testing/find_sxs_modules/__init__.py +19 -0
  906. nuitka/tools/testing/find_sxs_modules/__main__.py +73 -0
  907. nuitka/tools/testing/measure_construct_performance/__init__.py +19 -0
  908. nuitka/tools/testing/measure_construct_performance/__main__.py +288 -0
  909. nuitka/tools/testing/run_nuitka_tests/__init__.py +19 -0
  910. nuitka/tools/testing/run_nuitka_tests/__main__.py +1091 -0
  911. nuitka/tools/watch/AutoStage.py +145 -0
  912. nuitka/tools/watch/Common.py +55 -0
  913. nuitka/tools/watch/Conda.py +125 -0
  914. nuitka/tools/watch/GitHub.py +113 -0
  915. nuitka/tools/watch/Pacman.py +73 -0
  916. nuitka/tools/watch/Pipenv.py +145 -0
  917. nuitka/tools/watch/__init__.py +19 -0
  918. nuitka/tools/watch/__main__.py +615 -0
  919. nuitka/tree/Building.py +1459 -0
  920. nuitka/tree/ComplexCallHelperFunctions.py +2150 -0
  921. nuitka/tree/Extractions.py +48 -0
  922. nuitka/tree/FutureSpecState.py +71 -0
  923. nuitka/tree/InternalModule.py +96 -0
  924. nuitka/tree/Operations.py +45 -0
  925. nuitka/tree/ReformulationAssertStatements.py +97 -0
  926. nuitka/tree/ReformulationAssignmentStatements.py +1260 -0
  927. nuitka/tree/ReformulationBooleanExpressions.py +97 -0
  928. nuitka/tree/ReformulationCallExpressions.py +314 -0
  929. nuitka/tree/ReformulationClasses.py +407 -0
  930. nuitka/tree/ReformulationClasses3.py +1149 -0
  931. nuitka/tree/ReformulationComparisonExpressions.py +174 -0
  932. nuitka/tree/ReformulationContractionExpressions.py +676 -0
  933. nuitka/tree/ReformulationDictionaryCreation.py +304 -0
  934. nuitka/tree/ReformulationExecStatements.py +386 -0
  935. nuitka/tree/ReformulationForLoopStatements.py +215 -0
  936. nuitka/tree/ReformulationFunctionStatements.py +931 -0
  937. nuitka/tree/ReformulationImportStatements.py +333 -0
  938. nuitka/tree/ReformulationLambdaExpressions.py +185 -0
  939. nuitka/tree/ReformulationMatchStatements.py +797 -0
  940. nuitka/tree/ReformulationMultidist.py +80 -0
  941. nuitka/tree/ReformulationNamespacePackages.py +239 -0
  942. nuitka/tree/ReformulationPrintStatements.py +127 -0
  943. nuitka/tree/ReformulationSequenceCreation.py +438 -0
  944. nuitka/tree/ReformulationSubscriptExpressions.py +123 -0
  945. nuitka/tree/ReformulationTryExceptStatements.py +418 -0
  946. nuitka/tree/ReformulationTryFinallyStatements.py +239 -0
  947. nuitka/tree/ReformulationWhileLoopStatements.py +160 -0
  948. nuitka/tree/ReformulationWithStatements.py +382 -0
  949. nuitka/tree/ReformulationYieldExpressions.py +133 -0
  950. nuitka/tree/SourceHandling.py +476 -0
  951. nuitka/tree/SyntaxErrors.py +143 -0
  952. nuitka/tree/TreeHelpers.py +720 -0
  953. nuitka/tree/VariableClosure.py +483 -0
  954. nuitka/tree/__init__.py +19 -0
  955. nuitka/utils/AppDirs.py +104 -0
  956. nuitka/utils/CStrings.py +208 -0
  957. nuitka/utils/CommandLineOptions.py +207 -0
  958. nuitka/utils/Distributions.py +728 -0
  959. nuitka/utils/Download.py +217 -0
  960. nuitka/utils/Execution.py +517 -0
  961. nuitka/utils/FileOperations.py +1587 -0
  962. nuitka/utils/Hashing.py +137 -0
  963. nuitka/utils/Images.py +79 -0
  964. nuitka/utils/Importing.py +335 -0
  965. nuitka/utils/InlineCopies.py +52 -0
  966. nuitka/utils/InstalledPythons.py +254 -0
  967. nuitka/utils/InstanceCounters.py +86 -0
  968. nuitka/utils/Jinja2.py +158 -0
  969. nuitka/utils/Json.py +40 -0
  970. nuitka/utils/MacOSApp.py +134 -0
  971. nuitka/utils/MemoryUsage.py +165 -0
  972. nuitka/utils/ModuleNames.py +317 -0
  973. nuitka/utils/PackageResources.py +44 -0
  974. nuitka/utils/ReExecute.py +152 -0
  975. nuitka/utils/Rest.py +60 -0
  976. nuitka/utils/SharedLibraries.py +1014 -0
  977. nuitka/utils/Shebang.py +113 -0
  978. nuitka/utils/Signing.py +144 -0
  979. nuitka/utils/SlotMetaClasses.py +57 -0
  980. nuitka/utils/StaticLibraries.py +260 -0
  981. nuitka/utils/ThreadedExecutor.py +87 -0
  982. nuitka/utils/Timing.py +102 -0
  983. nuitka/utils/Utils.py +483 -0
  984. nuitka/utils/WindowsFileUsage.py +337 -0
  985. nuitka/utils/WindowsResources.py +652 -0
  986. nuitka/utils/Yaml.py +247 -0
  987. nuitka/utils/__init__.py +19 -0
  988. nuitka_winsvc-2.7.7.data/scripts/nuitka-run.cmd +24 -0
  989. nuitka_winsvc-2.7.7.data/scripts/nuitka.cmd +30 -0
  990. nuitka_winsvc-2.7.7.dist-info/METADATA +115 -0
  991. nuitka_winsvc-2.7.7.dist-info/RECORD +995 -0
  992. nuitka_winsvc-2.7.7.dist-info/WHEEL +5 -0
  993. nuitka_winsvc-2.7.7.dist-info/entry_points.txt +7 -0
  994. nuitka_winsvc-2.7.7.dist-info/licenses/LICENSE.txt +202 -0
  995. nuitka_winsvc-2.7.7.dist-info/top_level.txt +1 -0
nuitka/Options.py ADDED
@@ -0,0 +1,2948 @@
1
+ # Copyright 2025, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+
4
+ """Options module
5
+
6
+ This exposes the choices made by the user. Defaults will be applied here, and
7
+ some handling of defaults.
8
+
9
+ """
10
+
11
+ # These are for use in option values.
12
+ # spell-checker: ignore uiaccess,noannotations,reexecution,etherium
13
+ # spell-checker: ignore nodocstrings,noasserts,nowarnings,norandomization
14
+
15
+ import fnmatch
16
+ import os
17
+ import re
18
+ import shlex
19
+ import sys
20
+
21
+ from nuitka import Progress, Tracing
22
+ from nuitka.containers.OrderedDicts import OrderedDict
23
+ from nuitka.containers.OrderedSets import (
24
+ OrderedSet,
25
+ recommended_orderedset_package_name,
26
+ )
27
+ from nuitka.importing.StandardLibrary import isStandardLibraryPath
28
+ from nuitka.OptionParsing import (
29
+ parseOptions,
30
+ run_time_variable_names,
31
+ runSpecialCommandsFromOptions,
32
+ )
33
+ from nuitka.PythonFlavors import (
34
+ getPythonFlavorName,
35
+ isAnacondaPython,
36
+ isApplePython,
37
+ isArchPackagePython,
38
+ isCPythonOfficialPackage,
39
+ isDebianPackagePython,
40
+ isHomebrewPython,
41
+ isManyLinuxPython,
42
+ isMSYS2MingwPython,
43
+ isNuitkaPython,
44
+ isPyenvPython,
45
+ isPythonBuildStandalonePython,
46
+ isTermuxPython,
47
+ isUninstalledPython,
48
+ )
49
+ from nuitka.PythonVersions import (
50
+ getLaunchingSystemPrefixPath,
51
+ getNotYetSupportedPythonVersions,
52
+ getSupportedPythonVersions,
53
+ isDebugPython,
54
+ isPythonWithGil,
55
+ isStaticallyLinkedPython,
56
+ python_release_level,
57
+ python_version,
58
+ python_version_str,
59
+ )
60
+ from nuitka.utils.Execution import getExecutablePath
61
+ from nuitka.utils.FileOperations import (
62
+ getNormalizedPath,
63
+ getReportPath,
64
+ isLegalPath,
65
+ isNonLocalPath,
66
+ isPathExecutable,
67
+ openTextFile,
68
+ resolveShellPatternToFilenames,
69
+ )
70
+ from nuitka.utils.Images import checkIconUsage
71
+ from nuitka.utils.Importing import getInlineCopyFolder
72
+ from nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath
73
+ from nuitka.utils.Utils import (
74
+ getArchitecture,
75
+ getCPUCoreCount,
76
+ getLaunchingNuitkaProcessEnvironmentValue,
77
+ getLinuxDistribution,
78
+ getMacOSRelease,
79
+ getOS,
80
+ getWindowsRelease,
81
+ hasOnefileSupportedOS,
82
+ hasStandaloneSupportedOS,
83
+ isDebianBasedLinux,
84
+ isFreeBSD,
85
+ isLinux,
86
+ isMacOS,
87
+ isOpenBSD,
88
+ isPosixWindows,
89
+ isWin32OrPosixWindows,
90
+ isWin32Windows,
91
+ )
92
+ from nuitka.Version import getCommercialVersion, getNuitkaVersion
93
+
94
+ options = None
95
+ positional_args = None
96
+ extra_args = []
97
+ is_nuitka_run = None
98
+ is_debug = None
99
+ is_non_debug = None
100
+ is_full_compat = None
101
+ report_missing_code_helpers = None
102
+ report_missing_trust = None
103
+ is_verbose = None
104
+
105
+
106
+ def _convertOldStylePathSpecQuotes(value):
107
+ quote = None
108
+
109
+ result = ""
110
+ for c in value:
111
+ if c == "%":
112
+ if quote is None:
113
+ quote = "{"
114
+ result += quote
115
+ elif quote == "{":
116
+ result += "}"
117
+ quote = None
118
+ else:
119
+ result += c
120
+
121
+ return result
122
+
123
+
124
+ def checkPathSpec(value, arg_name, allow_disable):
125
+ # There are never enough checks here, pylint: disable=too-many-branches
126
+ old = value
127
+ value = _convertOldStylePathSpecQuotes(value)
128
+ if old != value:
129
+ Tracing.options_logger.warning(
130
+ "Adapted '%s' option value from legacy quoting style to '%s' -> '%s'"
131
+ % (arg_name, old, value)
132
+ )
133
+
134
+ # This changes the '/' to '\' on Windows at least.
135
+ value = getNormalizedPath(value)
136
+
137
+ if "\n" in value or "\r" in value:
138
+ Tracing.options_logger.sysexit(
139
+ "Using a new line in value '%s=%r' value is not allowed."
140
+ % (arg_name, value)
141
+ )
142
+
143
+ if "{NONE}" in value:
144
+ if not allow_disable:
145
+ Tracing.options_logger.sysexit(
146
+ "Using value '{NONE}' in '%s=%s' value is not allowed."
147
+ % (arg_name, value)
148
+ )
149
+
150
+ if value != "{NONE}":
151
+ Tracing.options_logger.sysexit(
152
+ "Using value '{NONE}' in '%s=%s' value does not allow anything else used too."
153
+ % (arg_name, value)
154
+ )
155
+
156
+ if "{NULL}" in value:
157
+ if not allow_disable:
158
+ Tracing.options_logger.sysexit(
159
+ "Using value '{NULL}' in '%s=%s' value is not allowed."
160
+ % (arg_name, value)
161
+ )
162
+
163
+ if value != "{NULL}":
164
+ Tracing.options_logger.sysexit(
165
+ "Using value '{NULL}' in '%s=%s' value does not allow anything else used too."
166
+ % (arg_name, value)
167
+ )
168
+
169
+ if "{COMPANY}" in value and not getCompanyName():
170
+ Tracing.options_logger.sysexit(
171
+ "Using value '{COMPANY}' in '%s=%s' value without being specified."
172
+ % (arg_name, value)
173
+ )
174
+
175
+ if "{PRODUCT}" in value and not getProductName():
176
+ Tracing.options_logger.sysexit(
177
+ "Using value '{PRODUCT}' in '%s=%s' value without being specified."
178
+ % (arg_name, value)
179
+ )
180
+
181
+ if "{VERSION}" in value and not (getFileVersionTuple() or getProductVersionTuple()):
182
+ Tracing.options_logger.sysexit(
183
+ "Using value '{VERSION}' in '%s=%s' value without being specified."
184
+ % (arg_name, value)
185
+ )
186
+
187
+ if value.count("{") != value.count("}"):
188
+ Tracing.options_logger.sysexit(
189
+ """Unmatched '{}' is wrong for '%s=%s' and may \
190
+ definitely not do what you want it to do."""
191
+ % (arg_name, value)
192
+ )
193
+
194
+ # Catch nested or illegal variable names.
195
+ var_name = None
196
+ for c in value:
197
+ if c in "{":
198
+ if var_name is not None:
199
+ Tracing.options_logger.sysexit(
200
+ """Nested '{' is wrong for '%s=%s'.""" % (arg_name, value)
201
+ )
202
+ var_name = ""
203
+ elif c == "}":
204
+ if var_name is None:
205
+ Tracing.options_logger.sysexit(
206
+ """Stray '}' is wrong for '%s=%s'.""" % (arg_name, value)
207
+ )
208
+
209
+ if var_name not in run_time_variable_names:
210
+ Tracing.onefile_logger.sysexit(
211
+ "Found unknown variable name '%s' in for '%s=%s'."
212
+ "" % (var_name, arg_name, value)
213
+ )
214
+
215
+ var_name = None
216
+ else:
217
+ if var_name is not None:
218
+ var_name += c
219
+
220
+ for candidate in (
221
+ "{PROGRAM}",
222
+ "{PROGRAM_BASE}",
223
+ "{PROGRAM_DIR}",
224
+ "{CACHE_DIR}",
225
+ "{HOME}",
226
+ "{TEMP}",
227
+ ):
228
+ if candidate in value[1:]:
229
+ Tracing.options_logger.sysexit(
230
+ """\
231
+ Absolute run time paths of '%s' can only be at the start of \
232
+ '%s=%s', using it in the middle of it is not allowed."""
233
+ % (candidate, arg_name, value)
234
+ )
235
+
236
+ if candidate == value:
237
+ Tracing.options_logger.sysexit(
238
+ """Cannot use folder '%s', may only be the \
239
+ start of '%s=%s', using that alone is not allowed."""
240
+ % (candidate, arg_name, value)
241
+ )
242
+
243
+ if value.startswith(candidate) and candidate != "{PROGRAM_BASE}":
244
+ if value[len(candidate)] != os.path.sep:
245
+ Tracing.options_logger.sysexit(
246
+ """Cannot use general system folder %s, without a path \
247
+ separator '%s=%s', just appending to these is not allowed, needs to be \
248
+ below them."""
249
+ % (candidate, arg_name, value)
250
+ )
251
+
252
+ is_legal, reason = isLegalPath(value)
253
+ if not is_legal:
254
+ Tracing.options_logger.sysexit(
255
+ """Cannot use illegal paths '%s=%s', due to %s."""
256
+ % (arg_name, value, reason)
257
+ )
258
+
259
+ return value
260
+
261
+
262
+ def _checkOnefileTargetSpec():
263
+ options.onefile_tempdir_spec = checkPathSpec(
264
+ options.onefile_tempdir_spec,
265
+ arg_name="--onefile-tempdir-spec",
266
+ allow_disable=False,
267
+ )
268
+
269
+ if os.path.normpath(options.onefile_tempdir_spec) == ".":
270
+ Tracing.options_logger.sysexit(
271
+ """\
272
+ Error, using '.' as a value for '--onefile-tempdir-spec' is not supported,
273
+ you cannot unpack the onefile payload into the same directory as the binary,
274
+ as that would overwrite it and cause locking issues as well."""
275
+ )
276
+
277
+ if options.onefile_tempdir_spec.count("{") == 0:
278
+ Tracing.options_logger.warning(
279
+ """Not using any variables for '--onefile-tempdir-spec' should only be \
280
+ done if your program absolutely needs to be in the same path always: '%s'"""
281
+ % options.onefile_tempdir_spec
282
+ )
283
+
284
+ if os.path.isabs(options.onefile_tempdir_spec):
285
+ Tracing.options_logger.warning(
286
+ """\
287
+ Using an absolute path should be avoided unless you are targeting a \
288
+ very well known environment: anchoring it with e.g. '{TEMP}', \
289
+ '{CACHE_DIR}' is recommended: You seemingly gave the value '%s'"""
290
+ % options.onefile_tempdir_spec
291
+ )
292
+ elif not options.onefile_tempdir_spec.startswith(
293
+ ("{TEMP}", "{HOME}", "{CACHE_DIR}", "{PROGRAM_DIR}")
294
+ ):
295
+ Tracing.options_logger.warning(
296
+ """\
297
+ Using a path relative to the onefile executable should be avoided \
298
+ unless you are targeting a very well known environment, anchoring \
299
+ it with e.g. '{TEMP}', '{CACHE_DIR}' is recommended: '%s'"""
300
+ % options.onefile_tempdir_spec
301
+ )
302
+
303
+
304
+ def _getVersionInformationValues():
305
+ yield getNuitkaVersion()
306
+ yield "Commercial: %s" % getCommercialVersion()
307
+ yield "Python: %s" % sys.version.split("\n", 1)[0]
308
+ yield "Flavor: %s" % getPythonFlavorName()
309
+ if python_version >= 0x3D0:
310
+ yield "GIL: %s" % ("yes" if isPythonWithGil() else "no")
311
+ yield "Executable: %s" % getReportPath(sys.executable)
312
+ yield "OS: %s" % getOS()
313
+ yield "Arch: %s" % getArchitecture()
314
+
315
+ if isLinux():
316
+ dist_name, dist_base, dist_version = getLinuxDistribution()
317
+
318
+ if dist_base is not None:
319
+ yield "Distribution: %s (based on %s) %s" % (
320
+ dist_name,
321
+ dist_base,
322
+ dist_version,
323
+ )
324
+ else:
325
+ yield "Distribution: %s %s" % (dist_name, dist_version)
326
+
327
+ if isWin32OrPosixWindows():
328
+ yield "WindowsRelease: %s" % getWindowsRelease()
329
+
330
+ if isMacOS():
331
+ yield "macOSRelease: %s" % getMacOSRelease()
332
+
333
+
334
+ def printVersionInformation():
335
+ print("\n".join(_getVersionInformationValues()))
336
+
337
+ from nuitka.build.SconsInterface import (
338
+ asBoolStr,
339
+ getCommonSconsOptions,
340
+ runScons,
341
+ )
342
+
343
+ scons_options, env_values = getCommonSconsOptions()
344
+ scons_options["compiler_version_mode"] = asBoolStr("true")
345
+
346
+ runScons(
347
+ scons_options=scons_options,
348
+ env_values=env_values,
349
+ scons_filename="CCompilerVersion.scons",
350
+ )
351
+
352
+
353
+ def _warnOnefileOnlyOption(option_name):
354
+ if not options.is_onefile:
355
+ if options.github_workflow_options and isMacOS() and shallCreateAppBundle():
356
+ Tracing.options_logger.info(
357
+ """\
358
+ Note: Using onefile mode specific option '%s' has no effect \
359
+ with macOS app bundles."""
360
+ % option_name
361
+ )
362
+ else:
363
+ Tracing.options_logger.warning(
364
+ """\
365
+ Using onefile mode specific option '%s' has no effect \
366
+ when '--mode=onefile' is not specified."""
367
+ % option_name
368
+ )
369
+
370
+
371
+ def _warnOSSpecificOption(option_name, *supported_os):
372
+ if getOS() not in supported_os:
373
+ if options.github_workflow_options:
374
+ Tracing.options_logger.info(
375
+ """\
376
+ Note: Using OS specific option '%s' has no effect on %s."""
377
+ % (option_name, getOS())
378
+ )
379
+ else:
380
+ Tracing.options_logger.warning(
381
+ """\
382
+ Using OS specific option '%s' has no effect on %s."""
383
+ % (option_name, getOS())
384
+ )
385
+
386
+
387
+ def _checkDataDirOptionValue(data_dir, option_name):
388
+ if "=" not in data_dir:
389
+ Tracing.options_logger.sysexit(
390
+ "Error, malformed '%s' value '%s' description, must specify a relative target path with '=' separating it."
391
+ % (option_name, data_dir)
392
+ )
393
+
394
+ src, dst = data_dir.split("=", 1)
395
+
396
+ if os.path.isabs(dst):
397
+ Tracing.options_logger.sysexit(
398
+ "Error, malformed '%s' value, must specify relative target path for data dir, not '%s' as in '%s'."
399
+ % (option_name, dst, data_dir)
400
+ )
401
+
402
+ if not os.path.isdir(src):
403
+ Tracing.options_logger.sysexit(
404
+ "Error, malformed '%s' value, must specify existing source data directory, not '%s' as in '%s'."
405
+ % (option_name, src, data_dir)
406
+ )
407
+
408
+
409
+ def parseArgs():
410
+ """Parse the command line arguments
411
+
412
+ :meta private:
413
+ """
414
+ # singleton with many cases checking the options right away.
415
+ # pylint: disable=global-statement,too-many-branches,too-many-locals,too-many-statements
416
+ global is_nuitka_run, options, positional_args, extra_args, is_debug, is_non_debug
417
+ global is_full_compat, report_missing_code_helpers, report_missing_trust, is_verbose
418
+
419
+ if os.name == "nt":
420
+ # Windows store Python's don't allow looking at the python, catch that.
421
+ try:
422
+ with openTextFile(sys.executable, "rb"):
423
+ pass
424
+ except OSError:
425
+ Tracing.general.sysexit(
426
+ """\
427
+ Error, the Python from Windows app store is not supported.""",
428
+ mnemonic="unsupported-windows-app-store-python",
429
+ )
430
+
431
+ is_nuitka_run, options, positional_args, extra_args = parseOptions(
432
+ logger=Tracing.options_logger
433
+ )
434
+
435
+ is_debug = _isDebug()
436
+ is_non_debug = not is_debug
437
+ is_full_compat = _isFullCompat()
438
+
439
+ if hasattr(options, "experimental"):
440
+ _experimental.update(options.experimental)
441
+
442
+ # Dedicated option for caches, ccache and bytecode
443
+ if options.disable_ccache:
444
+ options.disabled_caches.append("ccache")
445
+ if options.disable_bytecode_cache:
446
+ options.disabled_caches.append("bytecode")
447
+ if getattr(options, "disable_dll_dependency_cache", False):
448
+ options.disabled_caches.append("dll-dependencies")
449
+
450
+ report_missing_code_helpers = options.report_missing_code_helpers
451
+ report_missing_trust = options.report_missing_trust
452
+
453
+ if options.quiet or int(os.getenv("NUITKA_QUIET", "0")):
454
+ Tracing.setQuiet()
455
+
456
+ def _quoteArg(arg):
457
+ if arg.startswith("--"):
458
+ # Handle values too, TODO: Maybe know what arguments use paths at
459
+ # all and not rely on file existence checks.
460
+ if "=" in arg:
461
+ arg_name, value = arg.split("=", 1)
462
+
463
+ if os.path.exists(value) and isNonLocalPath(arg):
464
+ value = getReportPath(value)
465
+
466
+ if " " in value:
467
+ value = '"%s"' % value
468
+
469
+ return "%s=%s" % (arg_name, value)
470
+ else:
471
+ return arg
472
+ elif os.path.exists(arg) and isNonLocalPath(arg):
473
+ arg = getReportPath(arg)
474
+ if " " in arg:
475
+ arg = '"%s"' % arg
476
+
477
+ return arg
478
+ else:
479
+ return arg
480
+
481
+ # This will not return if a non-compiling command is given.
482
+ runSpecialCommandsFromOptions(options)
483
+
484
+ if not options.version:
485
+ Tracing.options_logger.info(
486
+ leader="Used command line options:",
487
+ message=" ".join(
488
+ Tracing.doNotBreakSpaces(_quoteArg(arg) for arg in sys.argv[1:])
489
+ ),
490
+ )
491
+
492
+ if (
493
+ getLaunchingNuitkaProcessEnvironmentValue("NUITKA_RE_EXECUTION")
494
+ and not isAllowedToReexecute()
495
+ ):
496
+ Tracing.general.sysexit(
497
+ "Error, not allowed to re-execute, but that has happened."
498
+ )
499
+
500
+ # Force to persist this one early.
501
+ getLaunchingSystemPrefixPath()
502
+
503
+ if options.progress_bar:
504
+ Progress.enableProgressBar()
505
+
506
+ if options.verbose_output:
507
+ Tracing.optimization_logger.setFileHandle(
508
+ # Can only have unbuffered binary IO in Python3, therefore not disabling buffering here.
509
+ openTextFile(options.verbose_output, "w", encoding="utf8")
510
+ )
511
+
512
+ options.verbose = True
513
+
514
+ is_verbose = options.verbose
515
+
516
+ Tracing.optimization_logger.is_quiet = not options.verbose
517
+
518
+ if options.version:
519
+ printVersionInformation()
520
+ sys.exit(0)
521
+
522
+ if options.clean_caches:
523
+ from nuitka.CacheCleanup import cleanCaches
524
+
525
+ cleanCaches()
526
+
527
+ if not positional_args:
528
+ sys.exit(0)
529
+
530
+ if options.show_inclusion_output:
531
+ Tracing.inclusion_logger.setFileHandle(
532
+ # Can only have unbuffered binary IO in Python3, therefore not disabling buffering here.
533
+ openTextFile(options.show_inclusion_output, "w", encoding="utf8")
534
+ )
535
+
536
+ options.show_inclusion = True
537
+
538
+ Tracing.progress_logger.is_quiet = not options.show_progress
539
+
540
+ if options.compilation_mode is not None:
541
+ if (
542
+ options.is_onefile
543
+ or options.is_standalone
544
+ or options.module_mode
545
+ or options.macos_create_bundle
546
+ ):
547
+ Tracing.options_logger.sysexit(
548
+ "Cannot use both '--mode=' and deprecated options that specify mode."
549
+ )
550
+
551
+ if options.compilation_mode == "onefile":
552
+ options.is_onefile = True
553
+ elif options.compilation_mode == "standalone":
554
+ options.is_standalone = True
555
+ elif options.compilation_mode == "module":
556
+ options.module_mode = True
557
+ elif options.compilation_mode == "package":
558
+ options.module_mode = True
559
+ elif options.compilation_mode == "app":
560
+ if isMacOS():
561
+ options.macos_create_bundle = True
562
+ else:
563
+ options.is_onefile = True
564
+ elif options.compilation_mode == "dll":
565
+ options.is_standalone = True
566
+ elif options.compilation_mode == "accelerated":
567
+ pass
568
+ else:
569
+ assert False, options.compilation_mode
570
+
571
+ # Onefile implies standalone build.
572
+ if options.is_onefile:
573
+ options.is_standalone = True
574
+
575
+ # macOS bundle implies standalone build.
576
+ if shallCreateAppBundle():
577
+ options.is_standalone = True
578
+
579
+ if isMacOS():
580
+ macos_target_arch = getMacOSTargetArch()
581
+
582
+ if macos_target_arch == "universal":
583
+ Tracing.options_logger.sysexit(
584
+ "Cannot create universal macOS binaries (yet), please pick an arch and create two binaries."
585
+ )
586
+
587
+ if (options.macos_target_arch or "native") != "native":
588
+ from nuitka.utils.SharedLibraries import (
589
+ hasUniversalOrMatchingMacOSArchitecture,
590
+ )
591
+
592
+ if not hasUniversalOrMatchingMacOSArchitecture(
593
+ os.path.realpath(sys.executable)
594
+ ):
595
+ Tracing.options_logger.sysexit(
596
+ """\
597
+ Cannot cross compile to other arch, using non-universal Python binaries \
598
+ for macOS. Please install the "universal" Python package as offered on \
599
+ the Python download page."""
600
+ )
601
+
602
+ # Standalone implies no_site build unless overridden, therefore put it
603
+ # at start of flags, so "site" can override it.
604
+ if options.is_standalone:
605
+ options.python_flags.insert(0, "no_site")
606
+
607
+ # Check onefile tempdir spec.
608
+ if options.onefile_tempdir_spec:
609
+ _warnOnefileOnlyOption("--onefile-tempdir-spec")
610
+
611
+ if options.is_onefile:
612
+ _checkOnefileTargetSpec()
613
+
614
+ # Check onefile splash image
615
+ if options.splash_screen_image:
616
+ if not os.path.exists(options.splash_screen_image):
617
+ Tracing.options_logger.sysexit(
618
+ "Error, splash screen image path '%s' does not exist."
619
+ % options.splash_screen_image
620
+ )
621
+
622
+ _warnOnefileOnlyOption("--onefile-windows-splash-screen-image")
623
+
624
+ if options.onefile_child_grace_time is not None:
625
+ if not options.onefile_child_grace_time.isdigit():
626
+ Tracing.options_logger.sysexit(
627
+ """\
628
+ Error, the value given for '--onefile-child-grace-time' must be integer."""
629
+ )
630
+
631
+ _warnOnefileOnlyOption("--onefile-child-grace-time")
632
+
633
+ if getShallIncludeExternallyDataFilePatterns():
634
+ _warnOnefileOnlyOption("--include-onefile-external-data")
635
+
636
+ if options.force_stdout_spec:
637
+ options.force_stdout_spec = checkPathSpec(
638
+ options.force_stdout_spec, "--force-stdout-spec", allow_disable=True
639
+ )
640
+
641
+ if options.force_stderr_spec:
642
+ options.force_stderr_spec = checkPathSpec(
643
+ options.force_stderr_spec, "--force-stderr-spec", allow_disable=True
644
+ )
645
+
646
+ # Provide a tempdir spec implies onefile tempdir, even on Linux.
647
+ # Standalone mode implies an executable, not importing "site" module, which is
648
+ # only for this machine, recursing to all modules, and even including the
649
+ # standard library.
650
+ if options.is_standalone:
651
+ if options.module_mode:
652
+ Tracing.options_logger.sysexit(
653
+ """\
654
+ Error, conflicting options, cannot make standalone module, only executable.
655
+
656
+ Modules are supposed to be imported to an existing Python installation, therefore it
657
+ makes no sense to include a Python runtime."""
658
+ )
659
+
660
+ for any_case_module in getShallFollowModules():
661
+ if any_case_module.startswith("."):
662
+ bad = True
663
+ else:
664
+ for char in "/\\:":
665
+ if char in any_case_module:
666
+ bad = True
667
+ break
668
+ else:
669
+ bad = False
670
+
671
+ if bad:
672
+ Tracing.options_logger.sysexit(
673
+ """\
674
+ Error, '--follow-import-to' takes only module names or patterns, not directory path '%s'."""
675
+ % any_case_module
676
+ )
677
+
678
+ for no_case_module in getShallFollowInNoCase():
679
+ if no_case_module.startswith("."):
680
+ bad = True
681
+ else:
682
+ for char in "/\\:":
683
+ if char in no_case_module:
684
+ bad = True
685
+ break
686
+ else:
687
+ bad = False
688
+
689
+ if bad:
690
+ Tracing.options_logger.sysexit(
691
+ """\
692
+ Error, '--nofollow-import-to' takes only module names or patterns, not directory path '%s'."""
693
+ % no_case_module
694
+ )
695
+
696
+ scons_python = getPythonPathForScons()
697
+
698
+ if scons_python is not None and not os.path.isfile(scons_python):
699
+ Tracing.options_logger.sysexit(
700
+ "Error, no such Python binary '%s', should be full path." % scons_python
701
+ )
702
+
703
+ output_filename = getOutputFilename()
704
+
705
+ if output_filename is not None:
706
+ if shallMakeModule():
707
+ Tracing.options_logger.sysexit(
708
+ """\
709
+ Error, may not module mode where filenames and modules matching are
710
+ mandatory."""
711
+ )
712
+ elif (
713
+ isStandaloneMode() and os.path.basename(output_filename) != output_filename
714
+ ):
715
+ Tracing.options_logger.sysexit(
716
+ """\
717
+ Error, output filename for standalone cannot contain a directory part."""
718
+ )
719
+
720
+ output_dir = os.path.dirname(output_filename) or "."
721
+
722
+ if not os.path.isdir(output_dir):
723
+ Tracing.options_logger.sysexit(
724
+ """\
725
+ Error, specified output directory does not exist, you have to create
726
+ it before using it: '%s' (from --output-filename='%s')."""
727
+ % (
728
+ output_dir,
729
+ output_filename,
730
+ )
731
+ )
732
+
733
+ if isLinux():
734
+ if len(getLinuxIconPaths()) > 1:
735
+ Tracing.options_logger.sysexit(
736
+ "Error, can only use one icon file on Linux."
737
+ )
738
+
739
+ if isMacOS():
740
+ if len(getMacOSIconPaths()) > 1:
741
+ Tracing.options_logger.sysexit(
742
+ "Error, can only use one icon file on macOS."
743
+ )
744
+
745
+ for icon_path in getWindowsIconPaths():
746
+ if "#" in icon_path and isWin32Windows():
747
+ icon_path, icon_index = icon_path.rsplit("#", 1)
748
+
749
+ if not icon_index.isdigit() or int(icon_index) < 0:
750
+ Tracing.options_logger.sysexit(
751
+ "Error, icon number in '%s#%s' not valid."
752
+ % (icon_path + "#" + icon_index)
753
+ )
754
+
755
+ if getWindowsIconExecutablePath():
756
+ Tracing.options_logger.sysexit(
757
+ "Error, can only use icons from template executable or from icon files, but not both."
758
+ )
759
+
760
+ icon_exe_path = getWindowsIconExecutablePath()
761
+ if icon_exe_path is not None and not os.path.exists(icon_exe_path):
762
+ Tracing.options_logger.sysexit(
763
+ "Error, icon path executable '%s' does not exist." % icon_exe_path
764
+ )
765
+
766
+ try:
767
+ file_version = getFileVersionTuple()
768
+ # Catch all the things, don't want any interface, pylint: disable=broad-except
769
+ except Exception:
770
+ Tracing.options_logger.sysexit(
771
+ "Error, file version must be a tuple of up to 4 integer values."
772
+ )
773
+
774
+ try:
775
+ product_version = getProductVersionTuple()
776
+ # Catch all the things, don't want any interface, pylint: disable=broad-except
777
+ except Exception:
778
+ Tracing.options_logger.sysexit(
779
+ "Error, product version must be a tuple of up to 4 integer values."
780
+ )
781
+
782
+ if getCompanyName() == "":
783
+ Tracing.options_logger.sysexit(
784
+ """Error, empty string is not an acceptable company name."""
785
+ )
786
+
787
+ if getProductName() == "":
788
+ Tracing.options_logger.sysexit(
789
+ """Error, empty string is not an acceptable product name."""
790
+ )
791
+
792
+ splash_screen_filename = getWindowsSplashScreen()
793
+
794
+ if splash_screen_filename is not None:
795
+ if not os.path.isfile(splash_screen_filename):
796
+ Tracing.options_logger.sysexit(
797
+ "Error, specified splash screen image '%s' does not exist."
798
+ % splash_screen_filename
799
+ )
800
+
801
+ if (
802
+ file_version
803
+ or product_version
804
+ or getWindowsVersionInfoStrings()
805
+ and isWin32Windows()
806
+ ):
807
+ if not (file_version or product_version) and getCompanyName():
808
+ Tracing.options_logger.sysexit(
809
+ "Error, company name and file or product version need to be given when any version information is given."
810
+ )
811
+
812
+ if isOnefileMode() and not hasOnefileSupportedOS():
813
+ Tracing.options_logger.sysexit(
814
+ "Error, unsupported OS for onefile '%s'." % getOS()
815
+ )
816
+
817
+ for module_pattern, _filename_pattern in getShallIncludePackageData():
818
+ if (
819
+ module_pattern.startswith("-")
820
+ or "/" in module_pattern
821
+ or "\\" in module_pattern
822
+ ):
823
+ Tracing.options_logger.sysexit(
824
+ "Error, '--include-package-data' needs module name or pattern as an argument, not '%s'."
825
+ % module_pattern
826
+ )
827
+
828
+ for module_pattern in getShallFollowModules():
829
+ if (
830
+ module_pattern.startswith("-")
831
+ or "/" in module_pattern
832
+ or "\\" in module_pattern
833
+ ):
834
+ Tracing.options_logger.sysexit(
835
+ "Error, '--follow-import-to' options needs module name or pattern as an argument, not '%s'."
836
+ % module_pattern
837
+ )
838
+ for module_pattern in getShallFollowInNoCase():
839
+ if (
840
+ module_pattern.startswith("-")
841
+ or "/" in module_pattern
842
+ or "\\" in module_pattern
843
+ ):
844
+ Tracing.options_logger.sysexit(
845
+ "Error, '--nofollow-import-to' options needs module name or pattern as an argument, not '%s'."
846
+ % module_pattern
847
+ )
848
+
849
+ for data_file_desc in options.data_files:
850
+ if "=" not in data_file_desc:
851
+ Tracing.options_logger.sysexit(
852
+ "Error, malformed data file description, must specify relative target path separated with '='."
853
+ )
854
+
855
+ if data_file_desc.count("=") == 1:
856
+ src, dst = data_file_desc.split("=", 1)
857
+ src = os.path.expanduser(src)
858
+ src_pattern = src
859
+ else:
860
+ src, dst, pattern = data_file_desc.split("=", 2)
861
+ src = os.path.expanduser(src)
862
+ src_pattern = os.path.join(src, pattern)
863
+
864
+ filenames = resolveShellPatternToFilenames(src_pattern)
865
+
866
+ if len(filenames) > 1 and not dst.endswith(("/", os.path.sep)):
867
+ Tracing.options_logger.sysexit(
868
+ "Error, pattern '%s' matches more than one file, but target has no trailing slash, not a directory."
869
+ % src
870
+ )
871
+
872
+ if not filenames:
873
+ Tracing.options_logger.sysexit(
874
+ "Error, '%s' does not match any files." % src
875
+ )
876
+
877
+ if os.path.isabs(dst):
878
+ Tracing.options_logger.sysexit(
879
+ "Error, must specify relative target path for data file, not absolute path '%s'."
880
+ % data_file_desc
881
+ )
882
+
883
+ for data_dir in options.data_dirs:
884
+ _checkDataDirOptionValue(data_dir=data_dir, option_name="--include-data-dir")
885
+
886
+ for data_dir in options.raw_dirs:
887
+ _checkDataDirOptionValue(data_dir=data_dir, option_name="--include-raw-dir")
888
+
889
+ for pattern in getShallFollowExtraFilePatterns():
890
+ if os.path.isdir(pattern):
891
+ Tracing.options_logger.sysexit(
892
+ "Error, pattern '%s' given to '--include-plugin-files' cannot be a directory name."
893
+ % pattern
894
+ )
895
+
896
+ for directory_name in getShallFollowExtra():
897
+ if not os.path.isdir(directory_name):
898
+ Tracing.options_logger.sysexit(
899
+ "Error, value '%s' given to '--include-plugin-directory' must be a directory name."
900
+ % directory_name
901
+ )
902
+
903
+ if isStandardLibraryPath(directory_name):
904
+ Tracing.options_logger.sysexit(
905
+ """\
906
+ Error, directory '%s' given to '--include-plugin-directory' must not be a \
907
+ standard library path. Use '--include-module' or '--include-package' \
908
+ options instead."""
909
+ % pattern
910
+ )
911
+
912
+ if options.static_libpython == "yes" and getSystemStaticLibPythonPath() is None:
913
+ usable, reason = _couldUseStaticLibPython()
914
+
915
+ Tracing.options_logger.sysexit(
916
+ """\
917
+ Error, a static libpython is either not found or not supported for \
918
+ this Python (%s) installation: %s"""
919
+ % (
920
+ getPythonFlavorName(),
921
+ (reason if not usable else "unknown reason"),
922
+ )
923
+ )
924
+
925
+ if shallUseStaticLibPython() and getSystemStaticLibPythonPath() is None:
926
+ Tracing.options_logger.sysexit(
927
+ """Error, usable static libpython is not found for this Python installation. You \
928
+ might be missing required packages. Disable with --static-libpython=no" if you don't \
929
+ want to install it."""
930
+ )
931
+
932
+ if isApplePython():
933
+ if isStandaloneMode():
934
+ Tracing.options_logger.sysexit(
935
+ """\
936
+ Error, on macOS, for standalone mode, Apple Python is not supported \
937
+ due to being tied to specific OS releases, use e.g. CPython instead \
938
+ which is available from https://www.python.org/downloads/macos/ for \
939
+ download. With that, your program will work on macOS 10.9 or higher."""
940
+ )
941
+
942
+ if str is bytes:
943
+ Tracing.options_logger.sysexit(
944
+ "Error, Apple Python 2.7 from macOS is not usable as per Apple decision, use e.g. CPython 2.7 instead."
945
+ )
946
+
947
+ if isStandaloneMode() and isLinux():
948
+ # Cyclic dependency
949
+ from nuitka.utils.SharedLibraries import (
950
+ checkPatchElfPresenceAndUsability,
951
+ )
952
+
953
+ checkPatchElfPresenceAndUsability(Tracing.options_logger)
954
+
955
+ pgo_executable = getPgoExecutable()
956
+ if pgo_executable and not isPathExecutable(pgo_executable):
957
+ Tracing.options_logger.sysexit(
958
+ "Error, path '%s' to binary to use for PGO is not executable."
959
+ % pgo_executable
960
+ )
961
+
962
+ if (
963
+ isOnefileMode()
964
+ and isTermuxPython()
965
+ and getExecutablePath("termux-elf-cleaner") is None
966
+ ):
967
+ Tracing.options_logger.sysexit(
968
+ """\
969
+ Error, onefile mode on Termux requires 'termux-elf-cleaner' to be installed, \
970
+ use 'pkg install termux-elf-cleaner' to use it."""
971
+ )
972
+
973
+ for user_yaml_filename in getUserProvidedYamlFiles():
974
+ if not os.path.exists(user_yaml_filename):
975
+ Tracing.options_logger.sysexit(
976
+ """\
977
+ Error, cannot find user provider yaml file '%s'."""
978
+ % user_yaml_filename
979
+ )
980
+
981
+ # This triggers checks inside that code
982
+ getCompilationReportUserData()
983
+
984
+
985
+ def commentArgs():
986
+ """Comment on options, where we know something is not having the intended effect.
987
+
988
+ :meta private:
989
+
990
+ """
991
+ # A ton of cases to consider, pylint: disable=too-many-branches,too-many-statements
992
+
993
+ # Check files to exist or be suitable first before giving other warnings.
994
+ for filename in getMainEntryPointFilenames():
995
+ if not os.path.exists(filename):
996
+ Tracing.general.sysexit("Error, file '%s' is not found." % filename)
997
+
998
+ if (
999
+ shallMakeModule()
1000
+ and os.path.normcase(os.path.basename(filename)) == "__init__.py"
1001
+ ):
1002
+ Tracing.general.sysexit(
1003
+ """\
1004
+ Error, to compile a package, specify its directory but, not the '__init__.py'."""
1005
+ )
1006
+
1007
+ # Inform the user about potential issues with the running version. e.g. unsupported
1008
+ # version.
1009
+ if python_version_str not in getSupportedPythonVersions():
1010
+ # Do not disturb run of automatic tests with, detected from the presence of
1011
+ # that environment variable.
1012
+ if "PYTHON" not in os.environ:
1013
+ Tracing.general.warning(
1014
+ """\
1015
+ The Python version '%s' is only experimentally supported by Nuitka '%s', \
1016
+ but an upcoming release will change that. In the mean time use Python \
1017
+ version '%s' instead or newer Nuitka."""
1018
+ % (
1019
+ python_version_str,
1020
+ getNuitkaVersion(),
1021
+ getSupportedPythonVersions()[-1],
1022
+ )
1023
+ )
1024
+
1025
+ if python_release_level not in ("final", "candidate"):
1026
+ if python_version_str not in getNotYetSupportedPythonVersions():
1027
+ Tracing.general.sysexit(
1028
+ """\
1029
+ Non-final versions '%s' '%s' are not supported by Nuitka, use the \
1030
+ final version instead."""
1031
+ % (python_version_str, python_release_level)
1032
+ )
1033
+
1034
+ if python_version_str in getNotYetSupportedPythonVersions():
1035
+ if python_release_level != "final" and not isExperimental(
1036
+ "python" + python_version_str
1037
+ ):
1038
+ Tracing.general.warning(
1039
+ """\
1040
+ The Python version '%s' '%s' is only experimentally supported by \
1041
+ and recommended only for use in Nuitka development and testing."""
1042
+ % (python_version_str, python_release_level)
1043
+ )
1044
+
1045
+ elif not isExperimental("python" + python_version_str):
1046
+ Tracing.general.sysexit(
1047
+ """\
1048
+ The Python version '%s' is not supported by Nuitka '%s', but an upcoming \
1049
+ release will add it. In the mean time use '%s' instead."""
1050
+ % (
1051
+ python_version_str,
1052
+ getNuitkaVersion(),
1053
+ getSupportedPythonVersions()[-1],
1054
+ )
1055
+ )
1056
+
1057
+ if not isPythonWithGil():
1058
+ Tracing.general.warning(
1059
+ """\
1060
+ The Python without GIL is only experimentally supported by \
1061
+ and recommended only for use in Nuitka development and testing."""
1062
+ )
1063
+
1064
+ default_reference_mode = (
1065
+ "runtime" if shallMakeModule() or isStandaloneMode() else "original"
1066
+ )
1067
+
1068
+ if getFileReferenceMode() is None:
1069
+ options.file_reference_mode = default_reference_mode
1070
+ else:
1071
+ if options.file_reference_mode != default_reference_mode:
1072
+ Tracing.options_logger.warning(
1073
+ "Using non-default file reference mode '%s' rather than '%s' may cause run time issues."
1074
+ % (getFileReferenceMode(), default_reference_mode)
1075
+ )
1076
+ else:
1077
+ Tracing.options_logger.info(
1078
+ "Using default file reference mode '%s' need not be specified."
1079
+ % default_reference_mode
1080
+ )
1081
+
1082
+ default_mode_name_mode = "runtime" if shallMakeModule() else "original"
1083
+
1084
+ if getModuleNameMode() is None:
1085
+ options.module_name_mode = default_mode_name_mode
1086
+ elif getModuleNameMode() == default_mode_name_mode:
1087
+ Tracing.options_logger.info(
1088
+ "Using module name mode '%s' need not be specified."
1089
+ % default_mode_name_mode
1090
+ )
1091
+
1092
+ # TODO: This could be done via a generic option attribute and iterating over
1093
+ # them all, but maybe that's too inflexible long term.
1094
+ if getWindowsIconExecutablePath():
1095
+ _warnOSSpecificOption("--windows-icon-from-exe", "Windows")
1096
+ if shallAskForWindowsAdminRights():
1097
+ _warnOSSpecificOption("--windows-uac-admin", "Windows")
1098
+ if shallAskForWindowsUIAccessRights():
1099
+ _warnOSSpecificOption("--windows-uac-uiaccess", "Windows")
1100
+ if getWindowsSplashScreen():
1101
+ _warnOSSpecificOption("--onefile-windows-splash-screen-image", "Windows")
1102
+ if isWindowsServiceMode():
1103
+ _warnOSSpecificOption("--windows-service", "Windows")
1104
+ if options.mingw64 is not None:
1105
+ _warnOSSpecificOption("--mingw64", "Windows")
1106
+ if options.msvc_version is not None:
1107
+ _warnOSSpecificOption("--msvc", "Windows")
1108
+ if options.macos_target_arch is not None:
1109
+ _warnOSSpecificOption("--macos-target-arch", "Darwin")
1110
+ if options.macos_create_bundle is not None:
1111
+ _warnOSSpecificOption("--macos-create-app-bundle", "Darwin")
1112
+ if options.macos_sign_identity is not None:
1113
+ _warnOSSpecificOption("--macos-sign-identity", "Darwin")
1114
+ if options.macos_sign_notarization is not None:
1115
+ _warnOSSpecificOption("--macos-sign-notarization", "Darwin")
1116
+ if getMacOSAppName():
1117
+ _warnOSSpecificOption("--macos-app-name", "Darwin")
1118
+ if getMacOSSignedAppName():
1119
+ _warnOSSpecificOption("--macos-signed-app-name", "Darwin")
1120
+ if getMacOSAppVersion():
1121
+ _warnOSSpecificOption("--macos-app-version", "Darwin")
1122
+ if getMacOSAppProtectedResourcesAccesses():
1123
+ _warnOSSpecificOption("--macos-app-protected-resource", "Darwin")
1124
+ if options.macos_app_mode is not None:
1125
+ _warnOSSpecificOption("--macos-app-mode", "Darwin")
1126
+ if options.macos_prohibit_multiple_instances:
1127
+ _warnOSSpecificOption("--macos-prohibit-multiple-instances", "Darwin")
1128
+
1129
+ if options.msvc_version:
1130
+ if isMSYS2MingwPython() or isPosixWindows():
1131
+ Tracing.options_logger.sysexit("Requesting MSVC on MSYS2 is not allowed.")
1132
+
1133
+ if isMingw64():
1134
+ Tracing.options_logger.sysexit(
1135
+ "Requesting both Windows specific compilers makes no sense."
1136
+ )
1137
+
1138
+ if getMsvcVersion() and getMsvcVersion() not in ("list", "latest"):
1139
+ if getMsvcVersion().count(".") != 1 or not all(
1140
+ x.isdigit() for x in getMsvcVersion().split(".")
1141
+ ):
1142
+ Tracing.options_logger.sysexit(
1143
+ "For '--msvc' only values 'latest', 'info', and 'X.Y' values are allowed, but not '%s'."
1144
+ % getMsvcVersion()
1145
+ )
1146
+
1147
+ try:
1148
+ getJobLimit()
1149
+ except ValueError:
1150
+ Tracing.options_logger.sysexit(
1151
+ "For '--jobs' value, use integer values only, not, but not '%s'."
1152
+ % options.jobs
1153
+ )
1154
+
1155
+ if isOnefileMode():
1156
+ standalone_mode = "onefile"
1157
+ elif isStandaloneMode():
1158
+ standalone_mode = "standalone"
1159
+ else:
1160
+ standalone_mode = None
1161
+
1162
+ if standalone_mode and not hasStandaloneSupportedOS():
1163
+ Tracing.options_logger.warning(
1164
+ "Standalone mode on %s is not known to be supported, might fail to work."
1165
+ % getOS()
1166
+ )
1167
+
1168
+ if options.follow_all is True and shallMakeModule():
1169
+ Tracing.optimization_logger.sysexit(
1170
+ """\
1171
+ In module mode you must follow modules more selectively, and e.g. should \
1172
+ not include standard library or all foreign modules or else it will fail \
1173
+ to work. You need to instead selectively add them with \
1174
+ '--follow-import-to=name' though."""
1175
+ )
1176
+
1177
+ if options.follow_all is True and standalone_mode:
1178
+ Tracing.options_logger.info(
1179
+ "Following all imports is the default for %s mode and need not be specified."
1180
+ % standalone_mode
1181
+ )
1182
+
1183
+ if options.follow_all is False and standalone_mode:
1184
+ Tracing.options_logger.warning(
1185
+ "Following no imports is unlikely to work for %s mode and should not be specified."
1186
+ % standalone_mode
1187
+ )
1188
+
1189
+ if options.follow_stdlib:
1190
+ if standalone_mode:
1191
+ Tracing.options_logger.warning(
1192
+ "Following imports to stdlib is the default in standalone mode.."
1193
+ )
1194
+ else:
1195
+ Tracing.options_logger.warning(
1196
+ "Following imports to stdlib not well tested and should not be specified."
1197
+ )
1198
+
1199
+ if (
1200
+ not shallCreatePythonPgoInput()
1201
+ and not isStandaloneMode()
1202
+ and not shallMakePackage()
1203
+ and options.follow_all is None
1204
+ and not options.follow_modules
1205
+ and not options.follow_stdlib
1206
+ and not options.include_modules
1207
+ and not options.include_packages
1208
+ and not options.include_extra
1209
+ and not options.follow_not_modules
1210
+ ):
1211
+ Tracing.options_logger.warning(
1212
+ """You did not specify to follow or include anything but main %s. Check options and \
1213
+ make sure that is intended."""
1214
+ % ("module" if shallMakeModule() else "program")
1215
+ )
1216
+
1217
+ if options.dependency_tool:
1218
+ Tracing.options_logger.warning(
1219
+ "Using removed option '--windows-dependency-tool' is deprecated and has no impact anymore."
1220
+ )
1221
+
1222
+ if shallMakeModule() and options.static_libpython == "yes":
1223
+ Tracing.options_logger.warning(
1224
+ "In module mode, providing '--static-libpython' has no effect, it's not used."
1225
+ )
1226
+
1227
+ options.static_libpython = "no"
1228
+
1229
+ if (
1230
+ not isCPgoMode()
1231
+ and not isPythonPgoMode()
1232
+ and (getPgoArgs() or getPgoExecutable())
1233
+ ):
1234
+ Tracing.optimization_logger.warning(
1235
+ "Providing PGO arguments without enabling PGO mode has no effect."
1236
+ )
1237
+
1238
+ if isCPgoMode():
1239
+ if isStandaloneMode():
1240
+ Tracing.optimization_logger.warning(
1241
+ """\
1242
+ Using C level PGO with standalone/onefile mode is not \
1243
+ currently working. Expect errors."""
1244
+ )
1245
+
1246
+ if shallMakeModule():
1247
+ Tracing.optimization_logger.warning(
1248
+ """\
1249
+ Using C level PGO with module mode is not currently \
1250
+ working. Expect errors."""
1251
+ )
1252
+
1253
+ if (
1254
+ options.static_libpython == "auto"
1255
+ and not shallMakeModule()
1256
+ and not shallUseStaticLibPython()
1257
+ and getSystemStaticLibPythonPath() is not None
1258
+ and not shallUsePythonDebug()
1259
+ ):
1260
+ Tracing.options_logger.info(
1261
+ """Detected static libpython to exist, consider '--static-libpython=yes' for better performance, \
1262
+ but errors may happen."""
1263
+ )
1264
+
1265
+ if not shallExecuteImmediately():
1266
+ if shallRunInDebugger():
1267
+ Tracing.options_logger.warning(
1268
+ "The '--debugger' option has no effect outside of '--debug' without '--run' option."
1269
+ )
1270
+
1271
+ # Check if the fallback is used, except for Python2 on Windows, where we cannot
1272
+ # have it.
1273
+ if hasattr(OrderedSet, "is_fallback") and not (
1274
+ isWin32Windows() and python_version < 0x360
1275
+ ):
1276
+ # spell-checker: ignore orderedset
1277
+ Tracing.general.warning(
1278
+ """\
1279
+ Using very slow fallback for ordered sets, please install '%s' \
1280
+ PyPI package for best Python compile time performance."""
1281
+ % recommended_orderedset_package_name
1282
+ )
1283
+
1284
+ if shallUsePythonDebug() and not isDebugPython():
1285
+ Tracing.general.sysexit(
1286
+ """\
1287
+ Error, for using the debug Python version, you need to run it will that version
1288
+ and not with the non-debug version.
1289
+ """
1290
+ )
1291
+
1292
+ if isMacOS() and shallCreateAppBundle() and not options.macos_icon_path:
1293
+ Tracing.options_logger.warning(
1294
+ """\
1295
+ For application bundles, you ought to specify an icon with '--macos-app-icon=...' \
1296
+ otherwise a dock icon may not be present. Specify the value as 'none' value \
1297
+ to disable this warning."""
1298
+ )
1299
+
1300
+ if (
1301
+ isMacOS()
1302
+ and shallUseSigningForNotarization()
1303
+ and getMacOSSigningIdentity() == "-"
1304
+ ):
1305
+ Tracing.general.sysexit(
1306
+ """\
1307
+ Error, need to provide signing identity with '--macos-sign-identity' for \
1308
+ notarization capable signature, the default identify 'ad-hoc' is not going \
1309
+ to work."""
1310
+ )
1311
+
1312
+ if (
1313
+ isWin32Windows()
1314
+ and 0x340 <= python_version < 0x380
1315
+ and getWindowsConsoleMode() != "disable"
1316
+ ):
1317
+ Tracing.general.warning(
1318
+ """\
1319
+ On Windows, support for input/output on the console Windows, does \
1320
+ not work on non-UTF8 systems, unless Python 3.8 or higher is used \
1321
+ but this is %s, so please consider upgrading, or disabling the \
1322
+ console window for deployment.
1323
+ """
1324
+ % python_version_str,
1325
+ mnemonic="old-python-windows-console",
1326
+ )
1327
+
1328
+ if shallMakeModule() and (getForcedStderrPath() or getForcedStdoutPath()):
1329
+ Tracing.general.warning(
1330
+ """\
1331
+ Extension modules do not control process outputs, therefore the \
1332
+ options '--force-stdout-spec' and '--force-stderr-spec' have no \
1333
+ impact and should not be specified."""
1334
+ )
1335
+
1336
+ if shallMakeModule() and options.console_mode is not None:
1337
+ Tracing.general.warning(
1338
+ """\
1339
+ Extension modules are not binaries, and therefore the option \
1340
+ '--windows-console-mode' does not have an impact and should \
1341
+ not be specified."""
1342
+ )
1343
+
1344
+ if options.disable_console in (True, False):
1345
+ if isWin32Windows():
1346
+ Tracing.general.warning(
1347
+ """\
1348
+ The old console option '%s' should not be given anymore, use '%s' \
1349
+ instead. It also has the extra mode 'attach' to consider."""
1350
+ % (
1351
+ (
1352
+ "--disable-console"
1353
+ if options.disable_console
1354
+ else "--enable-console"
1355
+ ),
1356
+ "--windows-console-mode=%s"
1357
+ % ("disable" if options.disable_console else "force"),
1358
+ )
1359
+ )
1360
+ else:
1361
+ Tracing.general.warning(
1362
+ """The old console option '%s' should not be given anymore, and doesn't
1363
+ have any effect anymore on non-Windows."""
1364
+ % (
1365
+ "--disable-console"
1366
+ if options.disable_console
1367
+ else "--enable-console"
1368
+ )
1369
+ )
1370
+
1371
+ if (
1372
+ isWin32Windows()
1373
+ and getWindowsVersionInfoStrings()
1374
+ and getProductFileVersion() is None
1375
+ ):
1376
+ Tracing.options_logger.sysexit(
1377
+ """\
1378
+ Error, when providing version information on Windows, you must also
1379
+ provide either '--product-version' or '--file-version' as these can
1380
+ not have good defaults, but are forced to be present by the OS."""
1381
+ )
1382
+
1383
+ if (
1384
+ options.macos_target_arch not in ("native", "universal", None)
1385
+ and getArchitecture() != options.macos_target_arch
1386
+ ):
1387
+ Tracing.options_logger.warning(
1388
+ """\
1389
+ Do not cross compile using '--macos-target-arch=%s, instead execute with '%s'."""
1390
+ % (
1391
+ Tracing.doNotBreakSpaces(
1392
+ options.macos_target_arch,
1393
+ "arch -%s %s" % (options.macos_target_arch, sys.executable),
1394
+ )
1395
+ )
1396
+ )
1397
+
1398
+
1399
+ def isVerbose():
1400
+ """:returns: bool derived from ``--verbose``"""
1401
+ return options is not None and options.verbose
1402
+
1403
+
1404
+ def shallTraceExecution():
1405
+ """:returns: bool derived from ``--trace-execution``"""
1406
+ return options.trace_execution
1407
+
1408
+
1409
+ def shallExecuteImmediately():
1410
+ """:returns: bool derived from ``--run``"""
1411
+ return options is not None and options.immediate_execution
1412
+
1413
+
1414
+ def shallRunInDebugger():
1415
+ """:returns: bool derived from ``--debug``"""
1416
+ return options.debugger
1417
+
1418
+
1419
+ def getXMLDumpOutputFilename():
1420
+ """:returns: str derived from ``--xml``"""
1421
+ return options.xml_output
1422
+
1423
+
1424
+ def shallOnlyExecCCompilerCall():
1425
+ """:returns: bool derived from ``--recompile-c-only``"""
1426
+ return options.recompile_c_only
1427
+
1428
+
1429
+ def shallNotDoExecCCompilerCall():
1430
+ """:returns: bool derived from ``--generate-c-only``"""
1431
+ return options.generate_c_only
1432
+
1433
+
1434
+ def getFileReferenceMode():
1435
+ """*str*, one of "runtime", "original", "frozen", coming from ``--file-reference-choice``
1436
+
1437
+ Notes:
1438
+ Defaults to runtime for modules and packages, as well as standalone binaries,
1439
+ otherwise original is kept.
1440
+ """
1441
+
1442
+ return options.file_reference_mode
1443
+
1444
+
1445
+ def getModuleNameMode():
1446
+ """*str*, one of "runtime", "original", coming from ``--module-name-choice``
1447
+
1448
+ Notes:
1449
+ Defaults to runtime for modules and packages, otherwise original is kept.
1450
+ """
1451
+
1452
+ return options.module_name_mode
1453
+
1454
+
1455
+ def shallMakeModule():
1456
+ """:returns: bool derived from ``--mode=module|package``."""
1457
+ return options is not None and options.module_mode
1458
+
1459
+
1460
+ def shallMakePackage():
1461
+ """:returns: bool derived from ``--mode=package``."""
1462
+ return options is not None and options.compilation_mode == "package"
1463
+
1464
+
1465
+ def isMakeOnefileDllMode():
1466
+ if not isOnefileMode():
1467
+ return False
1468
+
1469
+ if isExperimental("onefile-dll"):
1470
+ return True
1471
+ if isExperimental("onefile-no-dll"):
1472
+ return False
1473
+
1474
+ if options is not None and options.onefile_no_dll:
1475
+ return False
1476
+
1477
+ if isWin32Windows() and isOnefileTempDirMode():
1478
+ return True
1479
+
1480
+ # Static libpython is problematic on Linux still and macOS too seems to need
1481
+ # work, but there the DLL mode is not as useful yet anyway.
1482
+ return False
1483
+
1484
+
1485
+ def shallMakeDll():
1486
+ """:returns: bool derived from ``--mode=dll``."""
1487
+ return options is not None and (
1488
+ options.compilation_mode == "dll" or isMakeOnefileDllMode()
1489
+ )
1490
+
1491
+
1492
+ def shallMakeExe():
1493
+ """:returns: bool derived from not using ``--mode=dll|module|package`` ."""
1494
+ return not shallMakeModule() and not shallMakeDll()
1495
+
1496
+
1497
+ def shallCreatePyiFile():
1498
+ """*bool* = **not** ``--no-pyi-file``"""
1499
+ return options.pyi_file
1500
+
1501
+
1502
+ def shallCreatePyiFileContainStubs():
1503
+ """*bool* = **not** ``--no-pyi-stubs``"""
1504
+ return options.pyi_stubs
1505
+
1506
+
1507
+ def isAllowedToReexecute():
1508
+ """*bool* = **not** ``--must-not-re-execute``"""
1509
+ return options.allow_reexecute
1510
+
1511
+
1512
+ def shallFollowStandardLibrary():
1513
+ """:returns: bool derived from ``--follow-stdlib``"""
1514
+ return options.follow_stdlib
1515
+
1516
+
1517
+ def shallFollowNoImports():
1518
+ """:returns: bool derived from ``--nofollow-imports``"""
1519
+ return options.follow_all is False
1520
+
1521
+
1522
+ def shallFollowAllImports():
1523
+ """:returns: bool derived from ``--follow-imports``"""
1524
+ if shallCreatePythonPgoInput() and options.is_standalone:
1525
+ return True
1526
+
1527
+ return options.is_standalone or options.follow_all is True
1528
+
1529
+
1530
+ def _splitShellPattern(value):
1531
+ return value.split(",") if "{" not in value else [value]
1532
+
1533
+
1534
+ def getShallFollowInNoCase():
1535
+ """*list*, items of ``--nofollow-import-to=``"""
1536
+ return sum([_splitShellPattern(x) for x in options.follow_not_modules], [])
1537
+
1538
+
1539
+ def getShallFollowModules():
1540
+ """*list*, items of ``--follow-import-to=`` amended with what ``--include-module`` and ``--include-package`` got"""
1541
+ return sum(
1542
+ [
1543
+ _splitShellPattern(x)
1544
+ for x in options.follow_modules
1545
+ + options.include_modules
1546
+ + options.include_packages
1547
+ ],
1548
+ [],
1549
+ )
1550
+
1551
+
1552
+ def getShallFollowExtra():
1553
+ """*list*, items of ``--include-plugin-directory=``"""
1554
+ return sum([_splitShellPattern(x) for x in options.include_extra], [])
1555
+
1556
+
1557
+ def getShallFollowExtraFilePatterns():
1558
+ """*list*, items of ``--include-plugin-files=``"""
1559
+ return sum([_splitShellPattern(x) for x in options.include_extra_files], [])
1560
+
1561
+
1562
+ def getMustIncludeModules():
1563
+ """*list*, items of ``--include-module=``"""
1564
+ return OrderedSet(sum([_splitShellPattern(x) for x in options.include_modules], []))
1565
+
1566
+
1567
+ def getMustIncludePackages():
1568
+ """*list*, items of ``--include-package=``"""
1569
+ return OrderedSet(
1570
+ sum([_splitShellPattern(x) for x in options.include_packages], [])
1571
+ )
1572
+
1573
+
1574
+ def getShallIncludeDistributionMetadata():
1575
+ """*list*, items of ``--include-distribution-metadata=``"""
1576
+ return sum(
1577
+ [_splitShellPattern(x) for x in options.include_distribution_metadata], []
1578
+ )
1579
+
1580
+
1581
+ def getShallIncludePackageData():
1582
+ """*iterable of (module name, filename pattern)*, derived from ``--include-package-data=``
1583
+
1584
+ The filename pattern can be None if not given. Empty values give None too.
1585
+ """
1586
+ for package_data_pattern in sum(
1587
+ [_splitShellPattern(x) for x in options.package_data], []
1588
+ ):
1589
+ if ":" in package_data_pattern:
1590
+ module_pattern, filename_pattern = package_data_pattern.split(":", 1)
1591
+ # Empty equals None.
1592
+ filename_pattern = filename_pattern or None
1593
+ else:
1594
+ module_pattern = package_data_pattern
1595
+ filename_pattern = None
1596
+
1597
+ yield module_pattern, filename_pattern
1598
+
1599
+
1600
+ def getShallIncludeDataFiles():
1601
+ """*list*, items of ``--include-data-files=``"""
1602
+ for data_file_desc in options.data_files:
1603
+ if data_file_desc.count("=") == 1:
1604
+ src, dest = data_file_desc.split("=", 1)
1605
+
1606
+ for pattern in _splitShellPattern(src):
1607
+ pattern = os.path.expanduser(pattern)
1608
+
1609
+ yield pattern, None, dest, data_file_desc
1610
+ else:
1611
+ src, dest, pattern = data_file_desc.split("=", 2)
1612
+
1613
+ for pattern in _splitShellPattern(pattern):
1614
+ pattern = os.path.expanduser(pattern)
1615
+
1616
+ yield os.path.join(src, pattern), src, dest, data_file_desc
1617
+
1618
+
1619
+ def getShallIncludeDataDirs():
1620
+ """*list*, items of ``--include-data-dir=``"""
1621
+ for data_file in options.data_dirs:
1622
+ src, dest = data_file.split("=", 1)
1623
+
1624
+ yield src, dest
1625
+
1626
+
1627
+ def getShallIncludeRawDirs():
1628
+ """*list*, items of ``--include-raw-dir=``"""
1629
+ for data_file in options.raw_dirs:
1630
+ src, dest = data_file.split("=", 1)
1631
+
1632
+ yield src, dest
1633
+
1634
+
1635
+ def getShallNotIncludeDataFilePatterns():
1636
+ """*list*, items of ``--noinclude-data-files=``"""
1637
+
1638
+ return options.data_files_inhibited
1639
+
1640
+
1641
+ def getShallIncludeExternallyDataFilePatterns():
1642
+ """*list*, items of ``--include-data-files-external=``"""
1643
+
1644
+ return options.data_files_external
1645
+
1646
+
1647
+ def getShallNotIncludeDllFilePatterns():
1648
+ """*list*, items of ``--noinclude-dlls=``"""
1649
+
1650
+ return options.dll_files_inhibited
1651
+
1652
+
1653
+ def shallWarnImplicitRaises():
1654
+ """:returns: bool derived from ``--warn-implicit-exceptions``"""
1655
+ return options.warn_implicit_exceptions
1656
+
1657
+
1658
+ def shallWarnUnusualCode():
1659
+ """:returns: bool derived from ``--warn-unusual-code``"""
1660
+ return options.warn_unusual_code
1661
+
1662
+
1663
+ def assumeYesForDownloads():
1664
+ """:returns: bool derived from ``--assume-yes-for-downloads``"""
1665
+ return options is not None and options.assume_yes_for_downloads
1666
+
1667
+
1668
+ def _isDebug():
1669
+ """:returns: bool derived from ``--debug`` or ``--debugger``"""
1670
+ return options is not None and (options.debug or options.debugger)
1671
+
1672
+
1673
+ def shallUsePythonDebug():
1674
+ """:returns: bool derived from ``--python-debug`` or ``sys.flags.debug``
1675
+
1676
+ Passed to Scons as ``python_debug`` so it can consider it when picking
1677
+ link libraries to choose the correct variant. Also enables the define
1678
+ ``Py_DEBUG`` for C headers. Reference counting checks and other debug
1679
+ asserts of Python will happen in this mode.
1680
+
1681
+ """
1682
+ return options.python_debug or sys.flags.debug
1683
+
1684
+
1685
+ def isUnstripped():
1686
+ """:returns: bool derived from ``--unstripped`` or ``--profile``
1687
+
1688
+ A binary is called stripped when debug information is not present, an
1689
+ unstripped when it is present. For profiling and debugging it will be
1690
+ necessary, but it doesn't enable debug checks like ``--debug`` does.
1691
+
1692
+ Passed to Scons as ``unstripped_mode`` to it can ask the linker to
1693
+ include symbol information.
1694
+ """
1695
+ return options.unstripped or options.profile or is_debug
1696
+
1697
+
1698
+ def isProfile():
1699
+ """:returns: bool derived from ``--profile``"""
1700
+ return options.profile
1701
+
1702
+
1703
+ def shallCreateGraph():
1704
+ """:returns: bool derived from ``--internal-graph``"""
1705
+ return options.internal_graph
1706
+
1707
+
1708
+ def getOutputFilename():
1709
+ """*str*, value of "-o" """
1710
+ return options.output_filename
1711
+
1712
+
1713
+ def getOutputPath(path):
1714
+ """Return output pathname of a given path (filename)."""
1715
+ if options.output_dir:
1716
+ return getNormalizedPath(os.path.join(options.output_dir, path))
1717
+ else:
1718
+ return path
1719
+
1720
+
1721
+ def getOutputDir():
1722
+ """*str*, value of ``--output-dir`` or "." """
1723
+ return options.output_dir if options.output_dir else "."
1724
+
1725
+
1726
+ def getPositionalArgs():
1727
+ """*tuple*, command line positional arguments"""
1728
+ return tuple(positional_args)
1729
+
1730
+
1731
+ def getMainArgs():
1732
+ """*tuple*, arguments following the optional arguments"""
1733
+ return tuple(extra_args)
1734
+
1735
+
1736
+ def getMainEntryPointFilenames():
1737
+ """*tuple*, main programs, none, one or more"""
1738
+ if options.mains:
1739
+ if len(options.mains) == 1:
1740
+ assert not positional_args
1741
+
1742
+ result = tuple(options.mains)
1743
+ else:
1744
+ result = (positional_args[0],)
1745
+
1746
+ return tuple(getNormalizedPath(r) for r in result)
1747
+
1748
+
1749
+ def isMultidistMode():
1750
+ return options is not None and options.mains and len(options.mains) > 1
1751
+
1752
+
1753
+ def shallOptimizeStringExec():
1754
+ """Inactive yet"""
1755
+ return False
1756
+
1757
+
1758
+ _shall_use_static_lib_python = None
1759
+
1760
+
1761
+ def _couldUseStaticLibPython():
1762
+ # many cases and return driven,
1763
+ # pylint: disable=too-many-branches,too-many-return-statements
1764
+
1765
+ # Nuitka-Python is good to to static linking.
1766
+ if isNuitkaPython():
1767
+ return True, "Nuitka-Python is unexpectedly broken."
1768
+
1769
+ if isHomebrewPython():
1770
+ return True, "Homebrew Python is unexpectedly broken."
1771
+
1772
+ # Debian packages with are usable if the OS is new enough
1773
+ from nuitka.utils.StaticLibraries import isDebianSuitableForStaticLinking
1774
+
1775
+ if (
1776
+ isDebianBasedLinux()
1777
+ and isDebianPackagePython()
1778
+ and isDebianSuitableForStaticLinking()
1779
+ and not shallUsePythonDebug()
1780
+ ):
1781
+ if python_version >= 0x3C0 and not os.path.exists(
1782
+ getInlineCopyFolder("python_hacl")
1783
+ ):
1784
+ return (
1785
+ False,
1786
+ "Nuitka on Debian-Python needs inline copy of hacl not included.",
1787
+ )
1788
+
1789
+ return True, "Nuitka on Debian-Python needs package '%s' installed." % (
1790
+ "python2-dev" if str is bytes else "python3-dev"
1791
+ )
1792
+
1793
+ if isMSYS2MingwPython():
1794
+ return True, "Nuitka on MSYS2 needs package 'python-devel' installed."
1795
+
1796
+ # For Anaconda default to trying static lib python library, which
1797
+ # normally is just not available or if it is even unusable.
1798
+ if isAnacondaPython():
1799
+ if isMacOS():
1800
+ # TODO: Maybe some linker options can make it happen.
1801
+ return (
1802
+ False,
1803
+ "Anaconda on macOS exports not all symbols when using it.",
1804
+ )
1805
+ elif not isWin32Windows():
1806
+ return (
1807
+ True,
1808
+ """\
1809
+ Nuitka on Anaconda needs package for static libpython installed. \
1810
+ Execute 'conda install libpython-static'.""",
1811
+ )
1812
+
1813
+ if isPythonBuildStandalonePython():
1814
+ return (
1815
+ False,
1816
+ """\
1817
+ Static link library of '%s' is currently using dependent on libraries \
1818
+ such as tcl that are not included, but would be needed. Please help them \
1819
+ improve it for best performance of the result."""
1820
+ % getPythonFlavorName(),
1821
+ )
1822
+
1823
+ if isPyenvPython():
1824
+ return True, "Nuitka on pyenv should not use '--enable-shared'."
1825
+
1826
+ if isManyLinuxPython():
1827
+ return (
1828
+ True,
1829
+ """\
1830
+ Nuitka on 'manylinux' has no shared libraries. Use container with \
1831
+ the command 'RUN cd /opt/_internal && tar xf static-libs-for-embedding-only.tar.xz' \
1832
+ added to provide the static link library.""",
1833
+ )
1834
+
1835
+ if isMacOS() and isCPythonOfficialPackage():
1836
+ return True, None
1837
+
1838
+ if isArchPackagePython():
1839
+ return True, None
1840
+
1841
+ # If not dynamic link library is available, the static link library will
1842
+ # have to do it.
1843
+ if isStaticallyLinkedPython():
1844
+ return True, None
1845
+
1846
+ return None, None
1847
+
1848
+
1849
+ def _shallUseStaticLibPython():
1850
+ if shallMakeModule():
1851
+ return False, "not used in module mode"
1852
+
1853
+ if options.static_libpython == "auto":
1854
+ result = _couldUseStaticLibPython()
1855
+
1856
+ if result[0] is not None:
1857
+ return result
1858
+
1859
+ return options.static_libpython == "yes", None
1860
+
1861
+
1862
+ def shallUseStaticLibPython():
1863
+ """:returns: bool derived from ``--static-libpython=yes|auto`` and not module mode
1864
+
1865
+ Notes:
1866
+ Currently only Anaconda on non-Windows can do this and MSYS2.
1867
+ """
1868
+
1869
+ global _shall_use_static_lib_python # singleton, pylint: disable=global-statement
1870
+
1871
+ if _shall_use_static_lib_python is None:
1872
+ _shall_use_static_lib_python, reason = _shallUseStaticLibPython()
1873
+
1874
+ if _shall_use_static_lib_python and reason:
1875
+ static_libpython = getSystemStaticLibPythonPath()
1876
+
1877
+ if not static_libpython:
1878
+ Tracing.options_logger.sysexit(
1879
+ """\
1880
+ Automatic detection of static libpython failed. %s Disable with '--static-libpython=no' if you don't \
1881
+ want to install it."""
1882
+ % reason
1883
+ )
1884
+
1885
+ return _shall_use_static_lib_python
1886
+
1887
+
1888
+ def shallTreatUninstalledPython():
1889
+ """*bool* = derived from Python installation and modes
1890
+
1891
+ Notes:
1892
+ Not done for standalone mode obviously. The Python DLL will
1893
+ be a dependency of the executable and treated that way.
1894
+
1895
+ Also not done for extension modules, they are loaded with
1896
+ a Python runtime available.
1897
+
1898
+ Most often uninstalled Python versions are self compiled or
1899
+ from Anaconda.
1900
+ """
1901
+
1902
+ if shallMakeModule() or isStandaloneMode():
1903
+ return False
1904
+
1905
+ return isUninstalledPython()
1906
+
1907
+
1908
+ def shallCreateScriptFileForExecution():
1909
+ """*bool* = derived from Python installation and modes
1910
+
1911
+ Notes: Mostly for accelerated mode with uninstalled python, to make sure
1912
+ they find their Python DLL and Python packages.
1913
+ """
1914
+
1915
+ # TODO: Are we having a need for both names really?
1916
+ return shallTreatUninstalledPython()
1917
+
1918
+
1919
+ def isShowScons():
1920
+ """:returns: bool derived from ``--show-scons``"""
1921
+ return options.show_scons
1922
+
1923
+
1924
+ def getJobLimit():
1925
+ """*int*, value of ``--jobs`` / "-j" or number of CPU kernels"""
1926
+ jobs = options.jobs
1927
+
1928
+ # Low memory has a default of 1.
1929
+ if jobs is None and isLowMemory():
1930
+ return 1
1931
+
1932
+ if jobs is None:
1933
+ result = getCPUCoreCount()
1934
+ else:
1935
+ result = int(jobs)
1936
+
1937
+ if result <= 0:
1938
+ result = max(1, getCPUCoreCount() + result)
1939
+
1940
+ return result
1941
+
1942
+
1943
+ def getLtoMode():
1944
+ """:returns: bool derived from ``--lto``"""
1945
+ return options.lto
1946
+
1947
+
1948
+ def isClang():
1949
+ """:returns: bool derived from ``--clang`` or enforced by platform, e.g. macOS or FreeBSD some targets."""
1950
+
1951
+ return (
1952
+ options.clang
1953
+ or isMacOS()
1954
+ or isOpenBSD()
1955
+ or (isFreeBSD() and getArchitecture() != "powerpc")
1956
+ or isTermuxPython()
1957
+ )
1958
+
1959
+
1960
+ def isMingw64():
1961
+ """:returns: bool derived from ``--mingw64``, available only on Windows, otherwise false"""
1962
+ if isWin32Windows():
1963
+ return bool(options.mingw64 or isMSYS2MingwPython())
1964
+ else:
1965
+ return None
1966
+
1967
+
1968
+ def getMsvcVersion():
1969
+ """:returns: str derived from ``--msvc`` on Windows, otherwise None"""
1970
+ if isWin32Windows():
1971
+ return options.msvc_version
1972
+ else:
1973
+ return None
1974
+
1975
+
1976
+ def shallCleanCache(cache_name):
1977
+ """:returns: bool derived from ``--clean-cache``"""
1978
+
1979
+ if cache_name == "clcache":
1980
+ cache_name = "ccache"
1981
+
1982
+ return "all" in options.clean_caches or cache_name in options.clean_caches
1983
+
1984
+
1985
+ def shallDisableCacheUsage(cache_name):
1986
+ """:returns: bool derived from ``--disable-cache``"""
1987
+ if options is None:
1988
+ return False
1989
+
1990
+ return "all" in options.disabled_caches or cache_name in options.disabled_caches
1991
+
1992
+
1993
+ def shallDisableCCacheUsage():
1994
+ """:returns: bool derived from ``--disable-ccache`` or ``--disable--cache=ccache``"""
1995
+ return shallDisableCacheUsage("ccache")
1996
+
1997
+
1998
+ def shallDisableBytecodeCacheUsage():
1999
+ """:returns: bool derived from ``--disable-bytecode-cache``"""
2000
+ return shallDisableCacheUsage("bytecode")
2001
+
2002
+
2003
+ def shallDisableCompressionCacheUsage():
2004
+ """:returns: bool derived from ``--disable-cache=compression``"""
2005
+ return shallDisableCacheUsage("compression")
2006
+
2007
+
2008
+ def getWindowsConsoleMode():
2009
+ """:returns: str from ``--windows-console-mode``"""
2010
+ if options.disable_console is True:
2011
+ return "disable"
2012
+ if options.disable_console is False:
2013
+ return "force"
2014
+ return options.console_mode or "force"
2015
+
2016
+
2017
+ def _isFullCompat():
2018
+ """:returns: bool derived from ``--full-compat``
2019
+
2020
+ Notes:
2021
+ Code should should use "Options.is_full_compat" instead, this
2022
+ is only used to initialize that value.
2023
+ """
2024
+ return options is not None and not options.improved
2025
+
2026
+
2027
+ def isShowProgress():
2028
+ """:returns: bool derived from ``--show-progress``"""
2029
+ return options is not None and options.show_progress
2030
+
2031
+
2032
+ def isShowMemory():
2033
+ """:returns: bool derived from ``--show-memory``"""
2034
+ return options is not None and options.show_memory
2035
+
2036
+
2037
+ def isShowInclusion():
2038
+ """:returns: bool derived from ``--show-modules``"""
2039
+ return options.show_inclusion
2040
+
2041
+
2042
+ def isRemoveBuildDir():
2043
+ """:returns: bool derived from ``--remove-output``"""
2044
+ return options.remove_build and not options.generate_c_only
2045
+
2046
+
2047
+ def isDeploymentMode():
2048
+ """:returns: bool derived from ``--deployment``"""
2049
+ return options.is_deployment
2050
+
2051
+
2052
+ def getNoDeploymentIndications():
2053
+ """:returns: list derived from ``--no-deployment-flag``"""
2054
+ return options.no_deployment_flags
2055
+
2056
+
2057
+ _experimental = set()
2058
+
2059
+
2060
+ def isExperimental(indication):
2061
+ """Check whether a given experimental feature is enabled.
2062
+
2063
+ Args:
2064
+ indication: (str) feature name
2065
+ Returns:
2066
+ bool
2067
+ """
2068
+ return indication in _experimental
2069
+
2070
+
2071
+ def enableExperimental(indication):
2072
+ _experimental.add(indication)
2073
+
2074
+
2075
+ def getExperimentalIndications():
2076
+ """*tuple*, items of ``--experimental=``"""
2077
+ if hasattr(options, "experimental"):
2078
+ return options.experimental
2079
+ else:
2080
+ return ()
2081
+
2082
+
2083
+ def getDebugModeIndications():
2084
+ result = []
2085
+
2086
+ for debug_option_value_name in ("debug_immortal", "debug_c_warnings"):
2087
+ # Makes no sense prior Python3.12
2088
+ if debug_option_value_name == "debug_immortal" and python_version < 0x3C0:
2089
+ continue
2090
+
2091
+ if _isDebug():
2092
+ if getattr(options, debug_option_value_name) is not False:
2093
+ result.append(debug_option_value_name)
2094
+ else:
2095
+ if getattr(options, debug_option_value_name) is True:
2096
+ result.append(debug_option_value_name)
2097
+
2098
+ return result
2099
+
2100
+
2101
+ def shallExplainImports():
2102
+ """:returns: bool derived from ``--explain-imports``"""
2103
+ return options is not None and options.explain_imports
2104
+
2105
+
2106
+ def isStandaloneMode():
2107
+ """:returns: bool derived from ``--standalone``"""
2108
+ if shallCreatePythonPgoInput():
2109
+ return False
2110
+
2111
+ return bool(options.is_standalone or options.list_package_dlls)
2112
+
2113
+
2114
+ def isOnefileMode():
2115
+ """:returns: bool derived from ``--onefile``"""
2116
+ if shallCreatePythonPgoInput():
2117
+ return False
2118
+
2119
+ return bool(options.is_onefile)
2120
+
2121
+
2122
+ def isAcceleratedMode():
2123
+ """:returns: bool derived from ``--mode=accelerated``"""
2124
+ return not isStandaloneMode() and not shallMakeModule()
2125
+
2126
+
2127
+ def isOnefileTempDirMode():
2128
+ """:returns: bool derived from ``--onefile-tempdir-spec`` and ``--onefile-cache-mode``
2129
+
2130
+ Notes:
2131
+ Using cached onefile execution when the spec doesn't contain
2132
+ volatile things or forced by the user.
2133
+ """
2134
+ if not isOnefileMode():
2135
+ return False
2136
+
2137
+ if shallCreatePythonPgoInput():
2138
+ return False
2139
+
2140
+ if options.onefile_cached_mode == "auto":
2141
+ spec = getOnefileTempDirSpec()
2142
+
2143
+ for candidate in (
2144
+ "{PID}",
2145
+ "{TIME}",
2146
+ "{PROGRAM}",
2147
+ "{PROGRAM_BASE}",
2148
+ "{PROGRAM_DIR}",
2149
+ ):
2150
+ if candidate in spec:
2151
+ return True
2152
+ elif options.onefile_cached_mode == "temporary":
2153
+ return True
2154
+ elif options.onefile_cached_mode == "cached":
2155
+ return False
2156
+ else:
2157
+ assert False, options.onefile_cached_mode
2158
+
2159
+
2160
+ def isCPgoMode():
2161
+ """:returns: bool derived from ``--pgo-c``"""
2162
+ if shallCreatePythonPgoInput():
2163
+ return False
2164
+
2165
+ return options.is_c_pgo
2166
+
2167
+
2168
+ def isPythonPgoMode():
2169
+ """:returns: bool derived from ``--pgo-python``"""
2170
+ return options.is_python_pgo
2171
+
2172
+
2173
+ def getPythonPgoInput():
2174
+ """:returns: str derived from ``--pgo-python-input``"""
2175
+ return options.python_pgo_input
2176
+
2177
+
2178
+ def shallCreatePythonPgoInput():
2179
+ return isPythonPgoMode() and getPythonPgoInput() is None
2180
+
2181
+
2182
+ def getPgoArgs():
2183
+ """*list* = ``--pgo-args``"""
2184
+ return shlex.split(options.pgo_args)
2185
+
2186
+
2187
+ def getPgoExecutable():
2188
+ """*str* = ``--pgo-args``"""
2189
+
2190
+ if options.pgo_executable and os.path.exists(options.pgo_executable):
2191
+ if not os.path.isabs(options.pgo_executable):
2192
+ options.pgo_executable = os.path.join(".", options.pgo_executable)
2193
+
2194
+ return options.pgo_executable
2195
+
2196
+
2197
+ def getPythonPgoUnseenModulePolicy():
2198
+ """*str* = ``--python-pgo-unused-module-policy``"""
2199
+ return options.python_pgo_policy_unused_module
2200
+
2201
+
2202
+ def getOnefileTempDirSpec():
2203
+ """*str* = ``--onefile-tempdir-spec``"""
2204
+ result = (
2205
+ options.onefile_tempdir_spec or "{TEMP}" + os.path.sep + "onefile_{PID}_{TIME}"
2206
+ )
2207
+
2208
+ return result
2209
+
2210
+
2211
+ def getOnefileChildGraceTime():
2212
+ """*int* = ``--onefile-child-grace-time``"""
2213
+ return (
2214
+ int(options.onefile_child_grace_time)
2215
+ if options.onefile_child_grace_time is not None
2216
+ else 5000
2217
+ )
2218
+
2219
+
2220
+ def shallNotCompressOnefile():
2221
+ """*bool* = ``--onefile-no-compression``"""
2222
+ return options.onefile_no_compression
2223
+
2224
+
2225
+ def shallOnefileAsArchive():
2226
+ """*bool* = ``--onefile-as-archive``"""
2227
+ return options.onefile_as_archive
2228
+
2229
+
2230
+ def _checkIconPaths(icon_paths):
2231
+ icon_paths = tuple(icon_paths)
2232
+
2233
+ for icon_path in icon_paths:
2234
+ if not os.path.exists(icon_path):
2235
+ Tracing.options_logger.sysexit(
2236
+ "Error, icon path '%s' does not exist." % icon_path
2237
+ )
2238
+
2239
+ checkIconUsage(logger=Tracing.options_logger, icon_path=icon_path)
2240
+
2241
+ return icon_paths
2242
+
2243
+
2244
+ def getWindowsIconPaths():
2245
+ """*list of str*, values of ``--windows-icon-from-ico``"""
2246
+ if not isWin32Windows():
2247
+ return ()
2248
+
2249
+ return _checkIconPaths(options.windows_icon_path)
2250
+
2251
+
2252
+ def getLinuxIconPaths():
2253
+ """*list of str*, values of ``--linux-icon``"""
2254
+ result = options.linux_icon_path
2255
+
2256
+ # Check if Linux icon requirement is met.
2257
+ if isLinux() and not result and isOnefileMode():
2258
+ # spell-checker: ignore pixmaps
2259
+ default_icons = (
2260
+ "/usr/share/pixmaps/python%s.xpm" % python_version_str,
2261
+ "/usr/share/pixmaps/python%s.xpm" % sys.version_info[0],
2262
+ "/usr/share/pixmaps/python.xpm",
2263
+ )
2264
+
2265
+ for icon in default_icons:
2266
+ if os.path.exists(icon):
2267
+ result.append(icon)
2268
+ break
2269
+
2270
+ return _checkIconPaths(result)
2271
+
2272
+
2273
+ def getMacOSIconPaths():
2274
+ """*list of str*, values of ``--macos-app-icon``"""
2275
+ return _checkIconPaths(
2276
+ icon_path for icon_path in options.macos_icon_path if icon_path != "none"
2277
+ )
2278
+
2279
+
2280
+ def getWindowsIconExecutablePath():
2281
+ """*str* or *None* if not given, value of ``--windows-icon-from-exe``"""
2282
+ if not isWin32Windows():
2283
+ return None
2284
+
2285
+ return options.icon_exe_path
2286
+
2287
+
2288
+ def shallAskForWindowsAdminRights():
2289
+ """*bool*, value of ``--windows-uac-admin`` or ``--windows-uac-uiaccess``"""
2290
+ return options.windows_uac_admin
2291
+
2292
+
2293
+ def shallAskForWindowsUIAccessRights():
2294
+ """*bool*, value of ``--windows-uac-uiaccess``"""
2295
+ return options.windows_uac_uiaccess
2296
+
2297
+
2298
+ def getLegalCopyright():
2299
+ """*str* name of the product to use derived from ``--copyright``"""
2300
+ return options.legal_copyright
2301
+
2302
+
2303
+ def getLegalTrademarks():
2304
+ """*str* name of the product to use derived from ``--trademarks``"""
2305
+ return options.legal_trademarks
2306
+
2307
+
2308
+ def getLegalInformation():
2309
+ result = options.legal_copyright
2310
+
2311
+ if options.legal_trademarks:
2312
+ if result is not None:
2313
+ result += "\nTrademark information:" + options.legal_trademarks
2314
+ else:
2315
+ result = options.legal_trademarks
2316
+
2317
+ return result
2318
+
2319
+
2320
+ def isWindowsServiceMode():
2321
+ """*bool*, value of ``--windows-service``"""
2322
+ return options.windows_service
2323
+
2324
+
2325
+ def getWindowsServiceMetrics():
2326
+ """*dict of str*, values of ."""
2327
+ result = {}
2328
+ name = options.windows_service_name or getOutputFilename()
2329
+ if name:
2330
+ result['name'] = name
2331
+ display_name = options.windows_service_display_name or getProductName()
2332
+ if display_name:
2333
+ result['display_name'] = display_name
2334
+ description = options.windows_service_description or options.file_description
2335
+ if description:
2336
+ result['description'] = description
2337
+ cmdline = options.windows_service_cmdline
2338
+ if cmdline:
2339
+ result['cmdline'] = cmdline
2340
+ result['install'] = options.windows_service_install
2341
+ result['uninstall'] = options.windows_service_uninstall
2342
+ return result
2343
+
2344
+
2345
+ def getWindowsVersionInfoStrings():
2346
+ """*dict of str*, values of ."""
2347
+
2348
+ result = {}
2349
+
2350
+ company_name = getCompanyName()
2351
+ if company_name:
2352
+ result["CompanyName"] = company_name
2353
+
2354
+ product_name = getProductName()
2355
+ if product_name:
2356
+ result["ProductName"] = product_name
2357
+
2358
+ if options.file_description:
2359
+ result["FileDescription"] = options.file_description
2360
+
2361
+ if options.legal_copyright:
2362
+ result["LegalCopyright"] = options.legal_copyright
2363
+
2364
+ if options.legal_trademarks:
2365
+ result["LegalTrademarks"] = options.legal_trademarks
2366
+
2367
+ return result
2368
+
2369
+
2370
+ def _parseVersionNumber(value):
2371
+ if value:
2372
+ parts = value.split(".")
2373
+
2374
+ assert len(parts) <= 4
2375
+
2376
+ while len(parts) < 4:
2377
+ parts.append("0")
2378
+
2379
+ r = tuple(int(d) for d in parts)
2380
+ assert min(r) >= 0
2381
+ assert max(r) < 2**16
2382
+ return r
2383
+ else:
2384
+ return None
2385
+
2386
+
2387
+ def getProductVersion():
2388
+ """:returns: str, derived from ``--product-version``"""
2389
+ return options.product_version
2390
+
2391
+
2392
+ def getProductVersionTuple():
2393
+ """:returns: tuple of 4 ints or None, derived from ``--product-version``"""
2394
+ return _parseVersionNumber(options.product_version)
2395
+
2396
+
2397
+ def getFileVersion():
2398
+ """:returns str, derived from ``--file-version``"""
2399
+ return options.file_version
2400
+
2401
+
2402
+ def getFileVersionTuple():
2403
+ """:returns tuple of 4 ints or None, derived from ``--file-version``"""
2404
+ return _parseVersionNumber(options.file_version)
2405
+
2406
+
2407
+ def getProductFileVersion():
2408
+ if options.product_version:
2409
+ if options.file_version:
2410
+ return "%s-%s" % (options.product_version, options.file_version)
2411
+ else:
2412
+ return options.product_version
2413
+ else:
2414
+ return options.file_version
2415
+
2416
+
2417
+ def getWindowsSplashScreen():
2418
+ """:returns: bool derived from ``--onefile-windows-splash-screen-image``"""
2419
+ return options.splash_screen_image
2420
+
2421
+
2422
+ def getCompanyName():
2423
+ """*str* name of the company to use derived from ``--company-name``"""
2424
+ return options.company_name
2425
+
2426
+
2427
+ def getProductName():
2428
+ """*str* name of the product to use derived from ``--product-name``"""
2429
+ return options.product_name
2430
+
2431
+
2432
+ def getMacOSTargetArch():
2433
+ """:returns: str enum ("universal", "arm64", "x86_64") derived from ``--macos-target-arch`` value"""
2434
+ if options is None:
2435
+ macos_target_arch = "native"
2436
+ else:
2437
+ macos_target_arch = options.macos_target_arch or "native"
2438
+
2439
+ if macos_target_arch == "native":
2440
+ macos_target_arch = getArchitecture()
2441
+
2442
+ return macos_target_arch
2443
+
2444
+
2445
+ def shallCreateAppBundle():
2446
+ """*bool* shall create an application bundle, derived from ``--macos-create-app-bundle`` value"""
2447
+ if shallCreatePythonPgoInput():
2448
+ return False
2449
+
2450
+ return options.macos_create_bundle and isMacOS()
2451
+
2452
+
2453
+ def getMacOSSigningIdentity():
2454
+ """*str* value to use as identity for codesign, derived from ``--macos-sign-identity`` value"""
2455
+ result = options.macos_sign_identity
2456
+
2457
+ if result is None:
2458
+ result = "ad-hoc"
2459
+
2460
+ if result == "ad-hoc":
2461
+ result = "-"
2462
+
2463
+ return result
2464
+
2465
+
2466
+ def shallUseSigningForNotarization():
2467
+ """*bool* flag to use for codesign, derived from ``--macos-sign-notarization`` value"""
2468
+ return bool(options.macos_sign_notarization)
2469
+
2470
+
2471
+ def getMacOSAppName():
2472
+ """*str* name of the app to use bundle"""
2473
+ return options.macos_app_name
2474
+
2475
+
2476
+ def getMacOSSignedAppName():
2477
+ """*str* name of the app to use during signing"""
2478
+ return options.macos_signed_app_name
2479
+
2480
+
2481
+ def getMacOSAppVersion():
2482
+ """*str* version of the app to use for bundle"""
2483
+ return options.macos_app_version
2484
+
2485
+
2486
+ def getMacOSAppProtectedResourcesAccesses():
2487
+ """*list* key, value for protected resources of the app to use for bundle"""
2488
+ result = []
2489
+
2490
+ for macos_protected_resource in options.macos_protected_resources:
2491
+ if ":" not in macos_protected_resource:
2492
+ Tracing.options_logger.sysexit(
2493
+ """\
2494
+ Wrong format for '--macos-app-protected-resource' value '%s', it \
2495
+ needs to contain separator ':' with a description."""
2496
+ % macos_protected_resource
2497
+ )
2498
+ result.append(macos_protected_resource.split(":", 1))
2499
+
2500
+ return result
2501
+
2502
+
2503
+ def isMacOSBackgroundApp():
2504
+ """*bool*, derived from ``--macos-app-mode``"""
2505
+ return options.macos_app_mode == "background"
2506
+
2507
+
2508
+ def isMacOSUiElementApp():
2509
+ """*bool*, derived from ``--macos-app-mode``"""
2510
+ return options.macos_app_mode == "ui-element"
2511
+
2512
+
2513
+ def shallMacOSProhibitMultipleInstances():
2514
+ """*bool*, derived from ``--macos-prohibit-multiple-instances``"""
2515
+ if not isMacOS():
2516
+ return False
2517
+
2518
+ return options.macos_prohibit_multiple_instances
2519
+
2520
+
2521
+ _python_flags = None
2522
+
2523
+
2524
+ def _getPythonFlags():
2525
+ """*list*, values of ``--python-flag``"""
2526
+ # There is many flags, pylint: disable=too-many-branches
2527
+
2528
+ # singleton, pylint: disable=global-statement
2529
+ global _python_flags
2530
+
2531
+ if _python_flags is None:
2532
+ _python_flags = set()
2533
+
2534
+ for parts in options.python_flags:
2535
+ for part in parts.split(","):
2536
+ if part in ("-S", "nosite", "no_site"):
2537
+ _python_flags.add("no_site")
2538
+ elif part in ("site",):
2539
+ if "no_site" in _python_flags:
2540
+ _python_flags.remove("no_site")
2541
+ elif part in (
2542
+ "-R",
2543
+ "static_hashes",
2544
+ "norandomization",
2545
+ "no_randomization",
2546
+ ):
2547
+ _python_flags.add("no_randomization")
2548
+ elif part in ("-v", "trace_imports", "trace_import"):
2549
+ _python_flags.add("trace_imports")
2550
+ elif part in ("no_warnings", "nowarnings"):
2551
+ _python_flags.add("no_warnings")
2552
+ elif part in ("-O", "no_asserts", "noasserts"):
2553
+ _python_flags.add("no_asserts")
2554
+ elif part in ("no_docstrings", "nodocstrings"):
2555
+ _python_flags.add("no_docstrings")
2556
+ elif part in ("-OO",):
2557
+ _python_flags.add("no_docstrings")
2558
+ _python_flags.add("no_asserts")
2559
+ elif part in ("no_annotations", "noannotations"):
2560
+ _python_flags.add("no_annotations")
2561
+ elif part in ("unbuffered", "-u"):
2562
+ _python_flags.add("unbuffered")
2563
+ elif part in ("-m", "package_mode"):
2564
+ _python_flags.add("package_mode")
2565
+ elif part in ("-I", "isolated"):
2566
+ _python_flags.add("isolated")
2567
+ elif part in ("-B", "dont_write_bytecode", "dontwritebytecode"):
2568
+ _python_flags.add("dontwritebytecode")
2569
+ elif part in ("-P", "safe_path"):
2570
+ _python_flags.add("safe_path")
2571
+ else:
2572
+ Tracing.options_logger.sysexit(
2573
+ "Unsupported python flag '%s'." % part
2574
+ )
2575
+
2576
+ return _python_flags
2577
+
2578
+
2579
+ def hasPythonFlagNoSite():
2580
+ """*bool* = "no_site" in python flags given"""
2581
+
2582
+ return "no_site" in _getPythonFlags()
2583
+
2584
+
2585
+ def hasPythonFlagNoAnnotations():
2586
+ """*bool* = "no_annotations" in python flags given"""
2587
+
2588
+ return "no_annotations" in _getPythonFlags()
2589
+
2590
+
2591
+ def hasPythonFlagNoAsserts():
2592
+ """*bool* = "no_asserts" in python flags given"""
2593
+
2594
+ return "no_asserts" in _getPythonFlags()
2595
+
2596
+
2597
+ def hasPythonFlagNoDocStrings():
2598
+ """*bool* = "no_docstrings" in python flags given"""
2599
+
2600
+ return "no_docstrings" in _getPythonFlags()
2601
+
2602
+
2603
+ def hasPythonFlagNoWarnings():
2604
+ """*bool* = "no_warnings" in python flags given"""
2605
+
2606
+ return "no_warnings" in _getPythonFlags()
2607
+
2608
+
2609
+ def hasPythonFlagIsolated():
2610
+ """*bool* = "isolated" in python flags given"""
2611
+
2612
+ return "isolated" in _getPythonFlags()
2613
+
2614
+
2615
+ def hasPythonFlagTraceImports():
2616
+ """*bool* = "trace_imports", "-v" in python flags given"""
2617
+
2618
+ return "trace_imports" in _getPythonFlags()
2619
+
2620
+
2621
+ def hasPythonFlagNoRandomization():
2622
+ """*bool* = "no_randomization", "-R", "static_hashes" in python flags given"""
2623
+
2624
+ return "no_randomization" in _getPythonFlags()
2625
+
2626
+
2627
+ def hasPythonFlagNoBytecodeRuntimeCache():
2628
+ """*bool* = "dontwritebytecode", "-B" in python flags given"""
2629
+
2630
+ return "dontwritebytecode" in _getPythonFlags()
2631
+
2632
+
2633
+ def hasPythonFlagNoCurrentDirectoryInPath():
2634
+ """*bool* = "safe_path", "-P" in python flags given"""
2635
+
2636
+ return "safe_path" in _getPythonFlags()
2637
+
2638
+
2639
+ def hasPythonFlagUnbuffered():
2640
+ """*bool* = "unbuffered", "-u" in python flags given"""
2641
+
2642
+ return "unbuffered" in _getPythonFlags()
2643
+
2644
+
2645
+ def hasPythonFlagPackageMode():
2646
+ """*bool* = "package_mode", "-m" in python flags given"""
2647
+
2648
+ return "package_mode" in _getPythonFlags()
2649
+
2650
+
2651
+ def shallNotUseDependsExeCachedResults():
2652
+ """:returns: bool derived from ``--disable-dll-dependency-cache`` or ``--force-dll-dependency-cache-update``"""
2653
+ return shallNotStoreDependsExeCachedResults() or getattr(
2654
+ options, "update_dependency_cache", False
2655
+ )
2656
+
2657
+
2658
+ def shallNotStoreDependsExeCachedResults():
2659
+ """:returns: bool derived from ``--disable-dll-dependency-cache``"""
2660
+ return shallDisableCacheUsage("dll-dependencies")
2661
+
2662
+
2663
+ def getPluginNameConsideringRenames(plugin_name):
2664
+ """Name of the plugin with renames considered."""
2665
+
2666
+ # spell-checker: ignore delvewheel,pyzmq
2667
+
2668
+ if plugin_name == "etherium":
2669
+ return "ethereum"
2670
+ if plugin_name == "pyzmq":
2671
+ return "delvewheel"
2672
+
2673
+ return plugin_name
2674
+
2675
+
2676
+ def getPluginsEnabled():
2677
+ """*tuple*, user enabled (standard) plugins (not including user plugins)
2678
+
2679
+ Note:
2680
+ Do not use this outside of main binary, as plugins are allowed
2681
+ to activate plugins themselves and that will not be visible here.
2682
+ """
2683
+ result = OrderedSet()
2684
+
2685
+ if options:
2686
+ for plugin_enabled in options.plugins_enabled:
2687
+ result.update(
2688
+ getPluginNameConsideringRenames(plugin_name)
2689
+ for plugin_name in plugin_enabled.split(",")
2690
+ )
2691
+
2692
+ return tuple(result)
2693
+
2694
+
2695
+ def getPluginsDisabled():
2696
+ """*tuple*, user disabled (standard) plugins.
2697
+
2698
+ Note:
2699
+ Do not use this outside of main binary, as other plugins, e.g.
2700
+ hinted compilation will activate plugins themselves and this
2701
+ will not be visible here.
2702
+ """
2703
+ result = OrderedSet()
2704
+
2705
+ if options:
2706
+ for plugin_disabled in options.plugins_disabled:
2707
+ result.update(
2708
+ getPluginNameConsideringRenames(plugin_name)
2709
+ for plugin_name in plugin_disabled.split(",")
2710
+ )
2711
+
2712
+ return tuple(result)
2713
+
2714
+
2715
+ def getUserPlugins():
2716
+ """*tuple*, items user provided of ``--user-plugin=``"""
2717
+ if not options:
2718
+ return ()
2719
+
2720
+ return tuple(set(options.user_plugins))
2721
+
2722
+
2723
+ def shallDetectMissingPlugins():
2724
+ """*bool* = **not** ``--plugin-no-detection``"""
2725
+ return options is not None and options.detect_missing_plugins
2726
+
2727
+
2728
+ def getPythonPathForScons():
2729
+ """*str*, value of ``--python-for-scons``"""
2730
+ return options.python_scons
2731
+
2732
+
2733
+ def shallCompileWithoutBuildDirectory():
2734
+ """*bool* currently hard coded, not when using debugger.
2735
+
2736
+ When this is used, compilation is executed in a fashion that it runs
2737
+ inside the build folder, hiding it, attempting to make results more
2738
+ reproducible across builds of different programs.
2739
+
2740
+ TODO: Make this not hardcoded, but possible to disable via an
2741
+ options.
2742
+ """
2743
+ return not shallRunInDebugger()
2744
+
2745
+
2746
+ def shallPreferSourceCodeOverExtensionModules():
2747
+ """*bool* prefer source code over extension modules if both are there"""
2748
+ return options is not None and options.prefer_source_code
2749
+
2750
+
2751
+ def shallUseProgressBar():
2752
+ """*bool* prefer source code over extension modules if both are there"""
2753
+ return options.progress_bar
2754
+
2755
+
2756
+ def getForcedStdoutPath():
2757
+ """*str* force program stdout output into that filename"""
2758
+ if shallCreatePythonPgoInput():
2759
+ return False
2760
+
2761
+ return options.force_stdout_spec
2762
+
2763
+
2764
+ def getForcedStderrPath():
2765
+ """*str* force program stderr output into that filename"""
2766
+ if shallCreatePythonPgoInput():
2767
+ return False
2768
+
2769
+ return options.force_stderr_spec
2770
+
2771
+
2772
+ def shallShowSourceModifications(module_name):
2773
+ """*bool* display plugin source changes derived from --show-source-changes"""
2774
+ if options is None:
2775
+ return False
2776
+
2777
+ result, _reason = module_name.matchesToShellPatterns(options.show_source_changes)
2778
+
2779
+ return result
2780
+
2781
+
2782
+ def isLowMemory():
2783
+ """*bool* low memory usage requested"""
2784
+ return options.low_memory
2785
+
2786
+
2787
+ def getCompilationReportFilename():
2788
+ """*str* filename to write XML report of compilation to"""
2789
+ return options.compilation_report_filename
2790
+
2791
+
2792
+ def getCompilationReportTemplates():
2793
+ """*tuple of str,str* template and output filenames to write reports to"""
2794
+ result = []
2795
+ for value in options.compilation_report_templates:
2796
+ result.append(value.split(":", 1))
2797
+
2798
+ return tuple(result)
2799
+
2800
+
2801
+ def getCompilationReportUserData():
2802
+ result = OrderedDict()
2803
+
2804
+ for desc in options.compilation_report_user_data:
2805
+ if "=" not in desc:
2806
+ Tracing.options_logger.sysexit(
2807
+ "Error, user report data must be of key=value form not '%s'." % desc
2808
+ )
2809
+
2810
+ key, value = desc.split("=", 1)
2811
+
2812
+ if key in result and value != result[key]:
2813
+ Tracing.options_logger.sysexit(
2814
+ "Error, user report data key '%s' has been given conflicting values '%s' and '%s'."
2815
+ % (
2816
+ key,
2817
+ result[key],
2818
+ value,
2819
+ )
2820
+ )
2821
+
2822
+ if not re.match(
2823
+ r"^([_a-z][\w]?|[a-w_yz][\w]{2,}|[_a-z][a-l_n-z\d][\w]+|[_a-z][\w][a-k_m-z\d][\w]*)$",
2824
+ key,
2825
+ ):
2826
+ Tracing.options_logger.sysexit(
2827
+ "Error, user report data key '%s' is not valid as an XML tag, and therefore cannot be used."
2828
+ % key
2829
+ )
2830
+
2831
+ result[key] = value
2832
+
2833
+ return result
2834
+
2835
+
2836
+ def shallCreateDiffableCompilationReport():
2837
+ """*bool*" derived from --report-diffable"""
2838
+ return options.compilation_report_diffable
2839
+
2840
+
2841
+ def getUserProvidedYamlFiles():
2842
+ """*list* files with user provided Yaml files"""
2843
+ return options.user_yaml_files
2844
+
2845
+
2846
+ def _getWarningMnemonicsDisabled():
2847
+ return sum([_splitShellPattern(x) for x in options.nowarn_mnemonics], [])
2848
+
2849
+
2850
+ def shallDisplayWarningMnemonic(mnemonic):
2851
+ """*bool*" derived from --nowarn-mnemonic"""
2852
+ for pattern in _getWarningMnemonicsDisabled():
2853
+ if fnmatch.fnmatch(mnemonic, pattern):
2854
+ return False
2855
+
2856
+ return True
2857
+
2858
+
2859
+ def shallShowExecutedCommands():
2860
+ return isExperimental("show-commands")
2861
+
2862
+
2863
+ def getTargetPythonDescription():
2864
+ """:returns: tuple(python_version,OS/arch) string derived from ``--target``"""
2865
+ if options.target_spec is not None:
2866
+ # TODO: Only one we are working on right now.
2867
+ assert options.target_spec == "wasi"
2868
+
2869
+ return python_version, "wasi"
2870
+
2871
+ return None
2872
+
2873
+
2874
+ def getFcfProtectionMode():
2875
+ """:returns: string derived from ``--fcf-protection``"""
2876
+ return options.cf_protection
2877
+
2878
+
2879
+ def getModuleParameter(module_name, parameter_name):
2880
+ """:returns: string derived from ``--module-parameter``"""
2881
+
2882
+ module_name_prefix = module_name.getTopLevelPackageName().asString()
2883
+
2884
+ if parameter_name.startswith(module_name_prefix + "-"):
2885
+ option_name = parameter_name
2886
+ else:
2887
+ option_name = module_name_prefix + "-" + parameter_name
2888
+
2889
+ for module_option in options.module_parameters:
2890
+ try:
2891
+ module_option_name, module_option_value = module_option.split("=", 1)
2892
+ except ValueError:
2893
+ Tracing.optimization_logger.sysexit(
2894
+ """\
2895
+ Error, must specify module parameter name and value with a separating \
2896
+ '=' and not '%s"."""
2897
+ % module_option
2898
+ )
2899
+
2900
+ if option_name == module_option_name:
2901
+ return module_option_value
2902
+
2903
+ return None
2904
+
2905
+
2906
+ def getForcedRuntimeEnvironmentVariableValues():
2907
+ """:returns: iterable (string, string) derived from ``--force-runtime-environment-variable``"""
2908
+
2909
+ for forced_runtime_env_variables_spec in options.forced_runtime_env_variables:
2910
+ name, value = forced_runtime_env_variables_spec.split("=", 1)
2911
+
2912
+ yield (name, value)
2913
+
2914
+
2915
+ def getCompilationMode():
2916
+ """For reporting only, use shorter specific tests."""
2917
+ # return driven, pylint: disable=too-many-return-statements
2918
+
2919
+ if isAcceleratedMode():
2920
+ return "accelerated"
2921
+ elif shallMakeModule():
2922
+ return "module"
2923
+ elif shallMakePackage():
2924
+ return "package"
2925
+ elif shallCreateAppBundle():
2926
+ return "app"
2927
+ elif isOnefileMode():
2928
+ return "onefile"
2929
+ elif isStandaloneMode():
2930
+ return "standalone"
2931
+ elif shallMakeDll():
2932
+ return "dll"
2933
+
2934
+
2935
+ # Part of "Nuitka", an optimizing Python compiler that is compatible and
2936
+ # integrates with CPython, but also works on its own.
2937
+ #
2938
+ # Licensed under the Apache License, Version 2.0 (the "License");
2939
+ # you may not use this file except in compliance with the License.
2940
+ # You may obtain a copy of the License at
2941
+ #
2942
+ # http://www.apache.org/licenses/LICENSE-2.0
2943
+ #
2944
+ # Unless required by applicable law or agreed to in writing, software
2945
+ # distributed under the License is distributed on an "AS IS" BASIS,
2946
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2947
+ # See the License for the specific language governing permissions and
2948
+ # limitations under the License.