1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
### locals
# i.e., std::env::current_exe()
= # input
# the pytauri extension module
= # input
### Freezing ###
# ref:
#
# - <https://gregoryszorc.com/docs/pyoxidizer/0.24.0/pyoxidizer_packaging_multiprocessing.html>
# - <https://github.com/python/cpython/blob/60403a5409ff2c3f3b07dd2ca91a7a3e096839c7/Lib/multiprocessing/spawn.py#L67-L95>
# - <https://pyinstaller.org/en/v6.11.1/common-issues-and-pitfalls.html#multi-processing>
# - <https://github.com/pyinstaller/pyinstaller/blob/v6.11.1/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py>
# see also: <https://docs.python.org/3.13/library/multiprocessing.html#contexts-and-start-methods>
# Because `freeze_support` only supports Windows with `spawn`,
# so we must set `fork` on unix, or we will get an
# endless spawn loop of the application process.
# See: <https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html#multi-processing>
#
# We must set it munaually here, because the default value is:
# - MacOs: `spawn`
# - Linux: `forkserver` if `sys.version_info >= (3, 14)` else `fork`
# we must set `executable` for `multiprocessing` manually,
# because on rust, we set `sys.executable` to actual python interpreter path.
# MUST be set, or `set_executable` will not work,
# see the implementation of `multiprocessing.spawn.get_command_line`
# noqa: B010
# a private custom var, to info python we are running as standalone app.
# noqa: B010
### Append Ext Mod ###
=