Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__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.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +108 -54
- nuitka/Options.py +69 -13
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +4 -0
- nuitka/build/SconsCompilerSettings.py +14 -3
- nuitka/build/SconsInterface.py +3 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +8 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helper/tuples.h +12 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +36 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
- nuitka/build/static_src/CompiledCoroutineType.c +41 -31
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
- nuitka/build/static_src/CompiledMethodType.c +6 -12
- nuitka/build/static_src/HelpersAllocator.c +266 -28
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +23 -14
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
- nuitka/build/static_src/HelpersDeepcopy.c +1 -0
- nuitka/build/static_src/HelpersDictionaries.c +195 -36
- nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +2 -2
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +132 -28
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +5 -2
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +6 -0
- nuitka/freezer/IncludedDataFiles.py +37 -6
- nuitka/freezer/Onefile.py +1 -0
- nuitka/freezer/Standalone.py +72 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +5 -2
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +2 -2
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/DictionaryNodes.py +1 -1
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/VariableAssignNodes.py +2 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/IteratorShapes.py +71 -0
- nuitka/nodes/shapes/ShapeMixins.py +18 -0
- nuitka/nodes/shapes/StandardShapes.py +47 -44
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +16 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/DllFilesPlugin.py +78 -2
- nuitka/plugins/standard/ImplicitImports.py +5 -15
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +23 -3
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/environments/Virtualenv.py +13 -5
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/podman/__main__.py +4 -2
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +69 -62
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +18 -39
- nuitka/utils/Hashing.py +5 -1
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/SharedLibraries.py +24 -0
- nuitka/utils/Signing.py +9 -1
- nuitka/utils/Utils.py +1 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
nuitka/PostProcessing.py
CHANGED
|
@@ -16,16 +16,16 @@ from nuitka.PythonVersions import getTargetPythonDLLPath, python_version
|
|
|
16
16
|
from nuitka.Tracing import postprocessing_logger
|
|
17
17
|
from nuitka.utils.Execution import wrapCommandForDebuggerForExec
|
|
18
18
|
from nuitka.utils.FileOperations import (
|
|
19
|
-
getExternalUsePath,
|
|
20
19
|
getFileContents,
|
|
21
20
|
getFileSize,
|
|
22
21
|
hasFilenameExtension,
|
|
23
|
-
|
|
22
|
+
makeFilesystemEncodable,
|
|
24
23
|
makePath,
|
|
25
24
|
putTextFileContents,
|
|
26
25
|
removeFileExecutablePermission,
|
|
27
26
|
)
|
|
28
27
|
from nuitka.utils.Images import convertImageToIconFormat
|
|
28
|
+
from nuitka.utils.Importing import importFromInlineCopy
|
|
29
29
|
from nuitka.utils.MacOSApp import createPlistInfoFile
|
|
30
30
|
from nuitka.utils.SharedLibraries import (
|
|
31
31
|
callInstallNameTool,
|
|
@@ -279,7 +279,8 @@ def executePostProcessing():
|
|
|
279
279
|
These are in part required steps, not usable after failure.
|
|
280
280
|
"""
|
|
281
281
|
|
|
282
|
-
# Lots of cases to deal with,
|
|
282
|
+
# Lots of cases to deal with,
|
|
283
|
+
# pylint: disable=too-many-branches,too-many-locals,too-many-statements
|
|
283
284
|
|
|
284
285
|
result_filename = OutputDirectories.getResultFullpath(onefile=False)
|
|
285
286
|
|
|
@@ -372,8 +373,6 @@ Error, expected 'libpython dependency not found. Please report the bug."""
|
|
|
372
373
|
|
|
373
374
|
# Might have to create a CMD file, potentially with debugger run.
|
|
374
375
|
if Options.shallCreateCmdFileForExecution():
|
|
375
|
-
dll_directory = getExternalUsePath(os.path.dirname(getTargetPythonDLLPath()))
|
|
376
|
-
|
|
377
376
|
cmd_filename = OutputDirectories.getResultRunFilename(onefile=False)
|
|
378
377
|
|
|
379
378
|
cmd_contents = """
|
|
@@ -389,52 +388,84 @@ set NUITKA_PYTHONPATH=%(python_path)s
|
|
|
389
388
|
if Options.shallRunInDebugger()
|
|
390
389
|
else ""
|
|
391
390
|
),
|
|
392
|
-
"dll_directory":
|
|
393
|
-
|
|
394
|
-
"python_path": ";".join(sys.path),
|
|
395
|
-
"exe_filename": os.path.basename(
|
|
396
|
-
result_filename
|
|
397
|
-
if isFilesystemEncodable(result_filename)
|
|
398
|
-
else getExternalUsePath(result_filename)
|
|
391
|
+
"dll_directory": makeFilesystemEncodable(
|
|
392
|
+
os.path.dirname(getTargetPythonDLLPath())
|
|
399
393
|
),
|
|
394
|
+
"python_home": makeFilesystemEncodable(sys.prefix),
|
|
395
|
+
"python_path": ";".join(makeFilesystemEncodable(e) for e in sys.path),
|
|
396
|
+
"exe_filename": os.path.basename(makeFilesystemEncodable(result_filename)),
|
|
400
397
|
}
|
|
401
398
|
|
|
402
399
|
putTextFileContents(cmd_filename, cmd_contents)
|
|
403
400
|
|
|
404
401
|
# Create a ".pyi" file for created modules
|
|
405
402
|
if Options.shallMakeModule() and Options.shallCreatePyiFile():
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
403
|
+
if Options.shallCreatePyiFileContainStubs():
|
|
404
|
+
if python_version >= 0x300:
|
|
405
|
+
stubgen = importFromInlineCopy("stubgen", must_exist=False)
|
|
406
|
+
stubgen_reason = "Stubs included by default"
|
|
407
|
+
else:
|
|
408
|
+
stubgen = None
|
|
409
|
+
stubgen_reason = "Python2 is not supported for stubs"
|
|
410
|
+
else:
|
|
411
|
+
stubgen = None
|
|
412
|
+
stubgen_reason = "Stubs were disabled"
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
# tools that bundle libraries, including Nuitka itself. For instance
|
|
416
|
-
# standalone mode usage of the created library will need it.
|
|
414
|
+
imported_module_names = getImportedModuleNames()
|
|
417
415
|
|
|
418
|
-
|
|
419
|
-
#
|
|
420
|
-
|
|
421
|
-
# describes.
|
|
416
|
+
contents = """\
|
|
417
|
+
# This file was generated by Nuitka
|
|
418
|
+
"""
|
|
422
419
|
|
|
423
|
-
|
|
420
|
+
if stubgen is not None:
|
|
421
|
+
try:
|
|
422
|
+
stubs = stubgen.generate_stub_from_source(
|
|
423
|
+
source_code=OutputDirectories.getMainModule().getSourceCode(),
|
|
424
|
+
output_file_path=None,
|
|
425
|
+
text_only=True,
|
|
426
|
+
)
|
|
427
|
+
except Exception as e: # pylint: disable=broad-exception-caught
|
|
428
|
+
postprocessing_logger.warning(
|
|
429
|
+
"Stub generation with stubgen failed due to: '%s'. Please report the module code in an issue report."
|
|
430
|
+
% (str(e))
|
|
431
|
+
)
|
|
424
432
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
__name__ = ...
|
|
433
|
+
if Options.is_debug:
|
|
434
|
+
raise
|
|
428
435
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
"import %s" % module_name
|
|
433
|
-
for module_name in getImportedModuleNames()
|
|
436
|
+
stubs = None
|
|
437
|
+
stubgen_reason = (
|
|
438
|
+
"Stub generation failed due to error, please report the issue."
|
|
434
439
|
)
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
440
|
+
else:
|
|
441
|
+
stubs = None
|
|
442
|
+
|
|
443
|
+
stubs = "# %s\n%s" % (stubgen_reason, "" if stubs is None else stubs)
|
|
444
|
+
|
|
445
|
+
contents += "\n" + stubs + "\n"
|
|
446
|
+
|
|
447
|
+
contents += "__name__ = ..."
|
|
448
|
+
|
|
449
|
+
imported_module_names = getImportedModuleNames()
|
|
450
|
+
|
|
451
|
+
# Meaningless, TODO: Potentially others could be listed here too.
|
|
452
|
+
if "__future__" in imported_module_names:
|
|
453
|
+
imported_module_names.remove("__future__")
|
|
454
|
+
|
|
455
|
+
contents += "\n" * 4
|
|
456
|
+
|
|
457
|
+
if imported_module_names:
|
|
458
|
+
contents += "# Modules used internally, to allow implicit dependencies to be seen:\n"
|
|
459
|
+
contents += "\n".join(
|
|
460
|
+
"import %s" % module_name for module_name in getImportedModuleNames()
|
|
461
|
+
)
|
|
462
|
+
else:
|
|
463
|
+
contents += (
|
|
464
|
+
"# No other modules used internally, no implicit dependencies.\n"
|
|
465
|
+
)
|
|
466
|
+
|
|
467
|
+
pyi_filename = OutputDirectories.getResultBasePath() + ".pyi"
|
|
468
|
+
putTextFileContents(pyi_filename, contents, encoding="utf-8")
|
|
438
469
|
|
|
439
470
|
if isWin32Windows() and getFileSize(result_filename) > 2**30 * 1.8:
|
|
440
471
|
postprocessing_logger.warning(
|
nuitka/Progress.py
CHANGED
|
@@ -11,6 +11,7 @@ to the user while it's being displayed.
|
|
|
11
11
|
from contextlib import contextmanager
|
|
12
12
|
|
|
13
13
|
from nuitka import Tracing
|
|
14
|
+
from nuitka.PythonVersions import isPythonWithGil
|
|
14
15
|
from nuitka.Tracing import general
|
|
15
16
|
from nuitka.utils.Importing import importFromInlineCopy
|
|
16
17
|
from nuitka.utils.ThreadedExecutor import RLock
|
|
@@ -23,6 +24,17 @@ use_progress_bar = False
|
|
|
23
24
|
tqdm = None
|
|
24
25
|
colorama = None
|
|
25
26
|
|
|
27
|
+
_uses_threading = False
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def enableThreading():
|
|
31
|
+
"""Inform about threading being used."""
|
|
32
|
+
|
|
33
|
+
# Singleton, pylint: disable=global-statement
|
|
34
|
+
global _uses_threading
|
|
35
|
+
|
|
36
|
+
_uses_threading = True
|
|
37
|
+
|
|
26
38
|
|
|
27
39
|
class NuitkaProgressBar(object):
|
|
28
40
|
def __init__(self, iterable, stage, total, min_total, unit):
|
|
@@ -84,7 +96,9 @@ class NuitkaProgressBar(object):
|
|
|
84
96
|
@contextmanager
|
|
85
97
|
def withExternalWritingPause(self):
|
|
86
98
|
# spell-checker: ignore nolock
|
|
87
|
-
with self.tqdm.external_write_mode(
|
|
99
|
+
with self.tqdm.external_write_mode(
|
|
100
|
+
nolock=not _uses_threading or isPythonWithGil()
|
|
101
|
+
):
|
|
88
102
|
yield
|
|
89
103
|
|
|
90
104
|
|
|
@@ -207,6 +221,7 @@ def withNuitkaDownloadProgressBar(*args, **kwargs):
|
|
|
207
221
|
# spell-checker: ignore bsize, tsize
|
|
208
222
|
def onProgress(self, b=1, bsize=1, tsize=None):
|
|
209
223
|
if tsize is not None:
|
|
224
|
+
# False alarm when tqdm is not installed, pylint: disable=I0021,attribute-defined-outside-init
|
|
210
225
|
self.total = tsize
|
|
211
226
|
self.update(b * bsize - self.n)
|
|
212
227
|
|
nuitka/PythonVersions.py
CHANGED
|
@@ -32,12 +32,13 @@ def getSupportedPythonVersions():
|
|
|
32
32
|
"3.10",
|
|
33
33
|
"3.11",
|
|
34
34
|
"3.12",
|
|
35
|
+
"3.13",
|
|
35
36
|
)
|
|
36
37
|
|
|
37
38
|
|
|
38
39
|
def getNotYetSupportedPythonVersions():
|
|
39
40
|
"""Versions known to not work at all (yet)."""
|
|
40
|
-
return ("3.
|
|
41
|
+
return ("3.14",)
|
|
41
42
|
|
|
42
43
|
|
|
43
44
|
def getPartiallySupportedPythonVersions():
|
nuitka/Serialization.py
CHANGED
|
@@ -269,8 +269,10 @@ class ConstantAccessor(GlobalConstantAccessor):
|
|
|
269
269
|
|
|
270
270
|
if constant_type is tuple and not constant:
|
|
271
271
|
return "const_tuple_empty"
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
elif constant_type is int and constant in (-1, 0, 1):
|
|
273
|
+
return "const_" + namifyConstant(constant)
|
|
274
|
+
else:
|
|
275
|
+
return GlobalConstantAccessor._getConstantCode(self, constant)
|
|
274
276
|
|
|
275
277
|
|
|
276
278
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
nuitka/Tracing.py
CHANGED
|
@@ -20,7 +20,10 @@ import sys
|
|
|
20
20
|
import textwrap
|
|
21
21
|
import traceback
|
|
22
22
|
|
|
23
|
-
from nuitka.__past__ import
|
|
23
|
+
from nuitka.__past__ import ( # pylint: disable=redefined-builtin
|
|
24
|
+
BrokenPipeError,
|
|
25
|
+
raw_input,
|
|
26
|
+
)
|
|
24
27
|
from nuitka.utils.Utils import isWin32Windows
|
|
25
28
|
|
|
26
29
|
# Written by Options module.
|
|
@@ -101,6 +104,39 @@ def _enableAnsi():
|
|
|
101
104
|
_enabled_ansi = True
|
|
102
105
|
|
|
103
106
|
|
|
107
|
+
def hasTerminalLinkSupport():
|
|
108
|
+
if not sys.stdout.isatty():
|
|
109
|
+
return False
|
|
110
|
+
|
|
111
|
+
terminal_name = os.getenv("TERM_PROGRAM")
|
|
112
|
+
|
|
113
|
+
if terminal_name is not None:
|
|
114
|
+
if terminal_name == "vscode":
|
|
115
|
+
return True
|
|
116
|
+
|
|
117
|
+
# Windows terminal, in some cases, but not on Windows 11 unfortunately there
|
|
118
|
+
# is no difference between CMD with its own terminal and CMD in Windows
|
|
119
|
+
# Terminal, not even parent processes.
|
|
120
|
+
if isWin32Windows():
|
|
121
|
+
if "WT_SESSION" in os.environ or "WT_PROFILE_ID" in os.environ:
|
|
122
|
+
return True
|
|
123
|
+
|
|
124
|
+
# Powershell, should be used in new terminals only. Also hard to detect,
|
|
125
|
+
# although here we could search parent process names to determine it.
|
|
126
|
+
if isWin32Windows():
|
|
127
|
+
if "PSModulePath" in os.environ:
|
|
128
|
+
return True
|
|
129
|
+
|
|
130
|
+
return False
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def formatTerminalLink(text, link):
|
|
134
|
+
if link is not None and hasTerminalLinkSupport():
|
|
135
|
+
return "\033]8;;%s\033\\%s\033]8;;\033\\" % (link, text)
|
|
136
|
+
else:
|
|
137
|
+
return text
|
|
138
|
+
|
|
139
|
+
|
|
104
140
|
def _getDisableStyleCode():
|
|
105
141
|
return "\033[0m"
|
|
106
142
|
|
|
@@ -389,6 +425,10 @@ class FileLogger(OurLogger):
|
|
|
389
425
|
|
|
390
426
|
self.file_handle = file_handle
|
|
391
427
|
|
|
428
|
+
def __del__(self):
|
|
429
|
+
if self.file_handle is not None:
|
|
430
|
+
self.file_handle.close()
|
|
431
|
+
|
|
392
432
|
def my_print(self, message, **kwargs):
|
|
393
433
|
if "file" not in kwargs:
|
|
394
434
|
kwargs["file"] = self.file_handle or sys.stdout
|
|
@@ -452,6 +492,34 @@ wheel_logger = OurLogger("Nuitka-Wheel", base_style="blue")
|
|
|
452
492
|
cache_logger = OurLogger("Nuitka-Cache")
|
|
453
493
|
reports_logger = OurLogger("Nuitka-Reports")
|
|
454
494
|
|
|
495
|
+
|
|
496
|
+
def queryUser(question, choices, default, default_non_interactive):
|
|
497
|
+
assert default in choices, (default, choices)
|
|
498
|
+
assert default_non_interactive in choices, (default, choices)
|
|
499
|
+
|
|
500
|
+
prompt = "%s? %s : " % (
|
|
501
|
+
question,
|
|
502
|
+
"/".join(
|
|
503
|
+
"[%s]" % choice.title() if choice == default else choice.title()
|
|
504
|
+
for choice in choices
|
|
505
|
+
),
|
|
506
|
+
)
|
|
507
|
+
|
|
508
|
+
# Integrates with progress bar by closing it.
|
|
509
|
+
printLine(prompt, end="")
|
|
510
|
+
flushStandardOutputs()
|
|
511
|
+
|
|
512
|
+
try:
|
|
513
|
+
reply = raw_input() or default
|
|
514
|
+
except EOFError:
|
|
515
|
+
reply = default_non_interactive
|
|
516
|
+
|
|
517
|
+
if reply == "y":
|
|
518
|
+
reply = "yes"
|
|
519
|
+
|
|
520
|
+
return reply.lower()
|
|
521
|
+
|
|
522
|
+
|
|
455
523
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
456
524
|
# integrates with CPython, but also works on its own.
|
|
457
525
|
#
|
nuitka/Version.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright
|
|
1
|
+
# Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com
|
|
2
2
|
#
|
|
3
3
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
4
4
|
# integrates with CPython, but also works on its own.
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"""
|
|
21
21
|
|
|
22
22
|
version_string = """\
|
|
23
|
-
Nuitka V2.
|
|
23
|
+
Nuitka V2.5.6
|
|
24
24
|
Copyright (C) 2024 Kay Hayen."""
|
|
25
25
|
|
|
26
26
|
|
nuitka/build/Backend.scons
CHANGED
|
@@ -43,6 +43,7 @@ from nuitka.utils.FileOperations import (
|
|
|
43
43
|
deleteFile,
|
|
44
44
|
getExternalUsePath,
|
|
45
45
|
getFilenameExtension,
|
|
46
|
+
getNormalizedPath,
|
|
46
47
|
isFilesystemEncodable,
|
|
47
48
|
)
|
|
48
49
|
from nuitka.utils.Json import loadJsonFromFilename
|
|
@@ -92,7 +93,7 @@ from .SconsUtils import (
|
|
|
92
93
|
writeSconsReport,
|
|
93
94
|
)
|
|
94
95
|
|
|
95
|
-
# spell-checker: ignore ccversion,ccflags,werror,cppdefines,cpppath,linkflags,libpath
|
|
96
|
+
# spell-checker: ignore ccversion,cflags,ccflags,werror,cppdefines,cpppath,linkflags,libpath
|
|
96
97
|
|
|
97
98
|
# Set the arguments.
|
|
98
99
|
setArguments(ARGUMENTS)
|
|
@@ -135,8 +136,14 @@ profile_mode = getArgumentBool("profile_mode", False)
|
|
|
135
136
|
python_version_str = getArgumentRequired("python_version")
|
|
136
137
|
python_version = tuple(int(d) for d in python_version_str.split("."))
|
|
137
138
|
|
|
139
|
+
gil_mode = getArgumentBool("gil_mode")
|
|
140
|
+
|
|
138
141
|
# The ABI flags to target.
|
|
139
142
|
abiflags = getArgumentDefaulted("abiflags", "")
|
|
143
|
+
|
|
144
|
+
if not gil_mode and "t" not in abiflags:
|
|
145
|
+
abiflags = "t" + abiflags
|
|
146
|
+
|
|
140
147
|
python_abi_version = python_version_str + abiflags
|
|
141
148
|
|
|
142
149
|
# Python debug mode: reference count checking, assertions in CPython core.
|
|
@@ -254,6 +261,10 @@ python_sysflag_unicode = getArgumentBool("python_sysflag_unicode", False)
|
|
|
254
261
|
python_sysflag_utf8 = getArgumentBool("python_sysflag_utf8", False)
|
|
255
262
|
# python_sysflag_optimize
|
|
256
263
|
python_sysflag_optimize = getArgumentInt("python_sysflag_optimize", 0)
|
|
264
|
+
# python_sysflag_dontwritebytecode
|
|
265
|
+
python_sysflag_dontwritebytecode = getArgumentBool(
|
|
266
|
+
"python_sysflag_dontwritebytecode", False
|
|
267
|
+
)
|
|
257
268
|
# python_flag_no_asserts
|
|
258
269
|
python_flag_no_asserts = getArgumentBool("python_flag_no_asserts", False)
|
|
259
270
|
# python_flag_no_docstrings
|
|
@@ -356,6 +367,7 @@ env.the_compiler = env["CC"]
|
|
|
356
367
|
env.the_cc_name = os.path.normcase(os.path.basename(env.the_compiler))
|
|
357
368
|
env.standalone_mode = standalone_mode
|
|
358
369
|
env.debug_mode = debug_mode
|
|
370
|
+
env.debugger_mode = debugger_mode
|
|
359
371
|
env.unstripped_mode = unstripped_mode
|
|
360
372
|
env.console_mode = console_mode
|
|
361
373
|
env.source_dir = source_dir
|
|
@@ -379,6 +391,18 @@ env.msvc_mode = os.name == "nt" and not env.gcc_mode
|
|
|
379
391
|
env.mingw_mode = os.name == "nt" and env.gcc_mode
|
|
380
392
|
env.clangcl_mode = clangcl_mode
|
|
381
393
|
|
|
394
|
+
# For Python3.13, we need to enforce it for now to use MSVC
|
|
395
|
+
if os.name == "nt" and not env.msvc_mode and python_version >= (3, 13):
|
|
396
|
+
scons_logger.sysexit(
|
|
397
|
+
"""\
|
|
398
|
+
Sorry, non-MSVC is not currently supported with Python 3.13,
|
|
399
|
+
due to differences in layout internal structures of Python.
|
|
400
|
+
|
|
401
|
+
Newer Nuitka will work to solve this. Use Python 3.12 or
|
|
402
|
+
option "--msvc=latest" as a workaround for now and wait
|
|
403
|
+
for updates of Nuitka to add MinGW64 support back."""
|
|
404
|
+
)
|
|
405
|
+
|
|
382
406
|
# gcc compiler cf_protection option
|
|
383
407
|
env.cf_protection = cf_protection
|
|
384
408
|
|
|
@@ -466,7 +490,7 @@ if env.debug_mode:
|
|
|
466
490
|
# Allow gcc/clang to point out all kinds of inconsistency to us by
|
|
467
491
|
# raising an error.
|
|
468
492
|
|
|
469
|
-
if "allow-c-warnings" not in env.experimental_flags and not debugger_mode:
|
|
493
|
+
if "allow-c-warnings" not in env.experimental_flags and not env.debugger_mode:
|
|
470
494
|
env.Append(
|
|
471
495
|
CCFLAGS=[
|
|
472
496
|
"-Wall",
|
|
@@ -639,6 +663,9 @@ if env.nuitka_python:
|
|
|
639
663
|
if env.static_libpython:
|
|
640
664
|
env.Append(CPPDEFINES=["_NUITKA_STATIC_LIBPYTHON"])
|
|
641
665
|
|
|
666
|
+
if not gil_mode:
|
|
667
|
+
env.Append(CPPDEFINES="Py_GIL_DISABLED")
|
|
668
|
+
|
|
642
669
|
# TODO: This ought to be decided outside of scons and per flavor maybe.
|
|
643
670
|
if env.static_libpython and (
|
|
644
671
|
(not os.name == "nt" and not isMacOS()) or env.nuitka_python
|
|
@@ -703,7 +730,11 @@ if os.name == "nt":
|
|
|
703
730
|
addWinLib()
|
|
704
731
|
elif not module_mode:
|
|
705
732
|
# Add the python library path to the library path
|
|
706
|
-
|
|
733
|
+
if env.self_compiled_python_uninstalled:
|
|
734
|
+
python_lib_path = python_prefix_external
|
|
735
|
+
else:
|
|
736
|
+
python_lib_path = os.path.join(python_prefix_external, "lib")
|
|
737
|
+
|
|
707
738
|
env.Append(LIBPATH=[python_lib_path])
|
|
708
739
|
|
|
709
740
|
# Any module libs that are for self-compiled Python to be static.
|
|
@@ -736,7 +767,7 @@ elif not module_mode:
|
|
|
736
767
|
env.Append(LIBS=[env.File(env.static_libpython)])
|
|
737
768
|
|
|
738
769
|
# The linker won't succeed in searching for those for system Python of Debian
|
|
739
|
-
# compiled Pythons. Help that.
|
|
770
|
+
# compiled Pythons. Help that. spell-checker: ignore rdynamic,Xlinker,pthread
|
|
740
771
|
if python_prefix_external == "/usr" and isDebianBasedLinux():
|
|
741
772
|
env.Append(LIBS=["z", "m", "util", "pthread"])
|
|
742
773
|
|
|
@@ -778,6 +809,7 @@ if isMacOS():
|
|
|
778
809
|
env.Append(LINKFLAGS=["-undefined", "dynamic_lookup"])
|
|
779
810
|
else:
|
|
780
811
|
# For macOS we need to make sure install_name_tool can do its work
|
|
812
|
+
# spell-checker: ignore headerpad
|
|
781
813
|
env.Append(LINKFLAGS=["-headerpad_max_install_names"])
|
|
782
814
|
|
|
783
815
|
# The static include files reside in Nuitka installation, which may be where
|
|
@@ -801,7 +833,7 @@ env.Append(
|
|
|
801
833
|
]
|
|
802
834
|
)
|
|
803
835
|
|
|
804
|
-
if env.
|
|
836
|
+
if env.static_libpython and python_version >= (3, 12):
|
|
805
837
|
env.Append(
|
|
806
838
|
CPPPATH=[
|
|
807
839
|
os.path.join(env.nuitka_src, "inline_copy", "python_hacl", "hacl_312"),
|
|
@@ -825,6 +857,7 @@ if env.gcc_mode and not isMacOS() and not os.name == "nt" and not module_mode:
|
|
|
825
857
|
# The rpath is no longer used unless we do this on modern Linux. The
|
|
826
858
|
# option name is not very revealing, but basically without this, the
|
|
827
859
|
# rpath in the binary will be ignored by the loader.
|
|
860
|
+
# spell-checker: ignore dtags
|
|
828
861
|
if "linux" in sys.platform:
|
|
829
862
|
env.Append(LINKFLAGS=["-Wl,--disable-new-dtags"])
|
|
830
863
|
|
|
@@ -913,6 +946,9 @@ if os.name == "nt" and not isFilesystemEncodable(result_exe):
|
|
|
913
946
|
"_nuitka_temp.pyd" if module_mode else "_nuitka_temp.exe",
|
|
914
947
|
)
|
|
915
948
|
|
|
949
|
+
if not isFilesystemEncodable(result_exe):
|
|
950
|
+
result_exe = getNormalizedPath(os.path.relpath(result_exe))
|
|
951
|
+
|
|
916
952
|
deleteFile(result_exe, must_exist=False)
|
|
917
953
|
|
|
918
954
|
if module_mode:
|
|
@@ -976,6 +1012,10 @@ def createBuildDefinitionsFile():
|
|
|
976
1012
|
|
|
977
1013
|
build_definitions["SYSFLAG_OPTIMIZE"] = python_sysflag_optimize
|
|
978
1014
|
|
|
1015
|
+
build_definitions["SYSFLAG_DONTWRITEBYTECODE"] = (
|
|
1016
|
+
1 if python_sysflag_dontwritebytecode else 0
|
|
1017
|
+
)
|
|
1018
|
+
|
|
979
1019
|
build_definitions["_NUITKA_NO_ASSERTS"] = 1 if python_flag_no_asserts else 0
|
|
980
1020
|
|
|
981
1021
|
build_definitions["_NUITKA_NO_DOCSTRINGS"] = 1 if python_flag_no_docstrings else 0
|
|
@@ -80,6 +80,10 @@ module_mode = getArgumentBool("module_mode", False)
|
|
|
80
80
|
# Debug mode: Less optimizations, debug information in the resulting binary.
|
|
81
81
|
debug_mode = getArgumentBool("debug_mode", False)
|
|
82
82
|
|
|
83
|
+
# Debugger mode: Debug information in the resulting binary and intention to run
|
|
84
|
+
# in debugger.
|
|
85
|
+
debugger_mode = getArgumentBool("debugger_mode", False)
|
|
86
|
+
|
|
83
87
|
# Experimental indications. Do things that are not yet safe to do.
|
|
84
88
|
experimental = getArgumentList("experimental", "")
|
|
85
89
|
|
|
@@ -181,6 +185,7 @@ scons_details_logger.info(
|
|
|
181
185
|
|
|
182
186
|
if "CC" in os.environ:
|
|
183
187
|
# If the environment variable CC is set, use that.
|
|
188
|
+
env["CC"] = os.environ["CC"]
|
|
184
189
|
env["CCVERSION"] = None
|
|
185
190
|
|
|
186
191
|
scons_details_logger.info("Overridden with environment CC: %r" % env["CC"])
|
|
@@ -207,6 +212,7 @@ env = checkWindowsCompilerFound(
|
|
|
207
212
|
env.the_compiler = env["CC"] or env["CXX"]
|
|
208
213
|
env.the_cc_name = os.path.normcase(os.path.basename(env.the_compiler))
|
|
209
214
|
env.debug_mode = debug_mode
|
|
215
|
+
env.debugger_mode = debugger_mode
|
|
210
216
|
env.unstripped_mode = unstripped_mode
|
|
211
217
|
env.console_mode = console_mode
|
|
212
218
|
env.nuitka_src = nuitka_src
|
nuitka/build/Onefile.scons
CHANGED
|
@@ -110,6 +110,10 @@ module_mode = getArgumentBool("module_mode", False)
|
|
|
110
110
|
# Debug mode: Less optimizations, debug information in the resulting binary.
|
|
111
111
|
debug_mode = getArgumentBool("debug_mode", False)
|
|
112
112
|
|
|
113
|
+
# Debugger mode: Debug information in the resulting binary and intention to run
|
|
114
|
+
# in debugger.
|
|
115
|
+
debugger_mode = getArgumentBool("debugger_mode", False)
|
|
116
|
+
|
|
113
117
|
# Deployment mode
|
|
114
118
|
deployment_mode = getArgumentBool("deployment", False)
|
|
115
119
|
|
|
@@ -241,6 +245,7 @@ scons_details_logger.info(
|
|
|
241
245
|
|
|
242
246
|
if "CC" in os.environ:
|
|
243
247
|
# If the environment variable CC is set, use that.
|
|
248
|
+
env["CC"] = os.environ["CC"]
|
|
244
249
|
env["CCVERSION"] = None
|
|
245
250
|
|
|
246
251
|
scons_details_logger.info("Overridden with environment CC: %r" % env["CC"])
|
|
@@ -268,6 +273,7 @@ env.the_compiler = env["CC"] or env["CXX"]
|
|
|
268
273
|
env.the_cc_name = os.path.normcase(os.path.basename(env.the_compiler))
|
|
269
274
|
env.standalone_mode = True # We are only used in this case.
|
|
270
275
|
env.debug_mode = debug_mode
|
|
276
|
+
env.debugger_mode = debugger_mode
|
|
271
277
|
env.unstripped_mode = unstripped_mode
|
|
272
278
|
env.console_mode = console_mode
|
|
273
279
|
env.source_dir = source_dir
|
nuitka/build/SconsCaching.py
CHANGED
|
@@ -144,6 +144,7 @@ def enableCcache(
|
|
|
144
144
|
|
|
145
145
|
if inject_ccache:
|
|
146
146
|
# The ccache needs absolute path, otherwise it will not work.
|
|
147
|
+
# spell-checker: ignore getpid
|
|
147
148
|
ccache_logfile = getExternalUsePath(
|
|
148
149
|
os.path.abspath(os.path.join(source_dir, "ccache-%d.txt" % os.getpid())),
|
|
149
150
|
only_dirname=True,
|
|
@@ -268,6 +269,8 @@ def _writeClcacheStatistics():
|
|
|
268
269
|
|
|
269
270
|
|
|
270
271
|
def _getCcacheStatistics(ccache_logfile):
|
|
272
|
+
# parsing ccache is a bit complicated as we need to work around bugs
|
|
273
|
+
# and version differences
|
|
271
274
|
data = {}
|
|
272
275
|
|
|
273
276
|
if os.path.exists(ccache_logfile):
|
|
@@ -371,6 +374,7 @@ to install it."""
|
|
|
371
374
|
"preprocessed_cache_miss",
|
|
372
375
|
"primary_storage_miss",
|
|
373
376
|
"called_for_link",
|
|
377
|
+
"no_input_file",
|
|
374
378
|
"local_storage_read_hit",
|
|
375
379
|
"local_storage_read_miss",
|
|
376
380
|
"local_storage_write",
|
|
@@ -170,8 +170,12 @@ def _enableLtoSettings(
|
|
|
170
170
|
lto_mode = False
|
|
171
171
|
reason = "known to be not supported (CondaCC)"
|
|
172
172
|
elif isMacOS() and env.gcc_mode and env.clang_mode:
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
if env.debugger_mode:
|
|
174
|
+
lto_mode = False
|
|
175
|
+
reason = "must be disabled to see line numbers (macOS clang)"
|
|
176
|
+
else:
|
|
177
|
+
lto_mode = True
|
|
178
|
+
reason = "known to be supported (macOS clang)"
|
|
175
179
|
elif env.mingw_mode and env.clang_mode:
|
|
176
180
|
lto_mode = False
|
|
177
181
|
reason = "known to not be supported (new MinGW64 Clang)"
|
|
@@ -783,7 +787,7 @@ def setupCCompiler(env, lto_mode, pgo_mode, job_count, onefile_compile):
|
|
|
783
787
|
|
|
784
788
|
# Even if console is forced, for Win32 it means to specify Windows
|
|
785
789
|
# subsystem, we can still attach or create.
|
|
786
|
-
if env.console_mode
|
|
790
|
+
if env.console_mode in ("attach", "disable"):
|
|
787
791
|
if env.mingw_mode:
|
|
788
792
|
env.Append(LINKFLAGS=["-Wl,--subsystem,windows"])
|
|
789
793
|
env.Append(CPPDEFINES=["_NUITKA_WINMAIN_ENTRY_POINT"])
|
|
@@ -794,6 +798,10 @@ def setupCCompiler(env, lto_mode, pgo_mode, job_count, onefile_compile):
|
|
|
794
798
|
if env.console_mode == "attach" and os.name == "nt":
|
|
795
799
|
env.Append(CPPDEFINES=["_NUITKA_ATTACH_CONSOLE_WINDOW"])
|
|
796
800
|
|
|
801
|
+
if env.console_mode == "hide" and os.name == "nt":
|
|
802
|
+
env.Append(CPPDEFINES=["_NUITKA_HIDE_CONSOLE_WINDOW"])
|
|
803
|
+
env.Append(LIBS=["User32"])
|
|
804
|
+
|
|
797
805
|
# Avoid dependency on MinGW libraries, spell-checker: ignore libgcc
|
|
798
806
|
if env.mingw_mode and not env.clang_mode:
|
|
799
807
|
env.Append(LINKFLAGS=["-static-libgcc"])
|
|
@@ -986,6 +994,9 @@ def reportCCompiler(env, context, output_func):
|
|
|
986
994
|
if env.the_cc_name == "cl":
|
|
987
995
|
cc_output = "%s %s" % (env.the_cc_name, getMsvcVersionString(env))
|
|
988
996
|
elif isGccName(env.the_cc_name):
|
|
997
|
+
if env.gcc_version is None:
|
|
998
|
+
env.gcc_version = myDetectVersion(env, env.the_compiler)
|
|
999
|
+
|
|
989
1000
|
cc_output = "%s %s" % (
|
|
990
1001
|
env.the_cc_name,
|
|
991
1002
|
".".join(str(d) for d in env.gcc_version),
|
nuitka/build/SconsInterface.py
CHANGED
|
@@ -125,6 +125,7 @@ def _getPythonForSconsExePath():
|
|
|
125
125
|
"3.10",
|
|
126
126
|
"3.11",
|
|
127
127
|
"3.12",
|
|
128
|
+
"3.13",
|
|
128
129
|
)
|
|
129
130
|
if not isWin32Windows():
|
|
130
131
|
scons_supported_pythons += ("2.7", "2.6")
|
|
@@ -471,6 +472,8 @@ def setCommonSconsOptions(options):
|
|
|
471
472
|
|
|
472
473
|
options["debug_modes"] = ",".join(Options.getDebugModeIndications())
|
|
473
474
|
|
|
475
|
+
options["deployment"] = asBoolStr(Options.isDeploymentMode())
|
|
476
|
+
|
|
474
477
|
options["no_deployment"] = ",".join(Options.getNoDeploymentIndications())
|
|
475
478
|
|
|
476
479
|
if Options.shallRunInDebugger():
|
nuitka/build/SconsUtils.py
CHANGED
|
@@ -15,6 +15,7 @@ import sys
|
|
|
15
15
|
|
|
16
16
|
from nuitka.__past__ import basestring, unicode
|
|
17
17
|
from nuitka.containers.OrderedDicts import OrderedDict
|
|
18
|
+
from nuitka.Progress import enableThreading
|
|
18
19
|
from nuitka.Tracing import scons_details_logger, scons_logger
|
|
19
20
|
from nuitka.utils.Execution import executeProcess
|
|
20
21
|
from nuitka.utils.FileOperations import (
|
|
@@ -44,6 +45,10 @@ def initScons():
|
|
|
44
45
|
|
|
45
46
|
SCons.dblite.dblite.sync = no_sync
|
|
46
47
|
|
|
48
|
+
# We use threads during build, so keep locks if necessary for progress bar
|
|
49
|
+
# updates.
|
|
50
|
+
enableThreading()
|
|
51
|
+
|
|
47
52
|
|
|
48
53
|
def setupScons(env, source_dir):
|
|
49
54
|
env["BUILD_DIR"] = source_dir
|