Nuitka-winsvc 1.6.6__cp310-cp310-win_amd64.whl → 1.7.5__cp310-cp310-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.
Files changed (84) hide show
  1. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/RECORD +84 -81
  3. nuitka/Builtins.py +7 -1
  4. nuitka/MainControl.py +4 -0
  5. nuitka/OptionParsing.py +5 -3
  6. nuitka/Options.py +17 -2
  7. nuitka/Serialization.py +28 -5
  8. nuitka/Version.py +2 -2
  9. nuitka/build/Backend.scons +16 -3
  10. nuitka/build/CCompilerVersion.scons +1 -1
  11. nuitka/build/DataComposerInterface.py +15 -9
  12. nuitka/build/Onefile.scons +1 -1
  13. nuitka/build/SconsCompilerSettings.py +1 -0
  14. nuitka/build/SconsProgress.py +11 -2
  15. nuitka/build/SconsSpawn.py +15 -15
  16. nuitka/build/include/nuitka/builtins.h +2 -0
  17. nuitka/build/include/nuitka/filesystem_paths.h +4 -0
  18. nuitka/build/include/nuitka/helper/attributes.h +3 -0
  19. nuitka/build/include/nuitka/helper/import_hard.h +6 -0
  20. nuitka/build/include/nuitka/helpers.h +1 -1
  21. nuitka/build/include/nuitka/safe_string_ops.h +10 -3
  22. nuitka/build/static_src/CompiledCodeHelpers.c +0 -200
  23. nuitka/build/static_src/HelpersAttributes.c +185 -8
  24. nuitka/build/static_src/HelpersFilesystemPaths.c +528 -7
  25. nuitka/build/static_src/HelpersImportHard.c +38 -0
  26. nuitka/build/static_src/HelpersSafeStrings.c +6 -278
  27. nuitka/build/static_src/MainProgram.c +273 -73
  28. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +6 -0
  29. nuitka/build/static_src/OnefileBootstrap.c +19 -36
  30. nuitka/build/static_src/OnefileSplashScreen.cpp +1 -0
  31. nuitka/code_generation/AttributeCodes.py +42 -23
  32. nuitka/code_generation/CodeGeneration.py +4 -0
  33. nuitka/code_generation/FunctionCodes.py +18 -3
  34. nuitka/code_generation/GlobalConstants.py +8 -1
  35. nuitka/code_generation/PackageResourceCodes.py +40 -0
  36. nuitka/code_generation/templates/CodeTemplatesModules.py +1 -7
  37. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  38. nuitka/freezer/IncludedDataFiles.py +6 -10
  39. nuitka/importing/ImportResolving.py +6 -0
  40. nuitka/importing/Recursion.py +24 -68
  41. nuitka/nodes/AttributeNodes.py +72 -19
  42. nuitka/nodes/ChildrenHavingMixins.py +203 -234
  43. nuitka/nodes/ExpressionBasesGenerated.py +136 -0
  44. nuitka/nodes/HardImportNodesGenerated.py +94 -0
  45. nuitka/nodes/ImportHardNodes.py +3 -3
  46. nuitka/nodes/ImportNodes.py +14 -4
  47. nuitka/nodes/ModuleNodes.py +4 -2
  48. nuitka/nodes/PackageMetadataNodes.py +12 -10
  49. nuitka/nodes/PackageResourceNodes.py +115 -0
  50. nuitka/nodes/TypeNodes.py +5 -1
  51. nuitka/plugins/PluginBase.py +32 -8
  52. nuitka/plugins/Plugins.py +44 -7
  53. nuitka/plugins/standard/AntiBloatPlugin.py +166 -72
  54. nuitka/plugins/standard/DataFilesPlugin.py +10 -0
  55. nuitka/plugins/standard/DllFilesPlugin.py +1 -2
  56. nuitka/plugins/standard/MatplotlibPlugin.py +24 -22
  57. nuitka/plugins/standard/MultiprocessingPlugin.py +5 -12
  58. nuitka/plugins/standard/OptionsNannyPlugin.py +2 -2
  59. nuitka/plugins/standard/PySidePyQtPlugin.py +18 -6
  60. nuitka/plugins/standard/PywebViewPlugin.py +4 -2
  61. nuitka/plugins/standard/TkinterPlugin.py +3 -0
  62. nuitka/plugins/standard/TransformersPlugin.py +11 -1
  63. nuitka/plugins/standard/TrioPlugin.py +6 -66
  64. nuitka/plugins/standard/standard.nuitka-package.config.yml +367 -21
  65. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +16 -4
  66. nuitka/specs/HardImportSpecs.py +6 -0
  67. nuitka/tools/data_composer/DataComposer.py +25 -27
  68. nuitka/tools/general/find_module/FindModuleCode.py +5 -2
  69. nuitka/tools/podman/Podman.py +53 -0
  70. nuitka/tools/podman/__init__.py +18 -0
  71. nuitka/tools/podman/__main__.py +255 -0
  72. nuitka/tools/specialize/SpecializePython.py +37 -3
  73. nuitka/tools/testing/RuntimeTracing.py +4 -0
  74. nuitka/tree/Building.py +1 -1
  75. nuitka/tree/ReformulationFunctionStatements.py +137 -10
  76. nuitka/utils/Execution.py +11 -1
  77. nuitka/utils/ModuleNames.py +1 -1
  78. nuitka/utils/SharedLibraries.py +7 -7
  79. {Nuitka_winsvc-1.6.6.data → Nuitka_winsvc-1.7.5.data}/scripts/nuitka-run.bat +0 -0
  80. {Nuitka_winsvc-1.6.6.data → Nuitka_winsvc-1.7.5.data}/scripts/nuitka.bat +0 -0
  81. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/LICENSE.txt +0 -0
  82. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/WHEEL +0 -0
  83. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/entry_points.txt +0 -0
  84. {Nuitka_winsvc-1.6.6.dist-info → Nuitka_winsvc-1.7.5.dist-info}/top_level.txt +0 -0
