Nuitka-winsvc 2.3.9__cp311-cp311-win_amd64.whl → 2.4.1__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- Nuitka_winsvc-2.3.9.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +29 -2
- nuitka/MainControl.py +62 -35
- nuitka/ModuleRegistry.py +11 -3
- nuitka/OptionParsing.py +78 -39
- nuitka/Options.py +142 -35
- nuitka/OutputDirectories.py +5 -0
- nuitka/PostProcessing.py +23 -14
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +26 -23
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +1 -0
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +5 -2
- nuitka/build/include/nuitka/allocator.h +27 -5
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +23 -23
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +0 -2
- nuitka/build/include/nuitka/helper/attributes.h +7 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helpers.h +7 -4
- nuitka/build/include/nuitka/prelude.h +6 -10
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +5 -5
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
- nuitka/build/static_src/CompiledCellType.c +7 -7
- nuitka/build/static_src/CompiledCodeHelpers.c +51 -36
- nuitka/build/static_src/CompiledCoroutineType.c +2 -4
- nuitka/build/static_src/CompiledFrameType.c +109 -82
- nuitka/build/static_src/CompiledFunctionType.c +36 -9
- nuitka/build/static_src/CompiledGeneratorType.c +12 -10
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
- nuitka/build/static_src/CompiledMethodType.c +14 -13
- nuitka/build/static_src/HelpersAttributes.c +13 -15
- nuitka/build/static_src/HelpersBuiltin.c +18 -9
- nuitka/build/static_src/HelpersCalling.c +13 -13
- nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
- nuitka/build/static_src/HelpersComparisonEq.c +110 -110
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +110 -110
- nuitka/build/static_src/HelpersComparisonGt.c +110 -110
- nuitka/build/static_src/HelpersComparisonLe.c +110 -110
- nuitka/build/static_src/HelpersComparisonLt.c +110 -110
- nuitka/build/static_src/HelpersComparisonNe.c +110 -110
- nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
- nuitka/build/static_src/HelpersDictionaries.c +9 -0
- nuitka/build/static_src/HelpersFiles.c +2 -2
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersHeapStorage.c +4 -0
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersLists.c +5 -1
- nuitka/build/static_src/HelpersMatching.c +95 -35
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
- nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +8 -4
- nuitka/build/static_src/MainProgram.c +28 -9
- nuitka/build/static_src/MetaPathBasedLoader.c +126 -110
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +30 -1
- nuitka/build/static_src/OnefileBootstrap.c +34 -6
- nuitka/code_generation/AttributeCodes.py +12 -10
- nuitka/code_generation/CodeGeneration.py +6 -7
- nuitka/code_generation/ConstantCodes.py +53 -10
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +3 -4
- nuitka/code_generation/LoaderCodes.py +3 -0
- nuitka/code_generation/LocalsDictCodes.py +36 -14
- nuitka/code_generation/MatchCodes.py +23 -4
- nuitka/code_generation/ModuleCodes.py +0 -7
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
- nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
- nuitka/freezer/DependsExe.py +3 -1
- nuitka/freezer/DllDependenciesMacOS.py +28 -14
- nuitka/freezer/IncludedDataFiles.py +12 -3
- nuitka/freezer/IncludedEntryPoints.py +8 -2
- nuitka/freezer/Onefile.py +6 -1
- nuitka/freezer/Standalone.py +9 -2
- nuitka/importing/Importing.py +14 -5
- nuitka/importing/Recursion.py +3 -0
- nuitka/nodes/AttributeNodesGenerated.py +21 -12
- nuitka/nodes/BuiltinOpenNodes.py +5 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
- nuitka/nodes/BuiltinRefNodes.py +41 -1
- nuitka/nodes/ChildrenHavingMixins.py +143 -355
- nuitka/nodes/ClassNodes.py +30 -12
- nuitka/nodes/CodeObjectSpecs.py +9 -0
- nuitka/nodes/ExpressionBasesGenerated.py +11 -11
- nuitka/nodes/FunctionNodes.py +11 -12
- nuitka/nodes/FutureSpecs.py +16 -3
- nuitka/nodes/GeneratorNodes.py +2 -2
- nuitka/nodes/HardImportNodesGenerated.py +11 -134
- nuitka/nodes/LocalsScopes.py +19 -23
- nuitka/nodes/MatchNodes.py +18 -7
- nuitka/nodes/ModuleAttributeNodes.py +1 -20
- nuitka/nodes/ModuleNodes.py +23 -6
- nuitka/nodes/NodeBases.py +13 -11
- nuitka/nodes/NodeMetaClasses.py +26 -10
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +11 -11
- nuitka/nodes/SubscriptNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +28 -2
- nuitka/nodes/shapes/BuiltinTypeShapes.py +21 -1
- nuitka/optimizations/FunctionInlining.py +3 -6
- nuitka/optimizations/Optimization.py +13 -12
- nuitka/optimizations/TraceCollections.py +19 -4
- nuitka/plugins/PluginBase.py +121 -133
- nuitka/plugins/Plugins.py +91 -3
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
- nuitka/plugins/standard/DataFilesPlugin.py +15 -6
- nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
- nuitka/plugins/standard/DllFilesPlugin.py +5 -3
- nuitka/plugins/standard/ImplicitImports.py +34 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
- nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +491 -186
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +17 -0
- nuitka/reports/Reports.py +53 -5
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +0 -6
- nuitka/tools/data_composer/DataComposer.py +29 -27
- nuitka/tools/environments/CreateEnvironment.py +1 -0
- nuitka/tools/environments/Virtualenv.py +25 -11
- nuitka/tools/general/find_module/FindModuleCode.py +13 -3
- nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
- nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
- nuitka/tools/specialize/CTypeDescriptions.py +13 -7
- nuitka/tools/specialize/SpecializePython.py +18 -1
- nuitka/tools/testing/Common.py +19 -6
- nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
- nuitka/tools/watch/AutoStage.py +144 -0
- nuitka/tools/watch/__main__.py +79 -32
- nuitka/tree/Building.py +105 -104
- nuitka/tree/ComplexCallHelperFunctions.py +16 -26
- nuitka/tree/InternalModule.py +9 -1
- nuitka/tree/ReformulationAssignmentStatements.py +29 -59
- nuitka/tree/ReformulationClasses.py +10 -17
- nuitka/tree/ReformulationClasses3.py +69 -43
- nuitka/tree/ReformulationComparisonExpressions.py +6 -16
- nuitka/tree/ReformulationContractionExpressions.py +14 -23
- nuitka/tree/ReformulationDictionaryCreation.py +6 -10
- nuitka/tree/ReformulationExecStatements.py +10 -10
- nuitka/tree/ReformulationForLoopStatements.py +6 -12
- nuitka/tree/ReformulationFunctionStatements.py +22 -28
- nuitka/tree/ReformulationImportStatements.py +8 -10
- nuitka/tree/ReformulationLambdaExpressions.py +3 -6
- nuitka/tree/ReformulationMatchStatements.py +166 -60
- nuitka/tree/ReformulationMultidist.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +1 -1
- nuitka/tree/ReformulationPrintStatements.py +3 -6
- nuitka/tree/ReformulationSequenceCreation.py +13 -26
- nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
- nuitka/tree/ReformulationWithStatements.py +12 -16
- nuitka/tree/SourceHandling.py +13 -8
- nuitka/tree/VariableClosure.py +5 -21
- nuitka/utils/Distributions.py +80 -11
- nuitka/utils/Download.py +38 -31
- nuitka/utils/Execution.py +21 -9
- nuitka/utils/FileOperations.py +55 -28
- nuitka/utils/Images.py +6 -1
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/ModuleNames.py +11 -5
- nuitka/utils/ReExecute.py +17 -13
- nuitka/utils/SharedLibraries.py +69 -41
- nuitka/utils/Signing.py +3 -1
- nuitka/utils/StaticLibraries.py +51 -41
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +29 -7
- /Nuitka_winsvc-2.3.9.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
nuitka/__main__.py
CHANGED
|
@@ -14,6 +14,36 @@ or package, that can contain all used modules too.
|
|
|
14
14
|
import os
|
|
15
15
|
import sys
|
|
16
16
|
|
|
17
|
+
_cached_process_environments = {}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def getLaunchingNuitkaProcessEnvironmentValue(environment_variable_name):
|
|
21
|
+
if environment_variable_name not in _cached_process_environments:
|
|
22
|
+
_cached_process_environments[environment_variable_name] = os.getenv(
|
|
23
|
+
environment_variable_name
|
|
24
|
+
)
|
|
25
|
+
if _cached_process_environments[environment_variable_name] is not None:
|
|
26
|
+
del os.environ[environment_variable_name]
|
|
27
|
+
|
|
28
|
+
value = _cached_process_environments[environment_variable_name]
|
|
29
|
+
|
|
30
|
+
if value is not None and ":" not in value:
|
|
31
|
+
value = None
|
|
32
|
+
|
|
33
|
+
if value is not None:
|
|
34
|
+
pid, value = value.split(":", 1)
|
|
35
|
+
|
|
36
|
+
try:
|
|
37
|
+
pid = int(pid)
|
|
38
|
+
except ValueError:
|
|
39
|
+
value = None
|
|
40
|
+
else:
|
|
41
|
+
if os.name != "nt":
|
|
42
|
+
if pid != os.getpid():
|
|
43
|
+
value = None
|
|
44
|
+
|
|
45
|
+
return value
|
|
46
|
+
|
|
17
47
|
|
|
18
48
|
def main():
|
|
19
49
|
# PyLint for Python3 thinks we import from ourselves if we really
|
|
@@ -35,21 +65,25 @@ def main():
|
|
|
35
65
|
)
|
|
36
66
|
sys.exit(1)
|
|
37
67
|
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
nuitka_binary_name = getLaunchingNuitkaProcessEnvironmentValue("NUITKA_BINARY_NAME")
|
|
69
|
+
if nuitka_binary_name is not None:
|
|
70
|
+
sys.argv[0] = nuitka_binary_name
|
|
71
|
+
|
|
72
|
+
nuitka_pythonpath_ast = getLaunchingNuitkaProcessEnvironmentValue(
|
|
73
|
+
"NUITKA_PYTHONPATH_AST"
|
|
74
|
+
)
|
|
40
75
|
|
|
41
|
-
if
|
|
76
|
+
if nuitka_pythonpath_ast is not None:
|
|
42
77
|
# Restore the PYTHONPATH gained from the site module, that we chose not
|
|
43
78
|
# to have imported during compilation. For loading "ast" module, we need
|
|
44
79
|
# one element, that is not necessarily in our current path, but we use
|
|
45
80
|
# that to evaluate the current path.
|
|
46
|
-
sys.path = [
|
|
81
|
+
sys.path = [nuitka_pythonpath_ast]
|
|
47
82
|
import ast
|
|
48
83
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
del os.environ["NUITKA_PYTHONPATH"]
|
|
84
|
+
sys.path = ast.literal_eval(
|
|
85
|
+
getLaunchingNuitkaProcessEnvironmentValue("NUITKA_PYTHONPATH")
|
|
86
|
+
)
|
|
53
87
|
else:
|
|
54
88
|
# Remove path element added for being called via "__main__.py", this can
|
|
55
89
|
# only lead to trouble, having e.g. a "distutils" in sys.path that comes
|
|
@@ -103,6 +137,13 @@ def main():
|
|
|
103
137
|
|
|
104
138
|
warnings.simplefilter("ignore", DeprecationWarning)
|
|
105
139
|
|
|
140
|
+
# Hack, we need this to bootstrap and it's actually living in __main__
|
|
141
|
+
# module of nuitka package and renamed to where we can get at easily for
|
|
142
|
+
# other uses.
|
|
143
|
+
__import__("nuitka").getLaunchingNuitkaProcessEnvironmentValue = (
|
|
144
|
+
getLaunchingNuitkaProcessEnvironmentValue
|
|
145
|
+
)
|
|
146
|
+
|
|
106
147
|
from nuitka import Options # isort:skip
|
|
107
148
|
|
|
108
149
|
Options.parseArgs()
|
|
@@ -151,11 +192,15 @@ def main():
|
|
|
151
192
|
|
|
152
193
|
|
|
153
194
|
if __name__ == "__main__":
|
|
154
|
-
|
|
155
|
-
|
|
195
|
+
_nuitka_package_home = getLaunchingNuitkaProcessEnvironmentValue(
|
|
196
|
+
"NUITKA_PACKAGE_HOME"
|
|
197
|
+
)
|
|
198
|
+
if _nuitka_package_home is not None:
|
|
199
|
+
sys.path.insert(0, _nuitka_package_home)
|
|
156
200
|
|
|
157
201
|
import nuitka # just to have it loaded from there, pylint: disable=unused-import
|
|
158
202
|
|
|
203
|
+
assert sys.path[0] is _nuitka_package_home
|
|
159
204
|
del sys.path[0]
|
|
160
205
|
|
|
161
206
|
main()
|
nuitka/build/Backend.scons
CHANGED
|
@@ -156,6 +156,9 @@ deployment_mode = getArgumentBool("deployment", False)
|
|
|
156
156
|
# Experimental indications. Do things that are not yet safe to do.
|
|
157
157
|
no_deployment = getArgumentList("no_deployment", "")
|
|
158
158
|
|
|
159
|
+
# Debug mode indications. Do check things with fine granularity.
|
|
160
|
+
debug_modes = getArgumentList("debug_modes", "")
|
|
161
|
+
|
|
159
162
|
# Tracing mode. Output program progress.
|
|
160
163
|
trace_mode = getArgumentBool("trace_mode", False)
|
|
161
164
|
|
|
@@ -315,6 +318,7 @@ env = createEnvironment(
|
|
|
315
318
|
target_arch=target_arch,
|
|
316
319
|
experimental=experimental,
|
|
317
320
|
no_deployment=no_deployment,
|
|
321
|
+
debug_modes=debug_modes,
|
|
318
322
|
)
|
|
319
323
|
|
|
320
324
|
scons_details_logger.info("Initial CC: %r" % env.get("CC"))
|
|
@@ -797,7 +801,7 @@ env.Append(
|
|
|
797
801
|
]
|
|
798
802
|
)
|
|
799
803
|
|
|
800
|
-
if env.
|
|
804
|
+
if env.debian_python and python_version >= (3, 12):
|
|
801
805
|
env.Append(
|
|
802
806
|
CPPPATH=[
|
|
803
807
|
os.path.join(env.nuitka_src, "inline_copy", "python_hacl", "hacl_312"),
|
|
@@ -806,6 +810,7 @@ if env.standalone_mode and env.debian_python and python_version >= (3, 12):
|
|
|
806
810
|
),
|
|
807
811
|
]
|
|
808
812
|
)
|
|
813
|
+
|
|
809
814
|
env.Append(CPPDEFINES=["_NUITKA_INLINE_COPY_HACL"])
|
|
810
815
|
|
|
811
816
|
# Set load libpython from binary directory default
|
nuitka/build/Onefile.scons
CHANGED
|
@@ -116,6 +116,9 @@ deployment_mode = getArgumentBool("deployment", False)
|
|
|
116
116
|
# Experimental indications. Do things that are not yet safe to do.
|
|
117
117
|
no_deployment = getArgumentList("no_deployment", "")
|
|
118
118
|
|
|
119
|
+
# Debug mode indications. Do check things with fine granularity.
|
|
120
|
+
debug_modes = getArgumentList("debug_modes", "")
|
|
121
|
+
|
|
119
122
|
# Experimental indications. Do things that are not yet safe to do.
|
|
120
123
|
experimental = getArgumentList("experimental", "")
|
|
121
124
|
|
|
@@ -228,6 +231,7 @@ env = createEnvironment(
|
|
|
228
231
|
target_arch=target_arch,
|
|
229
232
|
experimental=experimental,
|
|
230
233
|
no_deployment=no_deployment,
|
|
234
|
+
debug_modes=debug_modes,
|
|
231
235
|
)
|
|
232
236
|
|
|
233
237
|
scons_details_logger.info("Initial CC: %r" % env.get("CC"))
|
nuitka/build/SconsCaching.py
CHANGED
|
@@ -92,6 +92,7 @@ def _injectCcache(env, cc_path, python_prefix, assume_yes_for_downloads):
|
|
|
92
92
|
url=url,
|
|
93
93
|
is_arch_specific=False,
|
|
94
94
|
specificity=url.rsplit("/", 2)[1],
|
|
95
|
+
unzip=True,
|
|
95
96
|
flatten=True,
|
|
96
97
|
binary="ccache",
|
|
97
98
|
message="Nuitka will make use of ccache to speed up repeated compilation.",
|
|
@@ -404,6 +404,7 @@ For Python version %s MSVC %s or later is required, not %s which is too old."""
|
|
|
404
404
|
target_arch=target_arch,
|
|
405
405
|
experimental=env.experimental_flags,
|
|
406
406
|
no_deployment=env.no_deployment_flags,
|
|
407
|
+
debug_modes=env.debug_modes_flags,
|
|
407
408
|
)
|
|
408
409
|
|
|
409
410
|
if clang_mode:
|
nuitka/build/SconsHacks.py
CHANGED
|
@@ -142,7 +142,11 @@ def myDetect(self, progs):
|
|
|
142
142
|
return None
|
|
143
143
|
|
|
144
144
|
# Note: Actually, with our inline copy, this is maybe not supposed to
|
|
145
|
-
# happen at all
|
|
145
|
+
# happen a lot at all. It's a bit hard to pass debug flag to here, or
|
|
146
|
+
# else we could assert it.
|
|
147
|
+
# for p in progs:
|
|
148
|
+
# if p not in ("x86_64-conda-linux-gnu-gcc", "gcc", "cc", "g++"):
|
|
149
|
+
# assert False, p
|
|
146
150
|
|
|
147
151
|
return orig_detect(self, progs)
|
|
148
152
|
|
nuitka/build/SconsInterface.py
CHANGED
|
@@ -469,6 +469,8 @@ def setCommonSconsOptions(options):
|
|
|
469
469
|
|
|
470
470
|
options["experimental"] = ",".join(Options.getExperimentalIndications())
|
|
471
471
|
|
|
472
|
+
options["debug_modes"] = ",".join(Options.getDebugModeIndications())
|
|
473
|
+
|
|
472
474
|
options["no_deployment"] = ",".join(Options.getNoDeploymentIndications())
|
|
473
475
|
|
|
474
476
|
if Options.shallRunInDebugger():
|
nuitka/build/SconsUtils.py
CHANGED
|
@@ -33,7 +33,7 @@ from nuitka.utils.Utils import isLinux, isMacOS, isPosixWindows, isWin32Windows
|
|
|
33
33
|
|
|
34
34
|
def initScons():
|
|
35
35
|
# Avoid localized outputs.
|
|
36
|
-
os.environ["
|
|
36
|
+
os.environ["LC_ALL"] = "C"
|
|
37
37
|
|
|
38
38
|
def no_sync(self):
|
|
39
39
|
# That's a noop, pylint: disable=unused-argument
|
|
@@ -173,7 +173,7 @@ def prepareEnvironment(mingw_mode):
|
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
def createEnvironment(
|
|
176
|
-
mingw_mode, msvc_version, target_arch, experimental, no_deployment
|
|
176
|
+
mingw_mode, msvc_version, target_arch, experimental, no_deployment, debug_modes
|
|
177
177
|
):
|
|
178
178
|
from SCons.Script import Environment # pylint: disable=I0021,import-error
|
|
179
179
|
|
|
@@ -271,6 +271,9 @@ def createEnvironment(
|
|
|
271
271
|
_enableFlagSettings(env, "experimental", experimental)
|
|
272
272
|
env.experimental_flags = experimental
|
|
273
273
|
|
|
274
|
+
_enableFlagSettings(env, "debug", debug_modes)
|
|
275
|
+
env.debug_modes_flags = debug_modes
|
|
276
|
+
|
|
274
277
|
return env
|
|
275
278
|
|
|
276
279
|
|
|
@@ -108,12 +108,12 @@ static inline void _Nuitka_Py_XDECREF(PyObject *ob) {
|
|
|
108
108
|
#if PYTHON_VERSION < 0x3c0
|
|
109
109
|
#define Py_INCREF_IMMORTAL(value) Py_INCREF(value)
|
|
110
110
|
#define Py_DECREF_IMMORTAL(value) Py_DECREF(value)
|
|
111
|
-
#elif defined(
|
|
112
|
-
#define Py_INCREF_IMMORTAL(value)
|
|
113
|
-
#define Py_DECREF_IMMORTAL(value)
|
|
114
|
-
#else
|
|
111
|
+
#elif defined(_NUITKA_DEBUG_DEBUG_IMMORTAL)
|
|
115
112
|
#define Py_INCREF_IMMORTAL(value) assert(Py_REFCNT(value) == _Py_IMMORTAL_REFCNT)
|
|
116
113
|
#define Py_DECREF_IMMORTAL(value) assert(Py_REFCNT(value) == _Py_IMMORTAL_REFCNT)
|
|
114
|
+
#else
|
|
115
|
+
#define Py_INCREF_IMMORTAL(value)
|
|
116
|
+
#define Py_DECREF_IMMORTAL(value)
|
|
117
117
|
#endif
|
|
118
118
|
|
|
119
119
|
// Macro introduced with Python3.9 or higher, make it generally available.
|
|
@@ -134,7 +134,16 @@ static inline void Nuitka_Py_NewReference(PyObject *op) {
|
|
|
134
134
|
_PyInterpreterState_GET()->object_state.reftotal++;
|
|
135
135
|
#endif
|
|
136
136
|
#endif
|
|
137
|
+
#if !defined(Py_GIL_DISABLED)
|
|
137
138
|
op->ob_refcnt = 1;
|
|
139
|
+
#else
|
|
140
|
+
op->ob_tid = _Py_ThreadId();
|
|
141
|
+
op->_padding = 0;
|
|
142
|
+
op->ob_mutex = (struct _PyMutex){0};
|
|
143
|
+
op->ob_gc_bits = 0;
|
|
144
|
+
op->ob_ref_local = 1;
|
|
145
|
+
op->ob_ref_shared = 0;
|
|
146
|
+
#endif
|
|
138
147
|
}
|
|
139
148
|
#else
|
|
140
149
|
#define Nuitka_Py_NewReference(op) _Py_NewReference(op)
|
|
@@ -280,7 +289,20 @@ static bool inline Nuitka_GC_IS_TRACKED_X(PyObject *object) {
|
|
|
280
289
|
|
|
281
290
|
// To allow us marking some of our own values as immortal.
|
|
282
291
|
#if PYTHON_VERSION >= 0x3c0
|
|
283
|
-
static void inline Py_SET_REFCNT_IMMORTAL(PyObject *object) {
|
|
292
|
+
static void inline Py_SET_REFCNT_IMMORTAL(PyObject *object) {
|
|
293
|
+
// Normally done only with 3.13, but it makes sense to do this.
|
|
294
|
+
if (_PyObject_IS_GC(object) && _PyObject_GC_IS_TRACKED(object)) {
|
|
295
|
+
Nuitka_GC_UnTrack(object);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
#ifdef Py_GIL_DISABLED
|
|
299
|
+
object->ob_tid = _Py_UNOWNED_TID;
|
|
300
|
+
object->ob_ref_local = _Py_IMMORTAL_REFCNT_LOCAL;
|
|
301
|
+
object->ob_ref_shared = 0;
|
|
302
|
+
#else
|
|
303
|
+
object->ob_refcnt = _Py_IMMORTAL_REFCNT;
|
|
304
|
+
#endif
|
|
305
|
+
}
|
|
284
306
|
#else
|
|
285
307
|
#define Py_SET_REFCNT_IMMORTAL(object)
|
|
286
308
|
#endif
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// For exception test formatting and call code mostly.
|
|
12
12
|
extern char const *GET_CALLABLE_NAME(PyObject *object);
|
|
13
13
|
extern char const *GET_CALLABLE_DESC(PyObject *object);
|
|
14
|
-
extern char const *GET_CLASS_NAME(PyObject *
|
|
14
|
+
extern char const *GET_CLASS_NAME(PyObject *class_object);
|
|
15
15
|
extern char const *GET_INSTANCE_CLASS_NAME(PyThreadState *tstate, PyObject *instance);
|
|
16
16
|
|
|
17
17
|
// Also used in generated helper code.
|
|
@@ -47,44 +47,44 @@ extern struct Nuitka_FrameObject *MAKE_CLASS_FRAME(PyThreadState *tstate, PyCode
|
|
|
47
47
|
// Create a code object for the given filename and function name
|
|
48
48
|
|
|
49
49
|
#if PYTHON_VERSION < 0x300
|
|
50
|
-
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname,
|
|
50
|
+
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
|
|
51
51
|
kw_only_count, pos_only_count) \
|
|
52
|
-
makeCodeObject(filename, line, flags, function_name,
|
|
52
|
+
makeCodeObject(filename, line, flags, function_name, arg_names, free_vars, arg_count)
|
|
53
53
|
extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
|
|
54
|
-
PyObject *
|
|
54
|
+
PyObject *arg_names, PyObject *free_vars, int arg_count);
|
|
55
55
|
#elif PYTHON_VERSION < 0x380
|
|
56
|
-
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname,
|
|
56
|
+
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
|
|
57
57
|
kw_only_count, pos_only_count) \
|
|
58
|
-
makeCodeObject(filename, line, flags, function_name,
|
|
58
|
+
makeCodeObject(filename, line, flags, function_name, arg_names, free_vars, arg_count, kw_only_count)
|
|
59
59
|
extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
|
|
60
|
-
PyObject *
|
|
60
|
+
PyObject *arg_names, PyObject *free_vars, int arg_count, int kw_only_count);
|
|
61
61
|
#elif PYTHON_VERSION < 0x3b0
|
|
62
|
-
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname,
|
|
62
|
+
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
|
|
63
63
|
kw_only_count, pos_only_count) \
|
|
64
|
-
makeCodeObject(filename, line, flags, function_name,
|
|
64
|
+
makeCodeObject(filename, line, flags, function_name, arg_names, free_vars, arg_count, kw_only_count, pos_only_count)
|
|
65
65
|
extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
|
|
66
|
-
PyObject *
|
|
66
|
+
PyObject *arg_names, PyObject *free_vars, int arg_count, int kw_only_count,
|
|
67
67
|
int pos_only_count);
|
|
68
68
|
#else
|
|
69
|
-
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname,
|
|
69
|
+
#define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
|
|
70
70
|
kw_only_count, pos_only_count) \
|
|
71
|
-
makeCodeObject(filename, line, flags, function_name, function_qualname,
|
|
71
|
+
makeCodeObject(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
|
|
72
72
|
kw_only_count, pos_only_count)
|
|
73
73
|
extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
|
|
74
|
-
PyObject *function_qualname, PyObject *
|
|
75
|
-
int kw_only_count, int pos_only_count);
|
|
74
|
+
PyObject *function_qualname, PyObject *arg_names, PyObject *free_vars,
|
|
75
|
+
int arg_count, int kw_only_count, int pos_only_count);
|
|
76
76
|
#endif
|
|
77
77
|
|
|
78
78
|
NUITKA_MAY_BE_UNUSED static inline bool isFakeCodeObject(PyCodeObject *code) {
|
|
79
79
|
#if PYTHON_VERSION < 0x300
|
|
80
80
|
return code->co_code == const_str_empty;
|
|
81
81
|
#elif PYTHON_VERSION < 0x3b0
|
|
82
|
-
return code->co_code ==
|
|
83
|
-
#elif PYTHON_VERSION < 0x3c0
|
|
84
|
-
return _PyCode_CODE(code)[0] == 0;
|
|
82
|
+
return code->co_code == const_bytes_empty;
|
|
85
83
|
#else
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
// Starting for Python3.11, we just proper bytecode that raises
|
|
85
|
+
// "RuntimeError" itself, so this function is only used to
|
|
86
|
+
// optimize checks away.
|
|
87
|
+
return false;
|
|
88
88
|
#endif
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -221,11 +221,11 @@ inline static void assertThreadFrameObject(Nuitka_ThreadStateFrameType *frame) {
|
|
|
221
221
|
#endif
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
-
// Mark frame as currently executed. Starting with Python 3
|
|
224
|
+
// Mark frame as currently executed. Starting with Python 3 that means it
|
|
225
225
|
// can or cannot be cleared, or should lead to a generator close. For Python2
|
|
226
226
|
// this is a no-op. Using a define to spare the compile from inlining an empty
|
|
227
227
|
// function.
|
|
228
|
-
#if PYTHON_VERSION >=
|
|
228
|
+
#if PYTHON_VERSION >= 0x300
|
|
229
229
|
|
|
230
230
|
#if PYTHON_VERSION < 0x3b0
|
|
231
231
|
|
|
@@ -253,7 +253,7 @@ static inline void Nuitka_Frame_MarkAsExecuting(struct Nuitka_FrameObject *frame
|
|
|
253
253
|
#define Nuitka_Frame_MarkAsExecuting(frame) ;
|
|
254
254
|
#endif
|
|
255
255
|
|
|
256
|
-
#if PYTHON_VERSION >=
|
|
256
|
+
#if PYTHON_VERSION >= 0x300
|
|
257
257
|
static inline void Nuitka_Frame_MarkAsNotExecuting(struct Nuitka_FrameObject *frame) {
|
|
258
258
|
CHECK_OBJECT(frame);
|
|
259
259
|
#if PYTHON_VERSION >= 0x3b0
|
|
@@ -269,7 +269,7 @@ static inline void Nuitka_Frame_MarkAsNotExecuting(struct Nuitka_FrameObject *fr
|
|
|
269
269
|
#define Nuitka_PythonFrame_MarkAsExecuting(frame) ;
|
|
270
270
|
#endif
|
|
271
271
|
|
|
272
|
-
#if PYTHON_VERSION >=
|
|
272
|
+
#if PYTHON_VERSION >= 0x300
|
|
273
273
|
static inline bool Nuitka_Frame_IsExecuting(struct Nuitka_FrameObject *frame) {
|
|
274
274
|
CHECK_OBJECT(frame);
|
|
275
275
|
#if PYTHON_VERSION >= 0x3b0
|
|
@@ -396,7 +396,7 @@ NUITKA_MAY_BE_UNUSED inline static void popFrameStack(PyThreadState *tstate) {
|
|
|
396
396
|
|
|
397
397
|
// TODO: These can be moved to private code, once all C library is included by
|
|
398
398
|
// compiled code helpers, but generators are currently not.
|
|
399
|
-
#if PYTHON_VERSION >=
|
|
399
|
+
#if PYTHON_VERSION >= 0x300
|
|
400
400
|
NUITKA_MAY_BE_UNUSED static void Nuitka_SetFrameGenerator(struct Nuitka_FrameObject *nuitka_frame,
|
|
401
401
|
PyObject *generator) {
|
|
402
402
|
#if PYTHON_VERSION < 0x3b0
|
|
@@ -32,7 +32,7 @@ struct Nuitka_MethodObject {
|
|
|
32
32
|
extern PyTypeObject Nuitka_Method_Type;
|
|
33
33
|
|
|
34
34
|
// Make a method out of a function.
|
|
35
|
-
extern PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *
|
|
35
|
+
extern PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *class_object);
|
|
36
36
|
|
|
37
37
|
static inline bool Nuitka_Method_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Method_Type; }
|
|
38
38
|
|
|
@@ -75,8 +75,6 @@ NUITKA_MAY_BE_UNUSED static int CHECK_EXCEPTION_STAR_VALID(PyThreadState *tstate
|
|
|
75
75
|
return 0;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
extern PyObject *const_str_plain_split;
|
|
79
|
-
|
|
80
78
|
NUITKA_MAY_BE_UNUSED static int EXCEPTION_GROUP_MATCH(PyThreadState *tstate, PyObject *exc_value, PyObject *match_type,
|
|
81
79
|
PyObject **match, PyObject **rest) {
|
|
82
80
|
// TODO: Avoid this from happening, we should not call it then.
|
|
@@ -35,7 +35,7 @@ extern PyObject *LOOKUP_SPECIAL(PyThreadState *tstate, PyObject *source, PyObjec
|
|
|
35
35
|
|
|
36
36
|
// Find an attribute in a class, Python2 only.
|
|
37
37
|
#if PYTHON_VERSION < 0x300
|
|
38
|
-
extern PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *
|
|
38
|
+
extern PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *class_object, PyObject *attr_name);
|
|
39
39
|
#endif
|
|
40
40
|
|
|
41
41
|
extern PyObject *LOOKUP_MODULE_VALUE(PyDictObject *module_dict, PyObject *var_name);
|
|
@@ -70,6 +70,12 @@ static inline bool hasTypeGenericSetAttr(PyTypeObject *type) {
|
|
|
70
70
|
#endif
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
#if PYTHON_VERSION >= 0x3a0
|
|
74
|
+
static inline bool Nuitka_Descr_IsData(PyObject *object) { return Py_TYPE(object)->tp_descr_set != NULL; }
|
|
75
|
+
#else
|
|
76
|
+
#define Nuitka_Descr_IsData(object) PyDescr_IsData(object)
|
|
77
|
+
#endif
|
|
78
|
+
|
|
73
79
|
#endif
|
|
74
80
|
|
|
75
81
|
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -238,7 +238,7 @@ NUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_SUBSCRIPT(PyThreadState *tstate, Py
|
|
|
238
238
|
#endif
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
bool MATCH_MAPPING_KEY(PyThreadState *tstate, PyObject *map, PyObject *key);
|
|
242
242
|
|
|
243
243
|
NUITKA_MAY_BE_UNUSED static bool SET_SUBSCRIPT_CONST(PyThreadState *tstate, PyObject *target, PyObject *subscript,
|
|
244
244
|
Py_ssize_t int_subscript, PyObject *value) {
|
|
@@ -162,7 +162,7 @@ extern PyObject *BUILTIN_OPEN(PyThreadState *tstate, PyObject *file_name, PyObje
|
|
|
162
162
|
// Small helper to open files with few arguments in C.
|
|
163
163
|
extern PyObject *BUILTIN_OPEN_BINARY_READ_SIMPLE(PyThreadState *tstate, PyObject *filename);
|
|
164
164
|
extern PyObject *BUILTIN_OPEN_SIMPLE(PyThreadState *tstate, PyObject *filename, char const *mode, bool buffering,
|
|
165
|
-
PyObject *encoding);
|
|
165
|
+
PyObject *encoding, bool close_fd);
|
|
166
166
|
|
|
167
167
|
// Small helper to read file contents with few arguments in C.
|
|
168
168
|
extern PyObject *GET_FILE_BYTES(PyThreadState *tstate, PyObject *filename);
|
|
@@ -334,8 +334,8 @@ extern void patchTracebackDealloc(void);
|
|
|
334
334
|
// Initialize value for "tp_compare" and "tp_init" defaults.
|
|
335
335
|
extern void _initSlotCompare(void);
|
|
336
336
|
|
|
337
|
-
// Default __init__ slot wrapper
|
|
338
|
-
extern
|
|
337
|
+
// Default __init__ slot wrapper, spell-checker: ignore initproc
|
|
338
|
+
extern python_init_proc default_tp_init_wrapper;
|
|
339
339
|
|
|
340
340
|
#if PYTHON_VERSION >= 0x300
|
|
341
341
|
// Select the metaclass from specified one and given bases.
|
|
@@ -343,7 +343,8 @@ extern PyObject *SELECT_METACLASS(PyThreadState *tstate, PyObject *metaclass, Py
|
|
|
343
343
|
#endif
|
|
344
344
|
|
|
345
345
|
#if PYTHON_VERSION >= 0x3a0
|
|
346
|
-
extern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched,
|
|
346
|
+
extern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, PyObject *matched_type,
|
|
347
|
+
Py_ssize_t positional_count, PyObject **keywords, Py_ssize_t keywords_count);
|
|
347
348
|
#endif
|
|
348
349
|
|
|
349
350
|
NUITKA_MAY_BE_UNUSED static PyObject *MODULE_NAME1(PyThreadState *tstate, PyObject *module) {
|
|
@@ -413,6 +414,8 @@ extern PyObject *Py_SysVersionInfo;
|
|
|
413
414
|
|
|
414
415
|
extern PyObject *MAKE_UNION_TYPE(PyObject *args);
|
|
415
416
|
|
|
417
|
+
// Our wrapper for "PyType_Ready" that takes care of trying to avoid DLL entry
|
|
418
|
+
// points for generic attributes. spell-checker: ignore aiter
|
|
416
419
|
extern void Nuitka_PyType_Ready(PyTypeObject *type, PyTypeObject *base, bool generic_get_attr, bool generic_set_attr,
|
|
417
420
|
bool self_iter, bool await_self_iter, bool self_aiter);
|
|
418
421
|
|
|
@@ -27,9 +27,10 @@
|
|
|
27
27
|
|
|
28
28
|
/* This is needed or else we can't create modules name "proc" or "func". For
|
|
29
29
|
* Python3, the name collision can't happen, so we can limit it to Python2.
|
|
30
|
+
spell-checker: ignore initproc,initfunc
|
|
30
31
|
*/
|
|
31
|
-
#define initproc
|
|
32
|
-
#define initfunc
|
|
32
|
+
#define initproc python_init_proc
|
|
33
|
+
#define initfunc python_init_func
|
|
33
34
|
#define initstate python_initstate
|
|
34
35
|
|
|
35
36
|
// Python 3.11 headers give these warnings
|
|
@@ -251,11 +252,6 @@ NUITKA_MAY_BE_UNUSED static inline managed_static_type_state *Nuitka_PyStaticTyp
|
|
|
251
252
|
#define NUITKA_DYNAMIC_ARRAY_DECL(VARIABLE_NAME, ELEMENT_TYPE, COUNT) ELEMENT_TYPE VARIABLE_NAME[COUNT];
|
|
252
253
|
#endif
|
|
253
254
|
|
|
254
|
-
// Stringizing, to make strings out of defines use XSTRINGIZED(SOME_DEFINE) needs
|
|
255
|
-
// to level of defines to work.
|
|
256
|
-
#define _STRINGIZED(ARG) #ARG
|
|
257
|
-
#define STRINGIZED(ARG) _STRINGIZED(ARG)
|
|
258
|
-
|
|
259
255
|
/* Python3 removed PyInt instead of renaming PyLong, and PyObject_Str instead
|
|
260
256
|
* of renaming PyObject_Unicode. Define this to be easily portable.
|
|
261
257
|
*/
|
|
@@ -415,9 +411,9 @@ extern PyThreadState *_PyThreadState_Current;
|
|
|
415
411
|
#endif
|
|
416
412
|
|
|
417
413
|
#if PYTHON_VERSION < 0x300
|
|
418
|
-
#define
|
|
414
|
+
#define TP_RICHCOMPARE(t) (PyType_HasFeature((t), Py_TPFLAGS_HAVE_RICHCOMPARE) ? (t)->tp_richcompare : NULL)
|
|
419
415
|
#else
|
|
420
|
-
#define
|
|
416
|
+
#define TP_RICHCOMPARE(t) ((t)->tp_richcompare)
|
|
421
417
|
#endif
|
|
422
418
|
|
|
423
419
|
// For older Python we need to define this ourselves.
|
|
@@ -522,7 +518,7 @@ extern PyObject *Nuitka_dunder_compiled_value;
|
|
|
522
518
|
#include "nuitka_data_decoder.h"
|
|
523
519
|
#else
|
|
524
520
|
#define DECODE(x) assert(x)
|
|
525
|
-
#define
|
|
521
|
+
#define UN_TRANSLATE(x) (x)
|
|
526
522
|
#endif
|
|
527
523
|
|
|
528
524
|
#if _NUITKA_EXPERIMENTAL_FILE_TRACING
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
extern bool PRINT_NEW_LINE(void);
|
|
10
10
|
extern bool PRINT_ITEM(PyObject *object);
|
|
11
|
+
extern bool PRINT_ITEM_LINE(PyObject *object);
|
|
11
12
|
extern bool PRINT_STRING(char const *str);
|
|
13
|
+
extern bool PRINT_STRING_W(wchar_t const *str);
|
|
12
14
|
extern bool PRINT_FORMAT(char const *fmt, ...);
|
|
13
15
|
extern bool PRINT_ITEM_TO(PyObject *file, PyObject *object);
|
|
14
16
|
extern bool PRINT_NEW_LINE_TO(PyObject *file);
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
struct Nuitka_MetaPathBasedLoaderEntry;
|
|
20
20
|
|
|
21
|
-
typedef PyObject *(*
|
|
22
|
-
|
|
21
|
+
typedef PyObject *(*module_init_func)(PyThreadState *tstate, PyObject *module,
|
|
22
|
+
struct Nuitka_MetaPathBasedLoaderEntry const *loader_entry);
|
|
23
23
|
|
|
24
24
|
#if PYTHON_VERSION >= 0x370 && defined(_NUITKA_EXE) && !defined(_NUITKA_STANDALONE) && \
|
|
25
25
|
defined(_NUITKA_FILE_REFERENCE_ORIGINAL_MODE)
|
|
@@ -31,7 +31,7 @@ struct Nuitka_MetaPathBasedLoaderEntry {
|
|
|
31
31
|
char const *name;
|
|
32
32
|
|
|
33
33
|
// Entry function if compiled module, otherwise NULL.
|
|
34
|
-
|
|
34
|
+
module_init_func python_init_func;
|
|
35
35
|
|
|
36
36
|
// For bytecode modules, start and size inside the constants blob.
|
|
37
37
|
int bytecode_index;
|
|
@@ -55,8 +55,8 @@ struct Nuitka_MetaPathBasedLoaderEntry {
|
|
|
55
55
|
/* For embedded modules, register the meta path based loader. Used by main
|
|
56
56
|
* program/package only.
|
|
57
57
|
*/
|
|
58
|
-
extern void
|
|
59
|
-
|
|
58
|
+
extern void registerMetaPathBasedLoader(struct Nuitka_MetaPathBasedLoaderEntry *loader_entries,
|
|
59
|
+
unsigned char **bytecode_data);
|
|
60
60
|
|
|
61
61
|
/* Create a loader object responsible for a package. */
|
|
62
62
|
extern PyObject *Nuitka_Loader_New(struct Nuitka_MetaPathBasedLoaderEntry const *entry);
|
|
@@ -375,8 +375,6 @@ static PySendResult _Nuitka_Asyncgen_sendR(PyThreadState *tstate, struct Nuitka_
|
|
|
375
375
|
|
|
376
376
|
Nuitka_MarkAsyncgenAsNotRunning(asyncgen);
|
|
377
377
|
|
|
378
|
-
tstate = PyThreadState_GET();
|
|
379
|
-
|
|
380
378
|
// Remove the back frame from asyncgen if it's there.
|
|
381
379
|
if (asyncgen->m_frame) {
|
|
382
380
|
// assert(tstate->frame == &asyncgen->m_frame->m_frame);
|
|
@@ -1050,7 +1048,7 @@ static PyAsyncMethods Nuitka_Asyncgen_as_async = {
|
|
|
1050
1048
|
|
|
1051
1049
|
// TODO: Set "__doc__" automatically for method clones of compiled types from
|
|
1052
1050
|
// the documentation of built-in original type.
|
|
1053
|
-
static PyGetSetDef
|
|
1051
|
+
static PyGetSetDef Nuitka_Asyncgen_tp_getset[] = {
|
|
1054
1052
|
{(char *)"__name__", (getter)Nuitka_Asyncgen_get_name, (setter)Nuitka_Asyncgen_set_name, NULL},
|
|
1055
1053
|
{(char *)"__qualname__", (getter)Nuitka_Asyncgen_get_qualname, (setter)Nuitka_Asyncgen_set_qualname, NULL},
|
|
1056
1054
|
{(char *)"ag_await", (getter)Nuitka_Asyncgen_get_ag_await, (setter)NULL, NULL},
|
|
@@ -1095,7 +1093,7 @@ PyTypeObject Nuitka_Asyncgen_Type = {
|
|
|
1095
1093
|
0, // tp_iternext
|
|
1096
1094
|
Nuitka_Asyncgen_methods, // tp_methods
|
|
1097
1095
|
Nuitka_Asyncgen_members, // tp_members
|
|
1098
|
-
|
|
1096
|
+
Nuitka_Asyncgen_tp_getset, // tp_getset
|
|
1099
1097
|
0, // tp_base
|
|
1100
1098
|
0, // tp_dict
|
|
1101
1099
|
0, // tp_descr_get
|
|
@@ -182,7 +182,7 @@ static int Nuitka_Cell_set_contents(struct Nuitka_CellObject *cell, PyObject *va
|
|
|
182
182
|
}
|
|
183
183
|
#endif
|
|
184
184
|
|
|
185
|
-
static PyGetSetDef
|
|
185
|
+
static PyGetSetDef Nuitka_Cell_tp_getset[] = {
|
|
186
186
|
#if PYTHON_VERSION < 0x370
|
|
187
187
|
{(char *)"cell_contents", (getter)Nuitka_Cell_get_contents, NULL, NULL},
|
|
188
188
|
#else
|
|
@@ -218,12 +218,12 @@ PyTypeObject Nuitka_Cell_Type = {
|
|
|
218
218
|
#else
|
|
219
219
|
Nuitka_Cell_tp_richcompare, // tp_richcompare
|
|
220
220
|
#endif
|
|
221
|
-
0,
|
|
222
|
-
0,
|
|
223
|
-
0,
|
|
224
|
-
0,
|
|
225
|
-
0,
|
|
226
|
-
|
|
221
|
+
0, // tp_weaklistoffset
|
|
222
|
+
0, // tp_iter
|
|
223
|
+
0, // tp_iternext
|
|
224
|
+
0, // tp_methods
|
|
225
|
+
0, // tp_members
|
|
226
|
+
Nuitka_Cell_tp_getset, // tp_getset
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
void _initCompiledCellType(void) { Nuitka_PyType_Ready(&Nuitka_Cell_Type, NULL, true, false, false, false, false); }
|