Nuitka-winsvc 2.3.9__cp311-cp311-win_amd64.whl → 2.4.1__cp311-cp311-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- Nuitka_winsvc-2.3.9.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +213 -210
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
- nuitka/CacheCleanup.py +6 -1
- nuitka/HardImportRegistry.py +29 -2
- nuitka/MainControl.py +62 -35
- nuitka/ModuleRegistry.py +11 -3
- nuitka/OptionParsing.py +78 -39
- nuitka/Options.py +142 -35
- nuitka/OutputDirectories.py +5 -0
- nuitka/PostProcessing.py +23 -14
- nuitka/PythonFlavors.py +22 -4
- nuitka/PythonVersions.py +18 -0
- nuitka/Tracing.py +26 -23
- nuitka/TreeXML.py +6 -3
- nuitka/Version.py +1 -1
- nuitka/__main__.py +55 -10
- nuitka/build/Backend.scons +6 -1
- nuitka/build/CCompilerVersion.scons +1 -0
- nuitka/build/Onefile.scons +4 -0
- nuitka/build/SconsCaching.py +1 -0
- nuitka/build/SconsCompilerSettings.py +1 -0
- nuitka/build/SconsHacks.py +5 -1
- nuitka/build/SconsInterface.py +2 -0
- nuitka/build/SconsUtils.py +5 -2
- nuitka/build/include/nuitka/allocator.h +27 -5
- nuitka/build/include/nuitka/calling.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +23 -23
- nuitka/build/include/nuitka/compiled_method.h +1 -1
- nuitka/build/include/nuitka/exception_groups.h +0 -2
- nuitka/build/include/nuitka/helper/attributes.h +7 -1
- nuitka/build/include/nuitka/helper/subscripts.h +1 -1
- nuitka/build/include/nuitka/helpers.h +7 -4
- nuitka/build/include/nuitka/prelude.h +6 -10
- nuitka/build/include/nuitka/printing.h +2 -0
- nuitka/build/include/nuitka/unfreezing.h +5 -5
- nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
- nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
- nuitka/build/static_src/CompiledCellType.c +7 -7
- nuitka/build/static_src/CompiledCodeHelpers.c +51 -36
- nuitka/build/static_src/CompiledCoroutineType.c +2 -4
- nuitka/build/static_src/CompiledFrameType.c +109 -82
- nuitka/build/static_src/CompiledFunctionType.c +36 -9
- nuitka/build/static_src/CompiledGeneratorType.c +12 -10
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
- nuitka/build/static_src/CompiledMethodType.c +14 -13
- nuitka/build/static_src/HelpersAttributes.c +13 -15
- nuitka/build/static_src/HelpersBuiltin.c +18 -9
- nuitka/build/static_src/HelpersCalling.c +13 -13
- nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
- nuitka/build/static_src/HelpersComparisonEq.c +110 -110
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
- nuitka/build/static_src/HelpersComparisonGe.c +110 -110
- nuitka/build/static_src/HelpersComparisonGt.c +110 -110
- nuitka/build/static_src/HelpersComparisonLe.c +110 -110
- nuitka/build/static_src/HelpersComparisonLt.c +110 -110
- nuitka/build/static_src/HelpersComparisonNe.c +110 -110
- nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
- nuitka/build/static_src/HelpersDictionaries.c +9 -0
- nuitka/build/static_src/HelpersFiles.c +2 -2
- nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
- nuitka/build/static_src/HelpersHeapStorage.c +4 -0
- nuitka/build/static_src/HelpersImport.c +1 -1
- nuitka/build/static_src/HelpersLists.c +5 -1
- nuitka/build/static_src/HelpersMatching.c +95 -35
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
- nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
- nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
- nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
- nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
- nuitka/build/static_src/HelpersSequences.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +8 -4
- nuitka/build/static_src/MainProgram.c +28 -9
- nuitka/build/static_src/MetaPathBasedLoader.c +126 -110
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +30 -1
- nuitka/build/static_src/OnefileBootstrap.c +34 -6
- nuitka/code_generation/AttributeCodes.py +12 -10
- nuitka/code_generation/CodeGeneration.py +6 -7
- nuitka/code_generation/ConstantCodes.py +53 -10
- nuitka/code_generation/GlobalConstants.py +6 -6
- nuitka/code_generation/Indentation.py +3 -4
- nuitka/code_generation/LoaderCodes.py +3 -0
- nuitka/code_generation/LocalsDictCodes.py +36 -14
- nuitka/code_generation/MatchCodes.py +23 -4
- nuitka/code_generation/ModuleCodes.py +0 -7
- nuitka/code_generation/Namify.py +2 -0
- nuitka/code_generation/PackageResourceCodes.py +5 -1
- nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
- nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
- nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
- nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
- nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
- nuitka/freezer/DependsExe.py +3 -1
- nuitka/freezer/DllDependenciesMacOS.py +28 -14
- nuitka/freezer/IncludedDataFiles.py +12 -3
- nuitka/freezer/IncludedEntryPoints.py +8 -2
- nuitka/freezer/Onefile.py +6 -1
- nuitka/freezer/Standalone.py +9 -2
- nuitka/importing/Importing.py +14 -5
- nuitka/importing/Recursion.py +3 -0
- nuitka/nodes/AttributeNodesGenerated.py +21 -12
- nuitka/nodes/BuiltinOpenNodes.py +5 -0
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
- nuitka/nodes/BuiltinRefNodes.py +41 -1
- nuitka/nodes/ChildrenHavingMixins.py +143 -355
- nuitka/nodes/ClassNodes.py +30 -12
- nuitka/nodes/CodeObjectSpecs.py +9 -0
- nuitka/nodes/ExpressionBasesGenerated.py +11 -11
- nuitka/nodes/FunctionNodes.py +11 -12
- nuitka/nodes/FutureSpecs.py +16 -3
- nuitka/nodes/GeneratorNodes.py +2 -2
- nuitka/nodes/HardImportNodesGenerated.py +11 -134
- nuitka/nodes/LocalsScopes.py +19 -23
- nuitka/nodes/MatchNodes.py +18 -7
- nuitka/nodes/ModuleAttributeNodes.py +1 -20
- nuitka/nodes/ModuleNodes.py +23 -6
- nuitka/nodes/NodeBases.py +13 -11
- nuitka/nodes/NodeMetaClasses.py +26 -10
- nuitka/nodes/ReturnNodes.py +1 -1
- nuitka/nodes/StatementBasesGenerated.py +11 -11
- nuitka/nodes/SubscriptNodes.py +4 -4
- nuitka/nodes/VariableAssignNodes.py +1 -1
- nuitka/nodes/VariableRefNodes.py +28 -2
- nuitka/nodes/shapes/BuiltinTypeShapes.py +21 -1
- nuitka/optimizations/FunctionInlining.py +3 -6
- nuitka/optimizations/Optimization.py +13 -12
- nuitka/optimizations/TraceCollections.py +19 -4
- nuitka/plugins/PluginBase.py +121 -133
- nuitka/plugins/Plugins.py +91 -3
- nuitka/plugins/YamlPluginBase.py +121 -0
- nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
- nuitka/plugins/standard/DataFilesPlugin.py +15 -6
- nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
- nuitka/plugins/standard/DllFilesPlugin.py +5 -3
- nuitka/plugins/standard/ImplicitImports.py +34 -20
- nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
- nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
- nuitka/plugins/standard/SpacyPlugin.py +136 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +491 -186
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +17 -0
- nuitka/reports/Reports.py +53 -5
- nuitka/specs/BuiltinParameterSpecs.py +1 -1
- nuitka/specs/HardImportSpecs.py +0 -6
- nuitka/tools/data_composer/DataComposer.py +29 -27
- nuitka/tools/environments/CreateEnvironment.py +1 -0
- nuitka/tools/environments/Virtualenv.py +25 -11
- nuitka/tools/general/find_module/FindModuleCode.py +13 -3
- nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
- nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
- nuitka/tools/specialize/CTypeDescriptions.py +13 -7
- nuitka/tools/specialize/SpecializePython.py +18 -1
- nuitka/tools/testing/Common.py +19 -6
- nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
- nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
- nuitka/tools/watch/AutoStage.py +144 -0
- nuitka/tools/watch/__main__.py +79 -32
- nuitka/tree/Building.py +105 -104
- nuitka/tree/ComplexCallHelperFunctions.py +16 -26
- nuitka/tree/InternalModule.py +9 -1
- nuitka/tree/ReformulationAssignmentStatements.py +29 -59
- nuitka/tree/ReformulationClasses.py +10 -17
- nuitka/tree/ReformulationClasses3.py +69 -43
- nuitka/tree/ReformulationComparisonExpressions.py +6 -16
- nuitka/tree/ReformulationContractionExpressions.py +14 -23
- nuitka/tree/ReformulationDictionaryCreation.py +6 -10
- nuitka/tree/ReformulationExecStatements.py +10 -10
- nuitka/tree/ReformulationForLoopStatements.py +6 -12
- nuitka/tree/ReformulationFunctionStatements.py +22 -28
- nuitka/tree/ReformulationImportStatements.py +8 -10
- nuitka/tree/ReformulationLambdaExpressions.py +3 -6
- nuitka/tree/ReformulationMatchStatements.py +166 -60
- nuitka/tree/ReformulationMultidist.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +1 -1
- nuitka/tree/ReformulationPrintStatements.py +3 -6
- nuitka/tree/ReformulationSequenceCreation.py +13 -26
- nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
- nuitka/tree/ReformulationWithStatements.py +12 -16
- nuitka/tree/SourceHandling.py +13 -8
- nuitka/tree/VariableClosure.py +5 -21
- nuitka/utils/Distributions.py +80 -11
- nuitka/utils/Download.py +38 -31
- nuitka/utils/Execution.py +21 -9
- nuitka/utils/FileOperations.py +55 -28
- nuitka/utils/Images.py +6 -1
- nuitka/utils/Importing.py +1 -1
- nuitka/utils/ModuleNames.py +11 -5
- nuitka/utils/ReExecute.py +17 -13
- nuitka/utils/SharedLibraries.py +69 -41
- nuitka/utils/Signing.py +3 -1
- nuitka/utils/StaticLibraries.py +51 -41
- nuitka/utils/Timing.py +1 -1
- nuitka/utils/Utils.py +29 -7
- /Nuitka_winsvc-2.3.9.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.3.9.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
nuitka/utils/ReExecute.py
CHANGED
|
@@ -12,8 +12,6 @@ spell-checker: ignore execl, Popen
|
|
|
12
12
|
import os
|
|
13
13
|
import sys
|
|
14
14
|
|
|
15
|
-
from nuitka.Options import shallExecuteImmediately
|
|
16
|
-
|
|
17
15
|
|
|
18
16
|
def callExecProcess(args, uac):
|
|
19
17
|
"""Do exec in a portable way preserving exit code.
|
|
@@ -57,6 +55,10 @@ def callExecProcess(args, uac):
|
|
|
57
55
|
os.execl(*args)
|
|
58
56
|
|
|
59
57
|
|
|
58
|
+
def setLaunchingNuitkaProcessEnvironmentValue(environment_variable_name, value):
|
|
59
|
+
os.environ[environment_variable_name] = str(os.getpid()) + ":" + value
|
|
60
|
+
|
|
61
|
+
|
|
60
62
|
def reExecuteNuitka(pgo_filename):
|
|
61
63
|
# Execute with full path as the process name, so it can find itself and its
|
|
62
64
|
# libraries.
|
|
@@ -75,18 +77,18 @@ def reExecuteNuitka(pgo_filename):
|
|
|
75
77
|
|
|
76
78
|
args += ["-S", our_filename]
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
setLaunchingNuitkaProcessEnvironmentValue(
|
|
81
|
+
"NUITKA_BINARY_NAME", sys.modules["__main__"].__file__
|
|
82
|
+
)
|
|
83
|
+
setLaunchingNuitkaProcessEnvironmentValue(
|
|
84
|
+
"NUITKA_PACKAGE_HOME",
|
|
85
|
+
os.path.dirname(os.path.abspath(sys.modules["nuitka"].__path__[0])),
|
|
81
86
|
)
|
|
82
87
|
|
|
83
88
|
if pgo_filename is not None:
|
|
84
89
|
args.append("--pgo-python-input=%s" % pgo_filename)
|
|
85
90
|
else:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if shallExecuteImmediately():
|
|
89
|
-
args.append("--run")
|
|
91
|
+
setLaunchingNuitkaProcessEnvironmentValue("NUITKA_SYS_PREFIX", sys.prefix)
|
|
90
92
|
|
|
91
93
|
# Same arguments as before.
|
|
92
94
|
args += sys.argv[1:]
|
|
@@ -103,7 +105,7 @@ def reExecuteNuitka(pgo_filename):
|
|
|
103
105
|
if site_filename.endswith(".pyc"):
|
|
104
106
|
site_filename = site_filename[:-4] + ".py"
|
|
105
107
|
|
|
106
|
-
|
|
108
|
+
setLaunchingNuitkaProcessEnvironmentValue("NUITKA_SITE_FILENAME", site_filename)
|
|
107
109
|
|
|
108
110
|
# Note: As side effect, this might modify the "sys.path" too.
|
|
109
111
|
os.environ["NUITKA_PTH_IMPORTED"] = repr(detectPthImportedPackages())
|
|
@@ -112,21 +114,23 @@ def reExecuteNuitka(pgo_filename):
|
|
|
112
114
|
if user_site is not None:
|
|
113
115
|
os.environ["NUITKA_USER_SITE"] = repr(user_site)
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
setLaunchingNuitkaProcessEnvironmentValue("NUITKA_PYTHONPATH", repr(sys.path))
|
|
116
118
|
|
|
117
119
|
# In some environments, initial "sys.path" does not contain enough to load
|
|
118
120
|
# "ast" module, which however we use to decode "NUITKA_PYTHONPATH", this
|
|
119
121
|
# helps solve the chicken and egg problem.
|
|
120
122
|
import ast
|
|
121
123
|
|
|
122
|
-
|
|
124
|
+
setLaunchingNuitkaProcessEnvironmentValue(
|
|
125
|
+
"NUITKA_PYTHONPATH_AST", os.path.dirname(ast.__file__)
|
|
126
|
+
)
|
|
123
127
|
|
|
124
128
|
if sys.flags.no_site:
|
|
125
129
|
os.environ["NUITKA_NOSITE_FLAG"] = "1"
|
|
126
130
|
|
|
127
131
|
os.environ["PYTHONHASHSEED"] = "0"
|
|
128
132
|
|
|
129
|
-
|
|
133
|
+
setLaunchingNuitkaProcessEnvironmentValue("NUITKA_RE_EXECUTION", "1")
|
|
130
134
|
|
|
131
135
|
# Does not return:
|
|
132
136
|
callExecProcess(args, uac=False)
|
nuitka/utils/SharedLibraries.py
CHANGED
|
@@ -17,11 +17,7 @@ from nuitka.Options import getMacOSTargetArch, isShowInclusion, isUnstripped
|
|
|
17
17
|
from nuitka.PythonVersions import python_version
|
|
18
18
|
from nuitka.Tracing import inclusion_logger, postprocessing_logger
|
|
19
19
|
|
|
20
|
-
from .Execution import
|
|
21
|
-
executeToolChecked,
|
|
22
|
-
withEnvironmentPathAdded,
|
|
23
|
-
withEnvironmentVarOverridden,
|
|
24
|
-
)
|
|
20
|
+
from .Execution import executeToolChecked, withEnvironmentPathAdded
|
|
25
21
|
from .FileOperations import (
|
|
26
22
|
addFileExecutablePermission,
|
|
27
23
|
changeFilenameExtension,
|
|
@@ -87,13 +83,12 @@ def locateDLL(dll_name):
|
|
|
87
83
|
name=dll_name, paths=["/lib", "/usr/lib", "/usr/local/lib"]
|
|
88
84
|
)
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
)
|
|
86
|
+
# TODO: Could and probably should cache "ldconfig -p" output to avoid forks
|
|
87
|
+
output = executeToolChecked(
|
|
88
|
+
logger=postprocessing_logger,
|
|
89
|
+
command=("/sbin/ldconfig", "-p"),
|
|
90
|
+
absence_message=_ldconfig_usage,
|
|
91
|
+
)
|
|
97
92
|
|
|
98
93
|
dll_map = {}
|
|
99
94
|
|
|
@@ -292,6 +287,23 @@ def getOtoolDependencyOutput(filename, package_specific_dirs):
|
|
|
292
287
|
return _getOToolCommandOutput("-L", filename)
|
|
293
288
|
|
|
294
289
|
|
|
290
|
+
def parseOtoolListingOutput(output):
|
|
291
|
+
paths = OrderedSet()
|
|
292
|
+
|
|
293
|
+
for line in output.split(b"\n")[1:]:
|
|
294
|
+
if str is not bytes:
|
|
295
|
+
line = line.decode("utf8")
|
|
296
|
+
|
|
297
|
+
if not line:
|
|
298
|
+
continue
|
|
299
|
+
|
|
300
|
+
filename = line.split(" (", 1)[0].strip()
|
|
301
|
+
|
|
302
|
+
paths.add(filename)
|
|
303
|
+
|
|
304
|
+
return paths
|
|
305
|
+
|
|
306
|
+
|
|
295
307
|
def _getDLLVersionMacOS(filename):
|
|
296
308
|
output = _getOToolCommandOutput("-D", filename).splitlines()
|
|
297
309
|
|
|
@@ -349,14 +361,25 @@ def getSharedLibraryRPATH(filename):
|
|
|
349
361
|
|
|
350
362
|
|
|
351
363
|
def _filterPatchelfErrorOutput(stderr):
|
|
364
|
+
non_errors = []
|
|
365
|
+
|
|
366
|
+
def isNonErrorExit(line):
|
|
367
|
+
if b"cannot find section '.dynamic'" in line:
|
|
368
|
+
non_errors.append(line)
|
|
369
|
+
|
|
370
|
+
return True
|
|
371
|
+
|
|
372
|
+
return False
|
|
373
|
+
|
|
352
374
|
stderr = b"\n".join(
|
|
353
375
|
line
|
|
354
376
|
for line in stderr.splitlines()
|
|
355
377
|
if line
|
|
356
378
|
if b"warning: working around" not in line
|
|
379
|
+
if not isNonErrorExit(line)
|
|
357
380
|
)
|
|
358
381
|
|
|
359
|
-
return None, stderr
|
|
382
|
+
return (0 if non_errors else None), stderr
|
|
360
383
|
|
|
361
384
|
|
|
362
385
|
_patchelf_usage = """\
|
|
@@ -383,13 +406,12 @@ installed. Use 'apt/dnf/yum install patchelf' first.""",
|
|
|
383
406
|
|
|
384
407
|
def _setSharedLibraryRPATHElf(filename, rpath):
|
|
385
408
|
# patchelf --set-rpath "$ORIGIN/path/to/library" <executable>
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
)
|
|
409
|
+
executeToolChecked(
|
|
410
|
+
logger=postprocessing_logger,
|
|
411
|
+
command=("patchelf", "--set-rpath", rpath, filename),
|
|
412
|
+
stderr_filter=_filterPatchelfErrorOutput,
|
|
413
|
+
absence_message=_patchelf_usage,
|
|
414
|
+
)
|
|
393
415
|
|
|
394
416
|
|
|
395
417
|
def _filterInstallNameToolErrorOutput(stderr):
|
|
@@ -464,24 +486,31 @@ def callInstallNameTool(filename, mapping, id_path, rpath):
|
|
|
464
486
|
This is obviously macOS specific.
|
|
465
487
|
"""
|
|
466
488
|
command = ["install_name_tool"]
|
|
489
|
+
|
|
490
|
+
needs_call = False
|
|
467
491
|
for old_path, new_path in mapping:
|
|
468
|
-
|
|
492
|
+
if old_path != new_path:
|
|
493
|
+
command += ("-change", old_path, new_path)
|
|
494
|
+
needs_call = True
|
|
469
495
|
|
|
470
496
|
if rpath is not None:
|
|
471
497
|
command += ("-add_rpath", os.path.join(rpath, "."))
|
|
498
|
+
needs_call = True
|
|
472
499
|
|
|
473
500
|
if id_path is not None:
|
|
474
501
|
command += ("-id", id_path)
|
|
502
|
+
needs_call = True
|
|
475
503
|
|
|
476
504
|
command.append(filename)
|
|
477
505
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
506
|
+
if needs_call:
|
|
507
|
+
with withMadeWritableFileMode(filename):
|
|
508
|
+
executeToolChecked(
|
|
509
|
+
logger=postprocessing_logger,
|
|
510
|
+
command=command,
|
|
511
|
+
absence_message=_install_name_tool_usage,
|
|
512
|
+
stderr_filter=_filterInstallNameToolErrorOutput,
|
|
513
|
+
)
|
|
485
514
|
|
|
486
515
|
|
|
487
516
|
def getPyWin32Dir():
|
|
@@ -788,20 +817,19 @@ def cleanupHeaderForAndroid(filename):
|
|
|
788
817
|
created by default.
|
|
789
818
|
"""
|
|
790
819
|
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
)
|
|
820
|
+
executeToolChecked(
|
|
821
|
+
logger=postprocessing_logger,
|
|
822
|
+
command=("patchelf", "--shrink-rpath", filename),
|
|
823
|
+
stderr_filter=_filterPatchelfErrorOutput,
|
|
824
|
+
absence_message=_patchelf_usage,
|
|
825
|
+
)
|
|
798
826
|
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
827
|
+
executeToolChecked(
|
|
828
|
+
logger=postprocessing_logger,
|
|
829
|
+
command=("termux-elf-cleaner", "--quiet", filename),
|
|
830
|
+
absence_message=_termux_elf_cleaner_usage,
|
|
831
|
+
optional=True,
|
|
832
|
+
)
|
|
805
833
|
|
|
806
834
|
|
|
807
835
|
_nm_usage = """\
|
nuitka/utils/Signing.py
CHANGED
|
@@ -48,6 +48,7 @@ def detectMacIdentity():
|
|
|
48
48
|
if str is not bytes:
|
|
49
49
|
output = output.decode("utf8")
|
|
50
50
|
|
|
51
|
+
signing_name = None
|
|
51
52
|
result = None
|
|
52
53
|
|
|
53
54
|
for line in output.splitlines():
|
|
@@ -96,7 +97,8 @@ def addMacOSCodeSignature(filenames):
|
|
|
96
97
|
identity = detectMacIdentity()
|
|
97
98
|
|
|
98
99
|
command = [
|
|
99
|
-
|
|
100
|
+
# Need to avoid Anaconda codesign.
|
|
101
|
+
"/usr/bin/codesign",
|
|
100
102
|
"-s",
|
|
101
103
|
identity,
|
|
102
104
|
"--force",
|
nuitka/utils/StaticLibraries.py
CHANGED
|
@@ -12,6 +12,7 @@ from nuitka.PythonFlavors import (
|
|
|
12
12
|
isAnacondaPython,
|
|
13
13
|
isDebianPackagePython,
|
|
14
14
|
isNuitkaPython,
|
|
15
|
+
isRyePython,
|
|
15
16
|
)
|
|
16
17
|
from nuitka.PythonVersions import (
|
|
17
18
|
getPythonABI,
|
|
@@ -22,7 +23,12 @@ from nuitka.PythonVersions import (
|
|
|
22
23
|
from nuitka.Tracing import general
|
|
23
24
|
|
|
24
25
|
from .FileOperations import getFileContentByLine, getFileList
|
|
25
|
-
from .Utils import
|
|
26
|
+
from .Utils import (
|
|
27
|
+
getLinuxDistribution,
|
|
28
|
+
isDebianBasedLinux,
|
|
29
|
+
isMacOS,
|
|
30
|
+
isWin32Windows,
|
|
31
|
+
)
|
|
26
32
|
|
|
27
33
|
_ldconf_paths = None
|
|
28
34
|
|
|
@@ -38,14 +44,15 @@ def locateStaticLinkLibrary(dll_name):
|
|
|
38
44
|
|
|
39
45
|
def _locateStaticLinkLibrary(dll_name):
|
|
40
46
|
# singleton, pylint: disable=global-statement
|
|
47
|
+
|
|
41
48
|
#
|
|
42
49
|
global _ldconf_paths
|
|
43
50
|
|
|
44
51
|
if _ldconf_paths is None:
|
|
45
52
|
_ldconf_paths = OrderedSet()
|
|
46
53
|
|
|
47
|
-
for
|
|
48
|
-
for conf_line in getFileContentByLine(
|
|
54
|
+
for conf_filename in getFileList("/etc/ld.so.conf.d", only_suffixes=".conf"):
|
|
55
|
+
for conf_line in getFileContentByLine(conf_filename):
|
|
49
56
|
conf_line = conf_line.split("#", 1)[0]
|
|
50
57
|
conf_line = conf_line.strip()
|
|
51
58
|
|
|
@@ -142,53 +149,56 @@ def _getSystemStaticLibPythonPath():
|
|
|
142
149
|
for candidate in candidates:
|
|
143
150
|
if os.path.exists(candidate):
|
|
144
151
|
return candidate
|
|
145
|
-
else:
|
|
146
|
-
candidate = os.path.join(
|
|
147
|
-
sys_prefix, "lib", "libpython" + python_abi_version + ".a"
|
|
148
|
-
)
|
|
149
152
|
|
|
150
|
-
|
|
151
|
-
return candidate
|
|
153
|
+
return None
|
|
152
154
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
python_version < 0x300
|
|
156
|
-
and isDebianPackagePython()
|
|
157
|
-
and isDebianSuitableForStaticLinking()
|
|
158
|
-
):
|
|
159
|
-
candidate = locateStaticLinkLibrary("python" + python_abi_version)
|
|
160
|
-
else:
|
|
161
|
-
candidate = None
|
|
155
|
+
if isMacOS() and isRyePython():
|
|
156
|
+
return None
|
|
162
157
|
|
|
163
|
-
|
|
164
|
-
# Also check libz, can be missing
|
|
165
|
-
if not locateStaticLinkLibrary("z"):
|
|
166
|
-
general.warning(
|
|
167
|
-
"Error, missing 'libz-dev' installation needed for static lib-python."
|
|
168
|
-
)
|
|
158
|
+
candidate = os.path.join(sys_prefix, "lib", "libpython" + python_abi_version + ".a")
|
|
169
159
|
|
|
170
|
-
|
|
160
|
+
if os.path.exists(candidate):
|
|
161
|
+
return candidate
|
|
171
162
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
163
|
+
# For Python2 this works. TODO: Figure out Debian and Python3.
|
|
164
|
+
if (
|
|
165
|
+
python_version < 0x300
|
|
166
|
+
and isDebianPackagePython()
|
|
167
|
+
and isDebianSuitableForStaticLinking()
|
|
168
|
+
):
|
|
169
|
+
candidate = locateStaticLinkLibrary("python" + python_abi_version)
|
|
170
|
+
else:
|
|
171
|
+
candidate = None
|
|
172
|
+
|
|
173
|
+
if candidate is not None and os.path.exists(candidate):
|
|
174
|
+
# Also check libz, can be missing
|
|
175
|
+
if not locateStaticLinkLibrary("z"):
|
|
176
|
+
general.warning(
|
|
177
|
+
"Error, missing 'libz-dev' installation needed for static lib-python."
|
|
178
178
|
)
|
|
179
179
|
|
|
180
|
-
|
|
181
|
-
return candidate
|
|
180
|
+
return candidate
|
|
182
181
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
182
|
+
# This is not necessarily only for Python3 on Debian, but maybe others as well,
|
|
183
|
+
# but that's what's been tested. spell-checker: ignore libpl
|
|
184
|
+
if python_version >= 0x300 and isDebianPackagePython() and isDebianBasedLinux():
|
|
185
|
+
candidate = os.path.join(
|
|
186
|
+
_getSysConfigVarLIBPL(),
|
|
187
|
+
"libpython" + python_abi_version + "-pic.a",
|
|
188
|
+
)
|
|
189
189
|
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
if os.path.exists(candidate):
|
|
191
|
+
return candidate
|
|
192
|
+
|
|
193
|
+
libpl = _getSysConfigVarLIBPL()
|
|
194
|
+
if libpl is not None:
|
|
195
|
+
candidate = os.path.join(
|
|
196
|
+
libpl,
|
|
197
|
+
"libpython" + python_abi_version + ".a",
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
if os.path.exists(candidate):
|
|
201
|
+
return candidate
|
|
192
202
|
|
|
193
203
|
return None
|
|
194
204
|
|
nuitka/utils/Timing.py
CHANGED
|
@@ -83,7 +83,7 @@ class TimerReport(object):
|
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
if exception_type is None and above_threshold and self.decider():
|
|
86
|
-
self.logger.info(self.message % self.timer.getDelta())
|
|
86
|
+
self.logger.info(self.message % self.timer.getDelta(), keep_format=True)
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
nuitka/utils/Utils.py
CHANGED
|
@@ -376,7 +376,13 @@ def withNoWarning():
|
|
|
376
376
|
|
|
377
377
|
|
|
378
378
|
def decoratorRetries(
|
|
379
|
-
logger,
|
|
379
|
+
logger,
|
|
380
|
+
purpose,
|
|
381
|
+
consequence,
|
|
382
|
+
extra_recommendation=None,
|
|
383
|
+
attempts=5,
|
|
384
|
+
sleep_time=1,
|
|
385
|
+
exception_type=OSError,
|
|
380
386
|
):
|
|
381
387
|
"""Make retries for errors on Windows.
|
|
382
388
|
|
|
@@ -384,6 +390,10 @@ def decoratorRetries(
|
|
|
384
390
|
a virus checker warning.
|
|
385
391
|
"""
|
|
386
392
|
|
|
393
|
+
recommendation = "Disable Anti-Virus, e.g. Windows Defender for build folders."
|
|
394
|
+
if extra_recommendation is not None:
|
|
395
|
+
recommendation = "%s. %s" % (extra_recommendation, recommendation)
|
|
396
|
+
|
|
387
397
|
def inner(func):
|
|
388
398
|
if os.name != "nt":
|
|
389
399
|
return func
|
|
@@ -398,8 +408,9 @@ def decoratorRetries(
|
|
|
398
408
|
logger.warning(
|
|
399
409
|
"""\
|
|
400
410
|
Failed to %s in attempt %d due to %s.
|
|
401
|
-
|
|
402
|
-
|
|
411
|
+
%s
|
|
412
|
+
Retrying after a second of delay."""
|
|
413
|
+
% (purpose, attempt, str(e), recommendation)
|
|
403
414
|
)
|
|
404
415
|
|
|
405
416
|
else:
|
|
@@ -407,15 +418,17 @@ Disable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a se
|
|
|
407
418
|
logger.warning(
|
|
408
419
|
"""\
|
|
409
420
|
Failed to %s in attempt %d.
|
|
410
|
-
|
|
411
|
-
|
|
421
|
+
%s
|
|
422
|
+
Retrying after a second of delay."""
|
|
423
|
+
% (purpose, attempt, recommendation)
|
|
412
424
|
)
|
|
413
425
|
else:
|
|
414
426
|
logger.warning(
|
|
415
427
|
"""\
|
|
416
428
|
Failed to %s in attempt %d with error code %d.
|
|
417
|
-
|
|
418
|
-
|
|
429
|
+
%s
|
|
430
|
+
Retrying after a second of delay."""
|
|
431
|
+
% (purpose, attempt, e.errno, recommendation)
|
|
419
432
|
)
|
|
420
433
|
|
|
421
434
|
time.sleep(sleep_time)
|
|
@@ -443,6 +456,15 @@ def raiseWindowsError(message):
|
|
|
443
456
|
)
|
|
444
457
|
|
|
445
458
|
|
|
459
|
+
def getLaunchingNuitkaProcessEnvironmentValue(environment_variable_name):
|
|
460
|
+
# Hack, we need this to bootstrap and it's actually living in __main__
|
|
461
|
+
# module of nuitka package and renamed to where we can get at easily for
|
|
462
|
+
# other uses. pylint: disable=no-name-in-module,redefined-outer-name
|
|
463
|
+
from nuitka import getLaunchingNuitkaProcessEnvironmentValue
|
|
464
|
+
|
|
465
|
+
return getLaunchingNuitkaProcessEnvironmentValue(environment_variable_name)
|
|
466
|
+
|
|
467
|
+
|
|
446
468
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
447
469
|
# integrates with CPython, but also works on its own.
|
|
448
470
|
#
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|