@@ -124,287 +124,15 @@ void appendStringSafeW(wchar_t *target, char const *source, size_t buffer_size)
124
124
  }
125
125
  }
126
126
 
127
+ void printOSErrorMessage(char const *message, error_code_t error_code) {
127
128
  #if defined(_WIN32)
129
+ LPCTSTR err_buffer;
128
130
 
129
- // Note: Keep this separate line, must be included before other Windows headers.
130
- #include <windows.h>
131
-
132
- #include <shlobj.h>
133
- #include <shlwapi.h>
134
-
135
- // For less complete C compilers.
136
- #ifndef CSIDL_LOCAL_APPDATA
137
- #define CSIDL_LOCAL_APPDATA 28
138
- #endif
139
- #ifndef CSIDL_PROFILE
140
- #define CSIDL_PROFILE 40
141
- #endif
142
-
143
- // spell-checker: ignore csidl
131
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
132
+ error_code, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), (LPTSTR)&err_buffer, 0, NULL);
144
133
 
145
- static bool appendStringCSIDLPathW(wchar_t *target, int csidl_id, size_t buffer_size) {
146
- wchar_t path_buffer[MAX_PATH];
147
- #if !defined(_M_ARM64)
148
- int res = SHGetFolderPathW(NULL, csidl_id, NULL, 0, path_buffer);
149
-
150
- if (res != S_OK) {
151
- return false;
152
- }
134
+ fprintf(stderr, "%s ([Error %d] %s)\n", message, error_code, err_buffer);
153
135
  #else
154
- DWORD res = 0;
155
- if (csidl_id == CSIDL_PROFILE) {
156
- res = GetEnvironmentVariableW(L"USERPROFILE", path_buffer, sizeof(path_buffer));
157
- } else if (csidl_id == CSIDL_LOCAL_APPDATA) {
158
- res = GetEnvironmentVariableW(L"LOCALAPPDATA", path_buffer, sizeof(path_buffer));
159
- }
160
-
161
- if (res == 0 || res > sizeof(path_buffer)) {
162
- return false;
163
- }
136
+ fprintf(stderr, "%s: %s\n", message, strerror(error_code));
164
137
  #endif
165
- appendWStringSafeW(target, path_buffer, buffer_size);
166
-
167
- return true;
168
138
  }
