Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.5__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.5.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +30 -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/Progress.py +2 -1
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +1 -0
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/__past__.py +5 -0
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +2 -1
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +4 -1
- 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 +10 -3
- nuitka/build/include/nuitka/prelude.h +6 -15
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +11 -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 +49 -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 +16 -7
- 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/HelpersFilesystemPaths.c +28 -13
- 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/InspectPatcher.c +14 -2
- nuitka/build/static_src/MainProgram.c +20 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +163 -140
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/OnefileBootstrap.c +100 -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/Emission.py +1 -1
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +4 -5
- 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 +1 -8
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +22 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +27 -9
- 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 +5 -12
- nuitka/freezer/IncludedDataFiles.py +15 -4
- 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 +7 -11
- 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 +3 -2
- 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/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 +92 -4
- 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 +489 -182
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -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 +8 -0
- 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 +21 -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 +13 -2
- 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 +32 -8
- 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.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.5.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/top_level.txt +0 -0
|
@@ -331,6 +331,12 @@
|
|
|
331
331
|
change_function:
|
|
332
332
|
'test': "'(lambda: None)'"
|
|
333
333
|
|
|
334
|
+
- module-name: 'sysconfig' # checksum: f2059e78
|
|
335
|
+
anti-bloat:
|
|
336
|
+
- replacements:
|
|
337
|
+
'osname, host, release, version, machine = os.uname()': "'osname, host, release, version, machine = os.uname(); osname = %r' % os.uname()[0]"
|
|
338
|
+
when: 'not win32'
|
|
339
|
+
|
|
334
340
|
- module-name: 'tabnanny' # checksum: 6a44b57d
|
|
335
341
|
anti-bloat:
|
|
336
342
|
- description: 'remove module ability to run as a binary'
|
nuitka/reports/Reports.py
CHANGED
|
@@ -16,6 +16,7 @@ from nuitka import TreeXML
|
|
|
16
16
|
from nuitka.__past__ import unicode
|
|
17
17
|
from nuitka.build.DataComposerInterface import getDataComposerReportValues
|
|
18
18
|
from nuitka.build.SconsUtils import readSconsErrorReport
|
|
19
|
+
from nuitka.code_generation.ConstantCodes import getDistributionMetadataValues
|
|
19
20
|
from nuitka.containers.OrderedSets import OrderedSet
|
|
20
21
|
from nuitka.freezer.IncludedDataFiles import getIncludedDataFiles
|
|
21
22
|
from nuitka.freezer.IncludedEntryPoints import getStandaloneEntryPoints
|
|
@@ -37,10 +38,15 @@ from nuitka.Options import (
|
|
|
37
38
|
from nuitka.OutputDirectories import (
|
|
38
39
|
getResultRunFilename,
|
|
39
40
|
getSourceDirectoryPath,
|
|
41
|
+
hasMainModule,
|
|
40
42
|
)
|
|
41
43
|
from nuitka.plugins.Plugins import getActivePlugins
|
|
42
44
|
from nuitka.PythonFlavors import getPythonFlavorName
|
|
43
|
-
from nuitka.PythonVersions import
|
|
45
|
+
from nuitka.PythonVersions import (
|
|
46
|
+
getLaunchingSystemPrefixPath,
|
|
47
|
+
getSystemPrefixPath,
|
|
48
|
+
python_version_full_str,
|
|
49
|
+
)
|
|
44
50
|
from nuitka.Tracing import ReportingSystemExit, reports_logger
|
|
45
51
|
from nuitka.utils.Distributions import (
|
|
46
52
|
getDistributionInstallerName,
|
|
@@ -185,6 +191,11 @@ def _getReportInputData(aborted):
|
|
|
185
191
|
|
|
186
192
|
module_exclusions[_using_module_name][_module_name] = _reason
|
|
187
193
|
|
|
194
|
+
included_metadata = dict(
|
|
195
|
+
(distribution_name, meta_data_value.reasons)
|
|
196
|
+
for distribution_name, meta_data_value in getDistributionMetadataValues()
|
|
197
|
+
)
|
|
198
|
+
|
|
188
199
|
memory_infos = getMemoryInfos()
|
|
189
200
|
|
|
190
201
|
python_exe = sys.executable
|
|
@@ -214,9 +225,16 @@ def _getReportInputData(aborted):
|
|
|
214
225
|
|
|
215
226
|
data_composer = getDataComposerReportValues()
|
|
216
227
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
228
|
+
if hasMainModule():
|
|
229
|
+
output_run_filename = os.path.abspath(
|
|
230
|
+
getResultRunFilename(onefile=isOnefileMode())
|
|
231
|
+
)
|
|
232
|
+
scons_error_report_data = readSconsErrorReport(
|
|
233
|
+
source_dir=getSourceDirectoryPath()
|
|
234
|
+
)
|
|
235
|
+
else:
|
|
236
|
+
scons_error_report_data = {}
|
|
237
|
+
output_run_filename = "failed too early"
|
|
220
238
|
|
|
221
239
|
return dict(
|
|
222
240
|
(var_name, var_value)
|
|
@@ -236,7 +254,7 @@ def _getReportPathPrefixes():
|
|
|
236
254
|
if _report_prefixes is None:
|
|
237
255
|
_report_prefixes = []
|
|
238
256
|
|
|
239
|
-
sys_prefix =
|
|
257
|
+
sys_prefix = getLaunchingSystemPrefixPath() or sys.prefix
|
|
240
258
|
real_sys_prefix = getSystemPrefixPath()
|
|
241
259
|
|
|
242
260
|
if real_sys_prefix != sys_prefix:
|
|
@@ -333,6 +351,20 @@ def _addModulesToReport(root, report_input_data, diffable):
|
|
|
333
351
|
"volatile" if diffable else "%.2f" % timing_info.time_used
|
|
334
352
|
)
|
|
335
353
|
|
|
354
|
+
if timing_info.micro_passes:
|
|
355
|
+
timing_xml_node.attrib["micro_passes"] = str(timing_info.micro_passes)
|
|
356
|
+
|
|
357
|
+
if timing_info.merge_counts:
|
|
358
|
+
merged_total = 0
|
|
359
|
+
|
|
360
|
+
for branch_count, merge_count in timing_info.merge_counts.items():
|
|
361
|
+
merged_total += branch_count * merge_count
|
|
362
|
+
|
|
363
|
+
max_merge_size = max(timing_info.merge_counts)
|
|
364
|
+
|
|
365
|
+
timing_xml_node.attrib["max_branch_merge"] = str(max_merge_size)
|
|
366
|
+
timing_xml_node.attrib["merged_total"] = str(merged_total)
|
|
367
|
+
|
|
336
368
|
module_xml_node.append(timing_xml_node)
|
|
337
369
|
|
|
338
370
|
distributions = report_input_data["module_distribution_usages"][module_name]
|
|
@@ -565,6 +597,22 @@ def writeCompilationReport(report_filename, report_input_data, diffable):
|
|
|
565
597
|
tags=",".join(included_datafile.tags),
|
|
566
598
|
)
|
|
567
599
|
|
|
600
|
+
if report_input_data["included_metadata"]:
|
|
601
|
+
metadata_node = TreeXML.appendTreeElement(
|
|
602
|
+
root,
|
|
603
|
+
"metadata",
|
|
604
|
+
)
|
|
605
|
+
|
|
606
|
+
for distribution_name, reasons in sorted(
|
|
607
|
+
report_input_data["included_metadata"].items()
|
|
608
|
+
):
|
|
609
|
+
TreeXML.appendTreeElement(
|
|
610
|
+
metadata_node,
|
|
611
|
+
"included_metadata",
|
|
612
|
+
name=distribution_name,
|
|
613
|
+
reason=". ".join(reasons),
|
|
614
|
+
)
|
|
615
|
+
|
|
568
616
|
for standalone_entry_point in getStandaloneEntryPoints():
|
|
569
617
|
if standalone_entry_point.kind == "executable":
|
|
570
618
|
continue
|
|
@@ -736,7 +736,7 @@ class BuiltinMethodParameterSpecBase(BuiltinParameterSpec):
|
|
|
736
736
|
):
|
|
737
737
|
BuiltinParameterSpec.__init__(
|
|
738
738
|
self,
|
|
739
|
-
name="
|
|
739
|
+
name=self.method_prefix + "." + name,
|
|
740
740
|
arg_names=arg_names,
|
|
741
741
|
default_count=default_count,
|
|
742
742
|
list_star_arg=list_star_arg,
|
nuitka/specs/HardImportSpecs.py
CHANGED
|
@@ -168,12 +168,6 @@ ctypes_cdll_before_38_spec = BuiltinParameterSpec(
|
|
|
168
168
|
default_count=4,
|
|
169
169
|
)
|
|
170
170
|
|
|
171
|
-
builtins_open_since_3_spec = BuiltinParameterSpec(
|
|
172
|
-
"builtins.open",
|
|
173
|
-
("file", "mode", "buffering", "encoding", "errors", "newline", "closefd", "opener"),
|
|
174
|
-
default_count=7,
|
|
175
|
-
)
|
|
176
|
-
|
|
177
171
|
sys_exit_spec = BuiltinParameterSpecNoKeywords(
|
|
178
172
|
"sys.exit", ("exit_code",), default_count=1
|
|
179
173
|
)
|
|
@@ -14,12 +14,7 @@ from nuitka.__past__ import BytesIO, long, to_byte, unicode, xrange
|
|
|
14
14
|
from nuitka.build.DataComposerInterface import deriveModuleConstantsBlobName
|
|
15
15
|
from nuitka.Builtins import builtin_exception_values_list, builtin_named_values
|
|
16
16
|
from nuitka.containers.OrderedDicts import OrderedDict
|
|
17
|
-
from nuitka.PythonVersions import
|
|
18
|
-
isPythonValidCLongLongValue,
|
|
19
|
-
isPythonValidCLongValue,
|
|
20
|
-
python_version,
|
|
21
|
-
sizeof_clonglong,
|
|
22
|
-
)
|
|
17
|
+
from nuitka.PythonVersions import python_version
|
|
23
18
|
from nuitka.Serialization import (
|
|
24
19
|
BlobData,
|
|
25
20
|
BuiltinAnonValue,
|
|
@@ -33,6 +28,7 @@ from nuitka.utils.FileOperations import getFileSize, listDir, syncFileOutput
|
|
|
33
28
|
from nuitka.utils.Json import writeJsonToFilename
|
|
34
29
|
|
|
35
30
|
_max_uint64_t_value = 2**64 - 1
|
|
31
|
+
_max_uint31_t_value = 2**31 - 1
|
|
36
32
|
|
|
37
33
|
|
|
38
34
|
def _encodeVariableLength(value):
|
|
@@ -134,34 +130,36 @@ def _writeConstantValue(output, constant_value):
|
|
|
134
130
|
for element in constant_value:
|
|
135
131
|
_writeConstantValue(output, element)
|
|
136
132
|
elif constant_type is long:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
elif isPythonValidCLongLongValue(constant_value):
|
|
140
|
-
output.write(b"q" + struct.pack("q", constant_value))
|
|
141
|
-
else:
|
|
142
|
-
output.write(b"g")
|
|
133
|
+
is_negative = constant_value < 0
|
|
134
|
+
abs_constant_value = abs(constant_value)
|
|
143
135
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
136
|
+
if abs_constant_value < _max_uint31_t_value:
|
|
137
|
+
output.write(
|
|
138
|
+
(b"q" if is_negative else b"l")
|
|
139
|
+
+ _encodeVariableLength(abs_constant_value)
|
|
140
|
+
)
|
|
141
|
+
else:
|
|
142
|
+
output.write(b"G" if is_negative else b"g")
|
|
150
143
|
|
|
151
144
|
parts = []
|
|
152
145
|
|
|
153
|
-
mod_value = 2
|
|
146
|
+
mod_value = 2**31
|
|
154
147
|
while abs_constant_value > 0:
|
|
155
148
|
parts.append(abs_constant_value % mod_value)
|
|
156
|
-
abs_constant_value >>=
|
|
149
|
+
abs_constant_value >>= 31
|
|
157
150
|
|
|
158
|
-
output.write(
|
|
151
|
+
output.write(_encodeVariableLength(len(parts)))
|
|
159
152
|
for part in reversed(parts):
|
|
160
|
-
output.write(
|
|
153
|
+
output.write(_encodeVariableLength(part))
|
|
161
154
|
|
|
162
155
|
elif constant_type is int:
|
|
163
|
-
|
|
164
|
-
|
|
156
|
+
is_negative = constant_value < 0
|
|
157
|
+
abs_constant_value = abs(constant_value)
|
|
158
|
+
# This is Python2 then.
|
|
159
|
+
|
|
160
|
+
output.write(
|
|
161
|
+
(b"I" if is_negative else b"i") + _encodeVariableLength(abs_constant_value)
|
|
162
|
+
)
|
|
165
163
|
elif constant_type is float:
|
|
166
164
|
if constant_value == 0.0:
|
|
167
165
|
if copysign(1, constant_value) == 1:
|
|
@@ -227,6 +225,8 @@ def _writeConstantValue(output, constant_value):
|
|
|
227
225
|
_writeConstantValue(output, constant_value.step)
|
|
228
226
|
elif constant_type is xrange:
|
|
229
227
|
output.write(b";")
|
|
228
|
+
_last_written = None
|
|
229
|
+
|
|
230
230
|
range_args = [
|
|
231
231
|
int(v)
|
|
232
232
|
for v in str(constant_value)[7 if str is bytes else 6 : -1].split(",")
|
|
@@ -240,7 +240,9 @@ def _writeConstantValue(output, constant_value):
|
|
|
240
240
|
if len(range_args) < 3:
|
|
241
241
|
range_args.append(1)
|
|
242
242
|
|
|
243
|
-
output
|
|
243
|
+
_writeConstantValue(output, range_args[0])
|
|
244
|
+
_writeConstantValue(output, range_args[1])
|
|
245
|
+
_writeConstantValue(output, range_args[2])
|
|
244
246
|
elif constant_type is complex:
|
|
245
247
|
# Some float values do not transport well, use float streaming then.
|
|
246
248
|
if (
|
|
@@ -275,10 +277,10 @@ def _writeConstantValue(output, constant_value):
|
|
|
275
277
|
elif constant_type is BlobData:
|
|
276
278
|
constant_value = constant_value.getData()
|
|
277
279
|
output.write(b"X")
|
|
278
|
-
output.write(
|
|
280
|
+
output.write(_encodeVariableLength(len(constant_value)))
|
|
279
281
|
output.write(constant_value)
|
|
280
282
|
elif constant_type is BuiltinGenericAliasValue:
|
|
281
|
-
output.write(b"
|
|
283
|
+
output.write(b"A")
|
|
282
284
|
_last_written = None
|
|
283
285
|
_writeConstantValue(output, constant_value.origin)
|
|
284
286
|
_writeConstantValue(output, constant_value.args)
|
|
@@ -10,7 +10,6 @@ import sys
|
|
|
10
10
|
from contextlib import contextmanager
|
|
11
11
|
|
|
12
12
|
from nuitka.__past__ import unicode
|
|
13
|
-
from nuitka.Tracing import my_print
|
|
14
13
|
from nuitka.utils.Execution import (
|
|
15
14
|
NuitkaCalledProcessError,
|
|
16
15
|
check_call,
|
|
@@ -25,8 +24,9 @@ from nuitka.utils.FileOperations import (
|
|
|
25
24
|
|
|
26
25
|
|
|
27
26
|
class Virtualenv(object):
|
|
28
|
-
def __init__(self, env_dir):
|
|
27
|
+
def __init__(self, env_dir, logger):
|
|
29
28
|
self.env_dir = os.path.abspath(env_dir)
|
|
29
|
+
self.logger = logger
|
|
30
30
|
|
|
31
31
|
def runCommand(self, commands, env=None, style=None):
|
|
32
32
|
if type(commands) in (str, unicode):
|
|
@@ -41,12 +41,14 @@ class Virtualenv(object):
|
|
|
41
41
|
command = " && ".join(commands)
|
|
42
42
|
|
|
43
43
|
if style is not None:
|
|
44
|
-
|
|
44
|
+
self.logger.info("Executing: %s" % command, style=style)
|
|
45
45
|
|
|
46
46
|
with withEnvironmentVarsOverridden(env):
|
|
47
47
|
exit_code = os.system(command)
|
|
48
48
|
if exit_code != 0:
|
|
49
|
-
|
|
49
|
+
self.logger.info(
|
|
50
|
+
"Failure %s for: %s" % (exit_code, command), style=style
|
|
51
|
+
)
|
|
50
52
|
|
|
51
53
|
raise NuitkaCalledProcessError(
|
|
52
54
|
exit_code, command, output=None, stderr=None
|
|
@@ -69,7 +71,7 @@ class Virtualenv(object):
|
|
|
69
71
|
command = " && ".join(commands)
|
|
70
72
|
|
|
71
73
|
if style is not None:
|
|
72
|
-
|
|
74
|
+
self.logger.info("Executing: %s" % command, style=style)
|
|
73
75
|
|
|
74
76
|
# Use subprocess and also return outputs, stdout, stderr, result
|
|
75
77
|
return executeProcess(
|
|
@@ -82,14 +84,16 @@ class Virtualenv(object):
|
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
@contextmanager
|
|
85
|
-
def withVirtualenv(
|
|
87
|
+
def withVirtualenv(
|
|
88
|
+
env_name, logger, base_dir=None, python=None, delete=True, style=None
|
|
89
|
+
):
|
|
86
90
|
"""Create a virtualenv and change into it.
|
|
87
91
|
|
|
88
92
|
Activating for actual use will be your task.
|
|
89
93
|
"""
|
|
90
94
|
|
|
91
95
|
if style is not None:
|
|
92
|
-
|
|
96
|
+
logger.info("Creating a virtualenv:")
|
|
93
97
|
|
|
94
98
|
if python is None:
|
|
95
99
|
python = sys.executable
|
|
@@ -105,19 +109,29 @@ def withVirtualenv(env_name, base_dir=None, python=None, delete=True, style=None
|
|
|
105
109
|
else:
|
|
106
110
|
env_dir = env_name
|
|
107
111
|
|
|
108
|
-
removeDirectory(
|
|
112
|
+
removeDirectory(
|
|
113
|
+
env_dir,
|
|
114
|
+
logger=logger,
|
|
115
|
+
ignore_errors=False,
|
|
116
|
+
extra_recommendation=None,
|
|
117
|
+
)
|
|
109
118
|
|
|
110
119
|
with withDirectoryChange(base_dir, allow_none=True):
|
|
111
120
|
command = [python, "-m", "virtualenv", env_name]
|
|
112
121
|
if style is not None:
|
|
113
|
-
|
|
122
|
+
logger.info("Executing: %s" % " ".join(command), style=style)
|
|
114
123
|
check_call(command)
|
|
115
124
|
|
|
116
125
|
try:
|
|
117
|
-
yield Virtualenv(env_dir)
|
|
126
|
+
yield Virtualenv(env_dir, logger=logger)
|
|
118
127
|
finally:
|
|
119
128
|
if delete:
|
|
120
|
-
removeDirectory(
|
|
129
|
+
removeDirectory(
|
|
130
|
+
env_dir,
|
|
131
|
+
logger=logger,
|
|
132
|
+
ignore_errors=False,
|
|
133
|
+
extra_recommendation=None,
|
|
134
|
+
)
|
|
121
135
|
|
|
122
136
|
|
|
123
137
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
@@ -45,6 +45,7 @@ def editModuleCode(module_search_desc):
|
|
|
45
45
|
|
|
46
46
|
candidate = module_search_desc
|
|
47
47
|
|
|
48
|
+
# spell-checker: ignore ONEFIL
|
|
48
49
|
while not candidate.endswith(".DIS") and not os.path.basename(
|
|
49
50
|
candidate
|
|
50
51
|
).startswith("ONEFIL"):
|
|
@@ -62,14 +63,23 @@ def editModuleCode(module_search_desc):
|
|
|
62
63
|
|
|
63
64
|
candidate = module_search_desc
|
|
64
65
|
|
|
65
|
-
while not candidate.endswith(".dist"):
|
|
66
|
+
while not candidate.endswith(".dist") and candidate:
|
|
66
67
|
candidate = os.path.dirname(candidate)
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
if candidate:
|
|
70
|
+
module_name = relpath(module_search_desc, start=candidate).replace(
|
|
71
|
+
"/", "."
|
|
72
|
+
)
|
|
73
|
+
else:
|
|
74
|
+
module_name = None
|
|
69
75
|
else:
|
|
70
76
|
module_name = ModuleName(module_search_desc)
|
|
71
77
|
|
|
72
|
-
if module_name is
|
|
78
|
+
if module_name is None:
|
|
79
|
+
tools_logger.sysexit(
|
|
80
|
+
"Error, did not find module for '%s' " % module_search_desc
|
|
81
|
+
)
|
|
82
|
+
else:
|
|
73
83
|
addMainScriptDirectory(os.getcwd())
|
|
74
84
|
module_filename = findModuleCode(module_name)
|
|
75
85
|
|
|
@@ -20,7 +20,12 @@ from nuitka.Progress import (
|
|
|
20
20
|
)
|
|
21
21
|
from nuitka.Tracing import onefile_logger
|
|
22
22
|
from nuitka.utils.AppDirs import getCacheDir
|
|
23
|
-
from nuitka.utils.FileOperations import
|
|
23
|
+
from nuitka.utils.FileOperations import (
|
|
24
|
+
areSamePaths,
|
|
25
|
+
getFileList,
|
|
26
|
+
getFileSize,
|
|
27
|
+
makePath,
|
|
28
|
+
)
|
|
24
29
|
from nuitka.utils.Hashing import Hash, HashCRC32
|
|
25
30
|
from nuitka.utils.Utils import (
|
|
26
31
|
decoratorRetries,
|
|
@@ -206,6 +211,20 @@ def _getCacheFilename(binary_filename, low_memory):
|
|
|
206
211
|
return os.path.join(cache_dir, hash_value.asHexDigest())
|
|
207
212
|
|
|
208
213
|
|
|
214
|
+
def _getInputFileList(dist_dir, start_binary):
|
|
215
|
+
file_list = getFileList(dist_dir, normalize=False)
|
|
216
|
+
file_list_size = len(file_list)
|
|
217
|
+
file_list = [
|
|
218
|
+
filename for filename in file_list if not areSamePaths(filename, start_binary)
|
|
219
|
+
]
|
|
220
|
+
file_list.insert(0, start_binary)
|
|
221
|
+
|
|
222
|
+
# If this fails, above code failed to find the start binary.
|
|
223
|
+
assert file_list_size == len(file_list)
|
|
224
|
+
|
|
225
|
+
return tuple(file_list)
|
|
226
|
+
|
|
227
|
+
|
|
209
228
|
def attachOnefilePayload(
|
|
210
229
|
dist_dir,
|
|
211
230
|
onefile_output_filename,
|
|
@@ -236,9 +255,7 @@ def attachOnefilePayload(
|
|
|
236
255
|
output_file.write(b"KA" + compression_indicator)
|
|
237
256
|
|
|
238
257
|
# Move the binary to start immediately to the start position
|
|
239
|
-
file_list =
|
|
240
|
-
file_list.remove(start_binary)
|
|
241
|
-
file_list.insert(0, start_binary)
|
|
258
|
+
file_list = _getInputFileList(dist_dir=dist_dir, start_binary=start_binary)
|
|
242
259
|
|
|
243
260
|
if isWin32Windows():
|
|
244
261
|
filename_encoding = "utf-16le"
|
|
@@ -14,8 +14,12 @@ from nuitka.importing.Importing import (
|
|
|
14
14
|
locateModule,
|
|
15
15
|
)
|
|
16
16
|
from nuitka.Tracing import tools_logger
|
|
17
|
+
from nuitka.tree.SourceHandling import readSourceCodeFromFilename
|
|
17
18
|
from nuitka.utils.FileOperations import listDllFilesFromDirectory, relpath
|
|
18
|
-
from nuitka.utils.Importing import
|
|
19
|
+
from nuitka.utils.Importing import (
|
|
20
|
+
getPackageDirFilename,
|
|
21
|
+
getSharedLibrarySuffixes,
|
|
22
|
+
)
|
|
19
23
|
from nuitka.utils.ModuleNames import ModuleName
|
|
20
24
|
from nuitka.utils.SharedLibraries import getDllExportedSymbols
|
|
21
25
|
from nuitka.utils.Utils import isMacOS
|
|
@@ -56,7 +60,7 @@ def displayDLLs(module_name):
|
|
|
56
60
|
if not hasMainScriptDirectory():
|
|
57
61
|
addMainScriptDirectory(os.getcwd())
|
|
58
62
|
|
|
59
|
-
module_name, package_directory,
|
|
63
|
+
module_name, package_directory, module_kind, finding = locateModule(
|
|
60
64
|
module_name=module_name, parent_package=None, level=0
|
|
61
65
|
)
|
|
62
66
|
|
|
@@ -71,12 +75,22 @@ def displayDLLs(module_name):
|
|
|
71
75
|
% module_name.asString()
|
|
72
76
|
)
|
|
73
77
|
|
|
78
|
+
from nuitka.plugins.Plugins import activatePlugins
|
|
79
|
+
|
|
80
|
+
activatePlugins()
|
|
81
|
+
|
|
82
|
+
if module_kind != "extension":
|
|
83
|
+
package_filename = getPackageDirFilename(package_directory)
|
|
84
|
+
|
|
85
|
+
if package_filename is not None:
|
|
86
|
+
readSourceCodeFromFilename(module_name, package_filename, pre_load=False)
|
|
87
|
+
|
|
74
88
|
tools_logger.info("Checking package directory '%s' .. " % package_directory)
|
|
75
89
|
|
|
76
90
|
count = 0
|
|
77
91
|
|
|
78
92
|
for package_dll_dir in getPackageSpecificDLLDirectories(
|
|
79
|
-
module_name, consider_plugins=
|
|
93
|
+
module_name, consider_plugins=True
|
|
80
94
|
):
|
|
81
95
|
first = True
|
|
82
96
|
|
|
@@ -344,7 +344,7 @@ class TypeDescBase(getMetaClassBase("Type", require_slots=False)):
|
|
|
344
344
|
# for at least "LONG", maybe others. spell-checker: ignore RICHCOMPARE
|
|
345
345
|
|
|
346
346
|
assert self is object_desc, self
|
|
347
|
-
return "
|
|
347
|
+
return "TP_RICHCOMPARE(%s)" % operand
|
|
348
348
|
elif slot == "tp_compare":
|
|
349
349
|
return operand + "->tp_compare"
|
|
350
350
|
else:
|
|
@@ -387,15 +387,21 @@ class TypeDescBase(getMetaClassBase("Type", require_slots=False)):
|
|
|
387
387
|
pass
|
|
388
388
|
|
|
389
389
|
@staticmethod
|
|
390
|
-
def getOperationErrorMessageName(operator):
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
390
|
+
def getOperationErrorMessageName(operator, inplace):
|
|
391
|
+
operator = operator.replace("%", "%%")
|
|
392
|
+
|
|
393
|
+
if operator == "**" and not inplace:
|
|
394
394
|
return "** or pow()"
|
|
395
395
|
elif operator == "divmod":
|
|
396
|
+
assert not inplace
|
|
396
397
|
return "divmod()"
|
|
397
|
-
|
|
398
|
-
|
|
398
|
+
|
|
399
|
+
assert "=" not in operator, operator
|
|
400
|
+
|
|
401
|
+
if inplace:
|
|
402
|
+
operator = operator + "="
|
|
403
|
+
|
|
404
|
+
return operator
|
|
399
405
|
|
|
400
406
|
def getReturnUnorderableTypeErrorCode(
|
|
401
407
|
self, operator, left, right, operand1, operand2
|
|
@@ -249,6 +249,16 @@ lambda source_ref: wrapExpressionWithNodeSideEffects(
|
|
|
249
249
|
)
|
|
250
250
|
"""
|
|
251
251
|
|
|
252
|
+
attribute_shape_empty[
|
|
253
|
+
"fromkeys", "tshape_dict"
|
|
254
|
+
] = """
|
|
255
|
+
lambda source_ref: makeRaiseExceptionReplacementExpression(
|
|
256
|
+
expression=dict_arg,
|
|
257
|
+
exception_type="TypeError",
|
|
258
|
+
exception_value=getDictFromkeysNoArgErrorMessage(),
|
|
259
|
+
)
|
|
260
|
+
"""
|
|
261
|
+
|
|
252
262
|
|
|
253
263
|
def emitGenerationWarning(emit, doc_string, template_name):
|
|
254
264
|
generate_names = set()
|
|
@@ -358,7 +368,12 @@ def makeAttributeNodes():
|
|
|
358
368
|
|
|
359
369
|
emit("from nuitka.nodes.ConstantRefNodes import makeConstantRefNode")
|
|
360
370
|
emit(
|
|
361
|
-
"
|
|
371
|
+
"""\
|
|
372
|
+
from nuitka.nodes.NodeMakingHelpers import (
|
|
373
|
+
wrapExpressionWithNodeSideEffects,
|
|
374
|
+
makeRaiseExceptionReplacementExpression
|
|
375
|
+
)
|
|
376
|
+
"""
|
|
362
377
|
)
|
|
363
378
|
|
|
364
379
|
emit(
|
|
@@ -367,6 +382,8 @@ def makeAttributeNodes():
|
|
|
367
382
|
|
|
368
383
|
emit("from nuitka.nodes.AttributeNodes import makeExpressionAttributeLookup")
|
|
369
384
|
|
|
385
|
+
emit("from nuitka.PythonVersions import getDictFromkeysNoArgErrorMessage")
|
|
386
|
+
|
|
370
387
|
# TODO: Maybe generate its effect instead of using a base class.
|
|
371
388
|
emit("from .NodeBases import SideEffectsFromChildrenMixin")
|
|
372
389
|
|
nuitka/tools/testing/Common.py
CHANGED
|
@@ -211,7 +211,12 @@ def getTempDir():
|
|
|
211
211
|
)
|
|
212
212
|
|
|
213
213
|
def removeTempDir():
|
|
214
|
-
removeDirectory(
|
|
214
|
+
removeDirectory(
|
|
215
|
+
path=tmp_dir,
|
|
216
|
+
logger=test_logger,
|
|
217
|
+
ignore_errors=True,
|
|
218
|
+
extra_recommendation=None,
|
|
219
|
+
)
|
|
215
220
|
|
|
216
221
|
atexit.register(removeTempDir)
|
|
217
222
|
|
|
@@ -370,7 +375,12 @@ def _removeCPythonTestSuiteDir():
|
|
|
370
375
|
# Cleanup, some tests apparently forget that.
|
|
371
376
|
try:
|
|
372
377
|
if os.path.isdir("@test"):
|
|
373
|
-
removeDirectory(
|
|
378
|
+
removeDirectory(
|
|
379
|
+
"@test",
|
|
380
|
+
logger=test_logger,
|
|
381
|
+
ignore_errors=False,
|
|
382
|
+
extra_recommendation=None,
|
|
383
|
+
)
|
|
374
384
|
elif os.path.isfile("@test"):
|
|
375
385
|
os.unlink("@test")
|
|
376
386
|
except OSError:
|
|
@@ -1329,6 +1339,8 @@ def checkTestRequirements(filename):
|
|
|
1329
1339
|
|
|
1330
1340
|
if os.path.isfile(candidate):
|
|
1331
1341
|
filename = candidate
|
|
1342
|
+
else:
|
|
1343
|
+
filename = os.path.join(filename, getMainProgramFilename(filename))
|
|
1332
1344
|
|
|
1333
1345
|
for line in readSourceCodeFromFilename(None, filename).splitlines():
|
|
1334
1346
|
if line.startswith("# nuitka-skip-unless-"):
|
|
@@ -1786,6 +1798,7 @@ def checkLoadedFileAccesses(loaded_filenames, current_dir):
|
|
|
1786
1798
|
"libssl.1.0.0.dylib",
|
|
1787
1799
|
"libcrypto.1.1.dylib",
|
|
1788
1800
|
"libffi.dylib",
|
|
1801
|
+
"libfribidi.dylib",
|
|
1789
1802
|
):
|
|
1790
1803
|
continue
|
|
1791
1804
|
|
|
@@ -1800,10 +1813,7 @@ def checkLoadedFileAccesses(loaded_filenames, current_dir):
|
|
|
1800
1813
|
if isMacOS():
|
|
1801
1814
|
ignore = True
|
|
1802
1815
|
for ignored_dir in (
|
|
1803
|
-
"/System/Library
|
|
1804
|
-
"/System/Library/CoreServices",
|
|
1805
|
-
"/System/Library/Frameworks/",
|
|
1806
|
-
"/System/Library/dyld",
|
|
1816
|
+
"/System/Library",
|
|
1807
1817
|
"/AppleInternal",
|
|
1808
1818
|
"/System/Volumes/Preboot",
|
|
1809
1819
|
"/usr/lib/system/",
|
|
@@ -1815,6 +1825,9 @@ def checkLoadedFileAccesses(loaded_filenames, current_dir):
|
|
|
1815
1825
|
if not ignore:
|
|
1816
1826
|
continue
|
|
1817
1827
|
|
|
1828
|
+
if loaded_filename == "/System/Library":
|
|
1829
|
+
continue
|
|
1830
|
+
|
|
1818
1831
|
if loaded_filename == "/usr/libexec/rosetta/runtime":
|
|
1819
1832
|
continue
|
|
1820
1833
|
|