Nuitka-winsvc 2.1.6__cp311-cp311-win_amd64.whl → 2.2.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.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/RECORD +232 -223
- nuitka/Errors.py +4 -0
- nuitka/HardImportRegistry.py +18 -1
- nuitka/MainControl.py +27 -30
- nuitka/OptionParsing.py +32 -30
- nuitka/Options.py +26 -13
- nuitka/OutputDirectories.py +7 -4
- nuitka/PostProcessing.py +9 -7
- nuitka/Progress.py +3 -3
- nuitka/PythonVersions.py +2 -2
- nuitka/TreeXML.py +1 -1
- nuitka/Version.py +1 -1
- nuitka/build/Backend.scons +2 -1
- nuitka/build/DataComposerInterface.py +1 -0
- nuitka/build/Onefile.scons +2 -1
- nuitka/build/SconsCaching.py +64 -46
- nuitka/build/SconsCompilerSettings.py +19 -6
- nuitka/build/SconsHacks.py +0 -1
- nuitka/build/SconsInterface.py +84 -5
- nuitka/build/SconsProgress.py +0 -1
- nuitka/build/SconsUtils.py +8 -4
- nuitka/build/include/nuitka/allocator.h +8 -3
- nuitka/build/include/nuitka/compiled_cell.h +8 -0
- nuitka/build/include/nuitka/exceptions.h +554 -179
- nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
- nuitka/build/include/nuitka/helper/import_hard.h +3 -0
- nuitka/build/include/nuitka/helper/ints.h +15 -2
- nuitka/build/include/nuitka/helper/lists.h +4 -1
- nuitka/build/include/nuitka/helper/raising.h +12 -0
- nuitka/build/include/nuitka/helper/tuples.h +5 -1
- nuitka/build/include/nuitka/helpers.h +4 -0
- nuitka/build/include/nuitka/importing.h +3 -4
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +38 -11
- nuitka/build/include/nuitka/printing.h +3 -0
- nuitka/build/include/nuitka/threading.h +2 -6
- nuitka/build/include/nuitka/type_aliases.h +27 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
- nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
- nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
- nuitka/build/static_src/CompiledCodeHelpers.c +24 -14
- nuitka/build/static_src/CompiledCoroutineType.c +96 -114
- nuitka/build/static_src/CompiledFrameType.c +14 -11
- nuitka/build/static_src/CompiledFunctionType.c +34 -7
- nuitka/build/static_src/CompiledGeneratorType.c +248 -142
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
- nuitka/build/static_src/CompiledMethodType.c +8 -7
- nuitka/build/static_src/HelpersAttributes.c +2 -19
- nuitka/build/static_src/HelpersBuiltin.c +2 -1
- nuitka/build/static_src/HelpersComparisonEq.c +32 -18
- nuitka/build/static_src/HelpersComparisonGe.c +50 -36
- nuitka/build/static_src/HelpersComparisonGt.c +50 -36
- nuitka/build/static_src/HelpersComparisonLe.c +50 -36
- nuitka/build/static_src/HelpersComparisonLt.c +50 -36
- nuitka/build/static_src/HelpersComparisonNe.c +32 -18
- nuitka/build/static_src/HelpersDeepcopy.c +6 -8
- nuitka/build/static_src/HelpersDictionaries.c +8 -3
- nuitka/build/static_src/HelpersExceptions.c +36 -22
- nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
- nuitka/build/static_src/HelpersImportHard.c +15 -0
- nuitka/build/static_src/HelpersJitSources.c +46 -0
- nuitka/build/static_src/HelpersLists.c +40 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
- nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
- nuitka/build/static_src/HelpersProfiling.c +3 -4
- nuitka/build/static_src/HelpersRaising.c +62 -1
- nuitka/build/static_src/HelpersStrings.c +203 -8
- nuitka/build/static_src/HelpersTypes.c +42 -0
- nuitka/build/static_src/MainProgram.c +1 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
- nuitka/build/static_src/OnefileBootstrap.c +3 -3
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
- nuitka/code_generation/BuiltinCodes.py +1 -0
- nuitka/code_generation/CodeGeneration.py +11 -0
- nuitka/code_generation/CodeHelpers.py +5 -3
- nuitka/code_generation/CodeObjectCodes.py +10 -6
- nuitka/code_generation/ComparisonCodes.py +19 -3
- nuitka/code_generation/ConstantCodes.py +5 -0
- nuitka/code_generation/Contexts.py +22 -6
- nuitka/code_generation/Emission.py +1 -0
- nuitka/code_generation/ErrorCodes.py +8 -16
- nuitka/code_generation/EvalCodes.py +5 -3
- nuitka/code_generation/ExceptionCodes.py +8 -1
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
- nuitka/code_generation/FrameCodes.py +5 -3
- nuitka/code_generation/FunctionCodes.py +0 -1
- nuitka/code_generation/GeneratorCodes.py +3 -3
- nuitka/code_generation/GlobalConstants.py +0 -2
- nuitka/code_generation/ImportCodes.py +2 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/ListCodes.py +11 -17
- nuitka/code_generation/MatchCodes.py +0 -1
- nuitka/code_generation/ModuleCodes.py +2 -1
- nuitka/code_generation/Namify.py +0 -1
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +8 -6
- nuitka/code_generation/PackageResourceCodes.py +7 -5
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TypeAliasCodes.py +71 -0
- nuitka/code_generation/VariableCodes.py +7 -5
- nuitka/code_generation/VariableDeclarations.py +1 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
- nuitka/code_generation/c_types/CTypeVoids.py +1 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +14 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
- nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +4 -1
- nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
- nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
- nuitka/containers/Namedtuples.py +0 -1
- nuitka/finalizations/Finalization.py +1 -0
- nuitka/finalizations/FinalizeMarkups.py +0 -1
- nuitka/freezer/DllDependenciesMacOS.py +60 -13
- nuitka/freezer/DllDependenciesPosix.py +0 -1
- nuitka/freezer/IncludedDataFiles.py +46 -15
- nuitka/freezer/IncludedEntryPoints.py +5 -3
- nuitka/freezer/Standalone.py +6 -1
- nuitka/importing/ImportCache.py +2 -2
- nuitka/importing/ImportResolving.py +80 -78
- nuitka/importing/Importing.py +34 -1
- nuitka/nodes/AttributeNodesGenerated.py +21 -6
- nuitka/nodes/BuiltinComplexNodes.py +1 -0
- nuitka/nodes/BuiltinFormatNodes.py +1 -0
- nuitka/nodes/BuiltinIteratorNodes.py +5 -3
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
- nuitka/nodes/BuiltinRefNodes.py +8 -1
- nuitka/nodes/BuiltinVarsNodes.py +0 -1
- nuitka/nodes/ChildrenHavingMixins.py +906 -186
- nuitka/nodes/CodeObjectSpecs.py +1 -1
- nuitka/nodes/ConstantRefNodes.py +38 -0
- nuitka/nodes/CtypesNodes.py +0 -1
- nuitka/nodes/DictionaryNodes.py +0 -1
- nuitka/nodes/ExceptionNodes.py +10 -0
- nuitka/nodes/ExpressionBases.py +15 -9
- nuitka/nodes/ExpressionBasesGenerated.py +32 -15
- nuitka/nodes/FunctionNodes.py +50 -5
- nuitka/nodes/HardImportNodesGenerated.py +245 -60
- nuitka/nodes/ImportHardNodes.py +27 -13
- nuitka/nodes/ImportNodes.py +90 -70
- nuitka/nodes/InjectCNodes.py +0 -1
- nuitka/nodes/ModuleNodes.py +10 -5
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/OperatorNodesUnary.py +1 -0
- nuitka/nodes/OsSysNodes.py +0 -1
- nuitka/nodes/PackageMetadataNodes.py +0 -1
- nuitka/nodes/PackageResourceNodes.py +10 -6
- nuitka/nodes/StatementBasesGenerated.py +107 -60
- nuitka/nodes/StringConcatenationNodes.py +1 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TypeNodes.py +21 -0
- nuitka/nodes/VariableRefNodes.py +1 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
- nuitka/optimizations/Optimization.py +7 -6
- nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
- nuitka/optimizations/Tags.py +0 -1
- nuitka/optimizations/TraceCollections.py +6 -55
- nuitka/optimizations/ValueTraces.py +49 -1
- nuitka/plugins/PluginBase.py +26 -4
- nuitka/plugins/Plugins.py +49 -12
- nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
- nuitka/plugins/standard/DataFilesPlugin.py +2 -6
- nuitka/plugins/standard/DillPlugin.py +3 -3
- nuitka/plugins/standard/DllFilesPlugin.py +29 -23
- nuitka/plugins/standard/GiPlugin.py +1 -0
- nuitka/plugins/standard/ImplicitImports.py +8 -7
- nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
- nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
- nuitka/plugins/standard/PmwPlugin.py +10 -9
- nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
- nuitka/plugins/standard/TensorflowPlugin.py +1 -0
- nuitka/plugins/standard/TorchPlugin.py +1 -0
- nuitka/plugins/standard/TrioPlugin.py +1 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +242 -34
- nuitka/reports/CompilationReportReader.py +0 -1
- nuitka/reports/Reports.py +49 -5
- nuitka/specs/BuiltinParameterSpecs.py +10 -2
- nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
- nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
- nuitka/specs/HardImportSpecs.py +34 -1
- nuitka/specs/ParameterSpecs.py +11 -9
- nuitka/tools/environments/Virtualenv.py +0 -1
- nuitka/tools/specialize/CTypeDescriptions.py +15 -11
- nuitka/tools/specialize/SpecializeC.py +11 -9
- nuitka/tools/specialize/SpecializePython.py +57 -30
- nuitka/tools/testing/Common.py +24 -7
- nuitka/tools/testing/OutputComparison.py +4 -0
- nuitka/tools/testing/Pythons.py +0 -1
- nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
- nuitka/tools/watch/GitHub.py +4 -1
- nuitka/tools/watch/__main__.py +22 -1
- nuitka/tree/Building.py +3 -0
- nuitka/tree/InternalModule.py +0 -1
- nuitka/tree/ReformulationAssertStatements.py +1 -0
- nuitka/tree/ReformulationAssignmentStatements.py +26 -3
- nuitka/tree/ReformulationClasses3.py +23 -26
- nuitka/tree/ReformulationContractionExpressions.py +5 -3
- nuitka/tree/ReformulationDictionaryCreation.py +6 -5
- nuitka/tree/ReformulationExecStatements.py +8 -6
- nuitka/tree/ReformulationFunctionStatements.py +10 -6
- nuitka/tree/SourceHandling.py +8 -0
- nuitka/tree/TreeHelpers.py +6 -3
- nuitka/utils/AppDirs.py +6 -2
- nuitka/utils/CStrings.py +1 -1
- nuitka/utils/CommandLineOptions.py +0 -1
- nuitka/utils/Distributions.py +3 -3
- nuitka/utils/Download.py +5 -1
- nuitka/utils/Execution.py +6 -3
- nuitka/utils/FileOperations.py +61 -34
- nuitka/utils/Importing.py +4 -4
- nuitka/utils/InstanceCounters.py +1 -0
- nuitka/utils/MacOSApp.py +1 -0
- nuitka/utils/Shebang.py +1 -0
- nuitka/utils/Utils.py +39 -1
- nuitka/utils/WindowsFileUsage.py +4 -3
- {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/WHEEL +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/top_level.txt +0 -0
nuitka/build/SconsCaching.py
CHANGED
|
@@ -30,6 +30,7 @@ from .SconsProgress import updateSconsProgressBar
|
|
|
30
30
|
from .SconsUtils import (
|
|
31
31
|
getExecutablePath,
|
|
32
32
|
getSconsReportValue,
|
|
33
|
+
isZigName,
|
|
33
34
|
setEnvironmentVariable,
|
|
34
35
|
)
|
|
35
36
|
|
|
@@ -100,21 +101,17 @@ def _injectCcache(env, cc_path, python_prefix, assume_yes_for_downloads):
|
|
|
100
101
|
|
|
101
102
|
else:
|
|
102
103
|
scons_details_logger.info(
|
|
103
|
-
"Using ccache '%s' from NUITKA_CCACHE_BINARY environment variable."
|
|
104
|
+
"Using ccache '%s' from 'NUITKA_CCACHE_BINARY' environment variable."
|
|
104
105
|
% ccache_binary
|
|
105
106
|
)
|
|
106
107
|
|
|
107
108
|
if ccache_binary is not None and os.path.exists(ccache_binary):
|
|
108
|
-
# Make sure the
|
|
109
109
|
# In case we are on Windows, make sure the Anaconda form runs outside of Anaconda
|
|
110
110
|
# environment, by adding DLL folder to PATH.
|
|
111
111
|
assert areSamePaths(
|
|
112
112
|
getExecutablePath(os.path.basename(env.the_compiler), env=env), cc_path
|
|
113
113
|
)
|
|
114
114
|
|
|
115
|
-
# We use absolute paths for CC, pass it like this, as ccache does not like absolute.
|
|
116
|
-
env["CXX"] = env["CC"] = '"%s" "%s"' % (ccache_binary, cc_path)
|
|
117
|
-
|
|
118
115
|
# Spare ccache the detection of the compiler, seems it will also misbehave when it's
|
|
119
116
|
# prefixed with "ccache" on old gcc versions in terms of detecting need for C++ linkage.
|
|
120
117
|
env["LINK"] = '"%s"' % cc_path
|
|
@@ -126,58 +123,79 @@ def _injectCcache(env, cc_path, python_prefix, assume_yes_for_downloads):
|
|
|
126
123
|
"Providing real CC path '%s' via PATH extension." % cc_path
|
|
127
124
|
)
|
|
128
125
|
|
|
126
|
+
values = [ccache_binary, cc_path]
|
|
127
|
+
|
|
128
|
+
if isZigName(env.the_cc_name):
|
|
129
|
+
values.append("c++" if env.c11_mode else "cc")
|
|
130
|
+
|
|
131
|
+
# We use absolute paths for CC, pass it like this, as ccache does not like absolute.
|
|
132
|
+
env["CXX"] = env["CC"] = " ".join('"%s"' % value for value in values)
|
|
133
|
+
|
|
134
|
+
return True
|
|
135
|
+
|
|
136
|
+
return False
|
|
137
|
+
|
|
129
138
|
|
|
130
139
|
def enableCcache(
|
|
131
|
-
env,
|
|
132
|
-
source_dir,
|
|
133
|
-
python_prefix,
|
|
134
|
-
assume_yes_for_downloads,
|
|
140
|
+
env, source_dir, python_prefix, assume_yes_for_downloads, disable_ccache
|
|
135
141
|
):
|
|
136
|
-
|
|
137
|
-
ccache_logfile = os.path.abspath(
|
|
138
|
-
os.path.join(source_dir, "ccache-%d.txt" % os.getpid())
|
|
139
|
-
)
|
|
142
|
+
inject_ccache = not disable_ccache
|
|
140
143
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
if "CCACHE_DIR" not in os.environ:
|
|
146
|
-
ccache_dir = getCacheDir("ccache")
|
|
147
|
-
makePath(ccache_dir)
|
|
148
|
-
ccache_dir = getExternalUsePath(ccache_dir)
|
|
149
|
-
setEnvironmentVariable(env, "CCACHE_DIR", ccache_dir)
|
|
150
|
-
env["CCACHE_DIR"] = ccache_dir
|
|
151
|
-
|
|
152
|
-
if "CLCACHE_MEMCACHED" in os.environ:
|
|
153
|
-
scons_logger.warning(
|
|
154
|
-
"The setting of 'CLCACHE_MEMCACHED' environment is not supported with clcache."
|
|
144
|
+
if inject_ccache:
|
|
145
|
+
# The ccache needs absolute path, otherwise it will not work.
|
|
146
|
+
ccache_logfile = os.path.abspath(
|
|
147
|
+
os.path.join(source_dir, "ccache-%d.txt" % os.getpid())
|
|
155
148
|
)
|
|
156
|
-
setEnvironmentVariable(env, "CLCACHE_MEMCACHED", None)
|
|
157
149
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
env, "CCACHE_SLOPPINESS", "include_file_ctime,include_file_mtime"
|
|
161
|
-
)
|
|
150
|
+
setEnvironmentVariable(env, "CCACHE_LOGFILE", ccache_logfile)
|
|
151
|
+
env["CCACHE_LOGFILE"] = ccache_logfile
|
|
162
152
|
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
# Unless asked to do otherwise, store ccache files in our own directory.
|
|
154
|
+
if "CCACHE_DIR" not in os.environ:
|
|
155
|
+
ccache_dir = getCacheDir("ccache")
|
|
156
|
+
makePath(ccache_dir)
|
|
157
|
+
ccache_dir = getExternalUsePath(ccache_dir)
|
|
158
|
+
setEnvironmentVariable(env, "CCACHE_DIR", ccache_dir)
|
|
159
|
+
env["CCACHE_DIR"] = ccache_dir
|
|
165
160
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
if "CLCACHE_MEMCACHED" in os.environ:
|
|
162
|
+
scons_logger.warning(
|
|
163
|
+
"The setting of 'CLCACHE_MEMCACHED' environment is not supported with clcache."
|
|
164
|
+
)
|
|
165
|
+
setEnvironmentVariable(env, "CLCACHE_MEMCACHED", None)
|
|
166
|
+
|
|
167
|
+
# We know the include files we created are safe to use.
|
|
168
|
+
setEnvironmentVariable(
|
|
169
|
+
env, "CCACHE_SLOPPINESS", "include_file_ctime,include_file_mtime"
|
|
171
170
|
)
|
|
172
171
|
|
|
173
|
-
|
|
172
|
+
# First check if it's not already supposed to be a ccache, then do nothing.
|
|
173
|
+
cc_path = getExecutablePath(env.the_compiler, env=env)
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
cc_is_link, cc_link_path = getLinkTarget(cc_path)
|
|
176
|
+
if cc_is_link and os.path.basename(cc_link_path) == "ccache":
|
|
177
|
+
scons_details_logger.info(
|
|
178
|
+
"Chosen compiler %s is pointing to ccache %s already."
|
|
179
|
+
% (cc_path, cc_link_path)
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
inject_ccache = False
|
|
183
|
+
|
|
184
|
+
if inject_ccache:
|
|
185
|
+
inject_ccache = _injectCcache(
|
|
186
|
+
env=env,
|
|
187
|
+
cc_path=cc_path,
|
|
188
|
+
python_prefix=python_prefix,
|
|
189
|
+
assume_yes_for_downloads=assume_yes_for_downloads,
|
|
190
|
+
)
|
|
191
|
+
|
|
192
|
+
# If we failed to inject zig argument into ccache command line, we need to
|
|
193
|
+
# do it now.
|
|
194
|
+
if isZigName(env.the_cc_name) and inject_ccache is False:
|
|
195
|
+
env["CXX"] = env["CC"] = '"%s" "%s"' % (
|
|
196
|
+
cc_path,
|
|
197
|
+
"cc" if env.c11_mode else "c++",
|
|
198
|
+
)
|
|
181
199
|
|
|
182
200
|
|
|
183
201
|
def enableClcache(env, source_dir):
|
|
@@ -34,6 +34,7 @@ from .SconsUtils import (
|
|
|
34
34
|
getMsvcVersionString,
|
|
35
35
|
isClangName,
|
|
36
36
|
isGccName,
|
|
37
|
+
isZigName,
|
|
37
38
|
raiseNoCompilerFoundErrorExit,
|
|
38
39
|
setEnvironmentVariable,
|
|
39
40
|
)
|
|
@@ -99,6 +100,10 @@ def _enableC11Settings(env):
|
|
|
99
100
|
c11_mode = True
|
|
100
101
|
elif env.clang_mode:
|
|
101
102
|
c11_mode = True
|
|
103
|
+
|
|
104
|
+
# For now, zig doesn't support C11 mode in the form needed by Nuitka
|
|
105
|
+
if isZigName(env.the_cc_name):
|
|
106
|
+
c11_mode = False
|
|
102
107
|
elif env.gcc_mode and env.gcc_version >= (5,):
|
|
103
108
|
c11_mode = True
|
|
104
109
|
else:
|
|
@@ -721,9 +726,13 @@ def setupCCompiler(env, lto_mode, pgo_mode, job_count, onefile_compile):
|
|
|
721
726
|
# thing, and Nuitka-Python is not affected.
|
|
722
727
|
env.Append(
|
|
723
728
|
LINKFLAGS=[
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
729
|
+
(
|
|
730
|
+
"-O3"
|
|
731
|
+
if env.nuitka_python
|
|
732
|
+
or os.name == "nt"
|
|
733
|
+
or not env.static_libpython
|
|
734
|
+
else "-O2"
|
|
735
|
+
)
|
|
727
736
|
]
|
|
728
737
|
)
|
|
729
738
|
|
|
@@ -740,9 +749,13 @@ def setupCCompiler(env, lto_mode, pgo_mode, job_count, onefile_compile):
|
|
|
740
749
|
if env.gcc_mode:
|
|
741
750
|
env.Append(
|
|
742
751
|
CCFLAGS=[
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
752
|
+
(
|
|
753
|
+
"-O3"
|
|
754
|
+
if env.nuitka_python
|
|
755
|
+
or os.name == "nt"
|
|
756
|
+
or not env.static_libpython
|
|
757
|
+
else "-O2"
|
|
758
|
+
)
|
|
746
759
|
]
|
|
747
760
|
)
|
|
748
761
|
elif env.msvc_mode:
|
nuitka/build/SconsHacks.py
CHANGED
nuitka/build/SconsInterface.py
CHANGED
|
@@ -30,17 +30,22 @@ from nuitka.PythonVersions import (
|
|
|
30
30
|
python_version,
|
|
31
31
|
python_version_str,
|
|
32
32
|
)
|
|
33
|
+
from nuitka.utils.AppDirs import getCacheDirEnvironmentVariableName
|
|
34
|
+
from nuitka.utils.Download import getDownloadCacheDir, getDownloadCacheName
|
|
33
35
|
from nuitka.utils.Execution import (
|
|
34
36
|
getExecutablePath,
|
|
35
37
|
withEnvironmentVarsOverridden,
|
|
36
38
|
)
|
|
37
39
|
from nuitka.utils.FileOperations import (
|
|
40
|
+
changeFilenameExtension,
|
|
38
41
|
deleteFile,
|
|
39
42
|
getDirectoryRealPath,
|
|
40
43
|
getExternalUsePath,
|
|
41
44
|
getWindowsShortPathName,
|
|
42
45
|
hasFilenameExtension,
|
|
43
46
|
listDir,
|
|
47
|
+
makePath,
|
|
48
|
+
putTextFileContents,
|
|
44
49
|
withDirectoryChange,
|
|
45
50
|
)
|
|
46
51
|
from nuitka.utils.InstalledPythons import findInstalledPython
|
|
@@ -105,7 +110,16 @@ def _getPythonForSconsExePath():
|
|
|
105
110
|
if python_exe is not None:
|
|
106
111
|
return python_exe
|
|
107
112
|
|
|
108
|
-
scons_supported_pythons = (
|
|
113
|
+
scons_supported_pythons = (
|
|
114
|
+
"3.5",
|
|
115
|
+
"3.6",
|
|
116
|
+
"3.7",
|
|
117
|
+
"3.8",
|
|
118
|
+
"3.9",
|
|
119
|
+
"3.10",
|
|
120
|
+
"3.11",
|
|
121
|
+
"3.12",
|
|
122
|
+
)
|
|
109
123
|
if not isWin32Windows():
|
|
110
124
|
scons_supported_pythons += ("2.7", "2.6")
|
|
111
125
|
|
|
@@ -159,6 +173,14 @@ def _setupSconsEnvironment2():
|
|
|
159
173
|
|
|
160
174
|
os.environ["NUITKA_PACKAGE_DIR"] = os.path.abspath(nuitka.__path__[0])
|
|
161
175
|
|
|
176
|
+
# When downloading in Scons, use the external path.
|
|
177
|
+
if isWin32Windows():
|
|
178
|
+
download_cache_dir = getDownloadCacheDir()
|
|
179
|
+
makePath(download_cache_dir)
|
|
180
|
+
os.environ[getCacheDirEnvironmentVariableName(getDownloadCacheName())] = (
|
|
181
|
+
getExternalUsePath(download_cache_dir)
|
|
182
|
+
)
|
|
183
|
+
|
|
162
184
|
yield
|
|
163
185
|
|
|
164
186
|
if old_pythonpath is not None:
|
|
@@ -247,6 +269,61 @@ def _buildSconsCommand(options, scons_filename):
|
|
|
247
269
|
return scons_command
|
|
248
270
|
|
|
249
271
|
|
|
272
|
+
def _createSconsDebugScript(source_dir, scons_command):
|
|
273
|
+
# we wrote debug shell script only if build process called, not "--version" call.
|
|
274
|
+
scons_debug_python_name = "scons-debug.py"
|
|
275
|
+
|
|
276
|
+
putTextFileContents(
|
|
277
|
+
filename=os.path.join(source_dir, scons_debug_python_name),
|
|
278
|
+
contents="""\
|
|
279
|
+
# -*- coding: utf-8 -*-
|
|
280
|
+
|
|
281
|
+
import sys
|
|
282
|
+
import os
|
|
283
|
+
import subprocess
|
|
284
|
+
|
|
285
|
+
exit_code = subprocess.call(
|
|
286
|
+
%(scons_command)r,
|
|
287
|
+
env=%(env)r,
|
|
288
|
+
shell=False
|
|
289
|
+
)"""
|
|
290
|
+
% {"scons_command": scons_command, "env": dict(os.environ)},
|
|
291
|
+
encoding="utf8",
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
if isWin32Windows():
|
|
295
|
+
script_extension = ".bat"
|
|
296
|
+
|
|
297
|
+
script_prelude = """\
|
|
298
|
+
cd "%~dp0"
|
|
299
|
+
"""
|
|
300
|
+
else:
|
|
301
|
+
script_extension = ".sh"
|
|
302
|
+
|
|
303
|
+
script_prelude = """\
|
|
304
|
+
#!/bin/bash
|
|
305
|
+
cd "${0%/*}"
|
|
306
|
+
"""
|
|
307
|
+
|
|
308
|
+
putTextFileContents(
|
|
309
|
+
filename=os.path.join(
|
|
310
|
+
source_dir,
|
|
311
|
+
changeFilenameExtension(scons_debug_python_name, script_extension),
|
|
312
|
+
),
|
|
313
|
+
contents="""\
|
|
314
|
+
%(script_prelude)s
|
|
315
|
+
|
|
316
|
+
'%(scons_python)s' '%(scons_debug_script_name)s'
|
|
317
|
+
"""
|
|
318
|
+
% {
|
|
319
|
+
"script_prelude": script_prelude,
|
|
320
|
+
"scons_python": scons_command[0],
|
|
321
|
+
"scons_debug_script_name": scons_debug_python_name,
|
|
322
|
+
},
|
|
323
|
+
encoding="utf8",
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
|
|
250
327
|
def runScons(options, env_values, scons_filename):
|
|
251
328
|
with _setupSconsEnvironment():
|
|
252
329
|
env_values["_NUITKA_BUILD_DEFINITIONS_CATALOG"] = ",".join(env_values.keys())
|
|
@@ -287,6 +364,12 @@ def runScons(options, env_values, scons_filename):
|
|
|
287
364
|
Tracing.flushStandardOutputs()
|
|
288
365
|
|
|
289
366
|
with withEnvironmentVarsOverridden(env_values):
|
|
367
|
+
# Create debug script to quickly re-run this step only.
|
|
368
|
+
if source_dir is not None:
|
|
369
|
+
_createSconsDebugScript(
|
|
370
|
+
source_dir=source_dir, scons_command=scons_command
|
|
371
|
+
)
|
|
372
|
+
|
|
290
373
|
try:
|
|
291
374
|
result = subprocess.call(scons_command, shell=False, cwd=source_dir)
|
|
292
375
|
except KeyboardInterrupt:
|
|
@@ -464,12 +547,8 @@ def setCommonSconsOptions(options):
|
|
|
464
547
|
|
|
465
548
|
if product_version is None:
|
|
466
549
|
product_version = file_version
|
|
467
|
-
if product_version is not None:
|
|
468
|
-
product_version = ".".join(str(d) for d in product_version)
|
|
469
550
|
if file_version is None:
|
|
470
551
|
file_version = product_version
|
|
471
|
-
else:
|
|
472
|
-
file_version = ".".join(str(d) for d in file_version)
|
|
473
552
|
|
|
474
553
|
if product_version != file_version:
|
|
475
554
|
effective_version = "%s-%s" % (
|
nuitka/build/SconsProgress.py
CHANGED
nuitka/build/SconsUtils.py
CHANGED
|
@@ -205,9 +205,9 @@ def createEnvironment(
|
|
|
205
205
|
import SCons.Tool.msvc # pylint: disable=I0021,import-error
|
|
206
206
|
|
|
207
207
|
SCons.Tool.MSCommon.vc.msvc_setup_env = lambda *args: None
|
|
208
|
-
SCons.Tool.msvc.msvc_exists = (
|
|
209
|
-
|
|
210
|
-
)
|
|
208
|
+
SCons.Tool.msvc.msvc_exists = SCons.Tool.MSCommon.vc.msvc_exists = (
|
|
209
|
+
lambda *args: False
|
|
210
|
+
)
|
|
211
211
|
else:
|
|
212
212
|
# Everything else should use default, that is MSVC tools, but not MinGW64.
|
|
213
213
|
tools = ["default"]
|
|
@@ -537,7 +537,11 @@ def isGccName(cc_name):
|
|
|
537
537
|
|
|
538
538
|
|
|
539
539
|
def isClangName(cc_name):
|
|
540
|
-
return "clang" in cc_name and "-cl" not in cc_name
|
|
540
|
+
return ("clang" in cc_name and "-cl" not in cc_name) or isZigName(cc_name)
|
|
541
|
+
|
|
542
|
+
|
|
543
|
+
def isZigName(cc_name):
|
|
544
|
+
return "zig" in cc_name
|
|
541
545
|
|
|
542
546
|
|
|
543
547
|
def cheapCopyFile(src, dst):
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
#define _PyObject_GC_IS_TRACKED(obj) (1)
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
|
-
#if PYTHON_VERSION >= 0x380
|
|
16
|
+
#if PYTHON_VERSION >= 0x380 && PYTHON_VERSION < 0x3c0
|
|
17
17
|
// Need to make Py_DECREF a macro again that doesn't call an API
|
|
18
18
|
static inline void _Nuitka_Py_DECREF(PyObject *ob) {
|
|
19
19
|
assert(ob != NULL && ob->ob_refcnt >= 0);
|
|
@@ -80,11 +80,16 @@ static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) { ob->ob_type
|
|
|
80
80
|
// After Python 3.9 this was moved into the DLL potentially, making
|
|
81
81
|
// it expensive to call.
|
|
82
82
|
#if PYTHON_VERSION >= 0x390
|
|
83
|
-
static void
|
|
83
|
+
static inline void Nuitka_Py_NewReferenceNoTotal(PyObject *op) { Py_SET_REFCNT(op, 1); }
|
|
84
|
+
static inline void Nuitka_Py_NewReference(PyObject *op) {
|
|
84
85
|
#ifdef Py_REF_DEBUG
|
|
86
|
+
#if PYTHON_VERSION < 0x3c0
|
|
85
87
|
_Py_RefTotal++;
|
|
88
|
+
#else
|
|
89
|
+
_PyInterpreterState_GET()->object_state.reftotal++;
|
|
90
|
+
#endif
|
|
86
91
|
#endif
|
|
87
|
-
|
|
92
|
+
op->ob_refcnt = 1;
|
|
88
93
|
}
|
|
89
94
|
#else
|
|
90
95
|
#define Nuitka_Py_NewReference(op) _Py_NewReference(op)
|
|
@@ -38,6 +38,14 @@ extern int count_allocated_Nuitka_Cell_Type;
|
|
|
38
38
|
extern int count_released_Nuitka_Cell_Type;
|
|
39
39
|
#endif
|
|
40
40
|
|
|
41
|
+
NUITKA_MAY_BE_UNUSED static inline void Nuitka_Cell_SET(struct Nuitka_CellObject *cell_object, PyObject *value) {
|
|
42
|
+
CHECK_OBJECT_X(value);
|
|
43
|
+
CHECK_OBJECT(cell_object);
|
|
44
|
+
|
|
45
|
+
assert(Nuitka_Cell_Check((PyObject *)cell_object));
|
|
46
|
+
cell_object->ob_ref = value;
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
#endif
|
|
42
50
|
|
|
43
51
|
// Part of "Nuitka", an optimizing Python compiler that is compatible and
|