169
-
170
- bool expandTemplatePathW(wchar_t *target, wchar_t const *source, size_t buffer_size) {
171
- target[0] = 0;
172
-
173
- wchar_t var_name[1024];
174
- wchar_t *w = NULL;
175
-
176
- while (*source != 0) {
177
- if (*source == '%') {
178
- if (w == NULL) {
179
- w = var_name;
180
- *w = 0;
181
-
182
- source++;
183
-
184
- continue;
185
- } else {
186
- *w = 0;
187
-
188
- bool is_path = false;
189
-
190
- if (wcsicmp(var_name, L"TEMP") == 0) {
191
- GetTempPathW((DWORD)buffer_size, target);
192
- is_path = true;
193
- } else if (wcsicmp(var_name, L"PROGRAM") == 0) {
194
- #if _NUITKA_ONEFILE_TEMP_BOOL == 1
195
- appendWStringSafeW(target, __wargv[0], buffer_size);
196
- #else
197
- if (!GetModuleFileNameW(NULL, target, (DWORD)buffer_size)) {
198
- return false;
199
- }
200
- #endif
201
- } else if (wcsicmp(var_name, L"PID") == 0) {
202
- char pid_buffer[128];
203
- snprintf(pid_buffer, sizeof(pid_buffer), "%d", GetCurrentProcessId());
204
-
205
- appendStringSafeW(target, pid_buffer, buffer_size);
206
- } else if (wcsicmp(var_name, L"HOME") == 0) {
207
- if (appendStringCSIDLPathW(target, CSIDL_PROFILE, buffer_size) == false) {
208
- return false;
209
- }
210
- is_path = true;
211
- } else if (wcsicmp(var_name, L"CACHE_DIR") == 0) {
212
- if (appendStringCSIDLPathW(target, CSIDL_LOCAL_APPDATA, buffer_size) == false) {
213
- return false;
214
- }
215
- is_path = true;
216
- #ifdef NUITKA_COMPANY_NAME
217
- } else if (wcsicmp(var_name, L"COMPANY") == 0) {
218
- appendWStringSafeW(target, L"" NUITKA_COMPANY_NAME, buffer_size);
219
- #endif
220
- #ifdef NUITKA_PRODUCT_NAME
221
- } else if (wcsicmp(var_name, L"PRODUCT") == 0) {
222
- appendWStringSafeW(target, L"" NUITKA_PRODUCT_NAME, buffer_size);
223
- #endif
224
- #ifdef NUITKA_VERSION_COMBINED
225
- } else if (wcsicmp(var_name, L"VERSION") == 0) {
226
- appendWStringSafeW(target, L"" NUITKA_VERSION_COMBINED, buffer_size);
227
- #endif
228
- } else if (wcsicmp(var_name, L"TIME") == 0) {
229
- char time_buffer[1024];
230
-
231
- __int64 time = 0;
232
- assert(sizeof(time) == sizeof(FILETIME));
233
- GetSystemTimeAsFileTime((LPFILETIME)&time);
234
-
235
- snprintf(time_buffer, sizeof(time_buffer), "%lld", time);
236
-
237
- appendStringSafeW(target, time_buffer, buffer_size);
238
- } else {
239
- return false;
240
- }
241
-
242
- // Skip over appended stuff.
243
- while (*target) {
244
- target++;
245
- buffer_size -= 1;
246
- }
247
-
248
- if (is_path) {
249
- while (*(target - 1) == FILENAME_SEP_CHAR) {
250
- target--;
251
- *target = 0;
252
- buffer_size += 1;
253
- }
254
- }
255
-
256
- w = NULL;
257
- source++;
258
-
259
- continue;
260
- }
261
- }
262
-
263
- if (w != NULL) {
264
- *w++ = *source++;
265
- continue;
266
- }
267
-
268
- if (buffer_size < 1) {
269
- return false;
270
- }
271
-
272
- *target++ = *source++;
273
- buffer_size -= 1;
274
- }
275
-
276
- *target = 0;
277
-
278
- return true;
279
- }
280
-
281
- #else
282
-
283
- #include <pwd.h>
284
- #include <strings.h>
285
- #include <sys/time.h>
286
-
287
- bool expandTemplatePath(char *target, char const *source, size_t buffer_size) {
288
- target[0] = 0;
289
-
290
- char var_name[1024];
291
- char *w = NULL;
292
-
293
- while (*source != 0) {
294
- if (*source == '%') {
295
- if (w == NULL) {
296
- w = var_name;
297
- *w = 0;
298
-
299
- source++;
300
-
301
- continue;
302
- } else {
303
- *w = 0;
304
-
305
- bool is_path = false;
306
-
307
- if (strcasecmp(var_name, "TEMP") == 0) {
308
- char const *tmp_dir = getenv("TMPDIR");
309
- if (tmp_dir == NULL) {
310
- tmp_dir = "/tmp";
311
- }
312
-
313
- appendStringSafe(target, tmp_dir, buffer_size);
314
- is_path = true;
315
- } else if (strcasecmp(var_name, "PROGRAM") == 0) {
316
- // Not implemented outside of Windows yet.
317
- return false;
318
- } else if (strcasecmp(var_name, "PID") == 0) {
319
- char pid_buffer[128];
320
-
321
- snprintf(pid_buffer, sizeof(pid_buffer), "%d", getpid());
322
-
323
- appendStringSafe(target, pid_buffer, buffer_size);
324
- } else if (strcasecmp(var_name, "HOME") == 0) {
325
- char const *home_path = getenv("HOME");
326
-
327
- if (home_path == NULL) {
328
- struct passwd *pw_data = getpwuid(getuid());
329
-
330
- if (unlikely(pw_data == NULL)) {
331
- return false;
332
- }
333
-
334
- home_path = pw_data->pw_dir;
335
- }
336
-
337
- appendStringSafe(target, home_path, buffer_size);
338
- is_path = true;
339
- } else if (strcasecmp(var_name, "CACHE_DIR") == 0) {
340
- if (expandTemplatePath(target, "%HOME%", buffer_size - strlen(target)) == false) {
341
- return false;
342
- }
343
-
344
- appendCharSafe(target, '/', buffer_size);
345
- appendStringSafe(target, ".cache", buffer_size);
346
- is_path = true;
347
- #ifdef NUITKA_COMPANY_NAME
348
- } else if (strcasecmp(var_name, "COMPANY") == 0) {
349
- appendStringSafe(target, NUITKA_COMPANY_NAME, buffer_size);
350
- #endif
351
- #ifdef NUITKA_PRODUCT_NAME
352
- } else if (strcasecmp(var_name, "PRODUCT") == 0) {
353
- appendStringSafe(target, NUITKA_PRODUCT_NAME, buffer_size);
354
- #endif
355
- #ifdef NUITKA_VERSION_COMBINED
356
- } else if (strcasecmp(var_name, "VERSION") == 0) {
357
- appendStringSafe(target, NUITKA_VERSION_COMBINED, buffer_size);
358
- #endif
359
- } else if (strcasecmp(var_name, "TIME") == 0) {
360
- char time_buffer[1024];
361
-
362
- struct timeval current_time;
363
- gettimeofday(&current_time, NULL);
364
- snprintf(time_buffer, sizeof(time_buffer), "%ld_%ld", current_time.tv_sec,
365
- (long)current_time.tv_usec);
366
-
367
- appendStringSafe(target, time_buffer, buffer_size);
368
- } else {
369
- return false;
370
- }
371
- // Skip over appended stuff.
372
- while (*target) {
373
- target++;
374
- buffer_size -= 1;
375
- }
376
-
377
- if (is_path) {
378
- while (*(target - 1) == FILENAME_SEP_CHAR) {
379
- target--;
380
- *target = 0;
381
- buffer_size += 1;
382
- }
383
- }
384
-
385
- w = NULL;
386
- source++;
387
-
388
- continue;
389
- }
390
- }
391
-
392
- if (w != NULL) {
393
- *w++ = *source++;
394
- continue;
395
- }
396
-
397
- if (buffer_size < 1) {
398
- return false;
399
- }
400
-
401
- *target++ = *source++;
402
- buffer_size -= 1;
403
- }
404
-
405
- *target = 0;
406
-
407
- return true;
408
- }
409
-
410
- #endif