Commit c28bec3
committed
Windows: absorb Python lifecycle into dart_bridge[_d].dll
Mirrors the darwin + android absorption. Python lifecycle code that
used to live in serious_python_windows_plugin.cpp (Py_Initialize,
PyRun_SimpleFile, std::thread worker) moves into dart_bridge.dll,
downloaded as a prebuilt artifact from flet-dev/dart-bridge at CMake
configure time.
What moved:
- CMakeLists.txt drops Python.h include + python<ver>.lib linking
(no Python C API call sites left in this plugin). Adds
file(DOWNLOAD)s for dart_bridge-windows-x86_64.dll (Release CRT) and
dart_bridge_d-windows-x86_64.dll (Debug CRT). The right one for the
current $<CONFIG> is added to serious_python_windows_bundled_libraries
so Flutter's CONFIG-aware copy machinery picks it for each build mode.
- serious_python_windows_plugin.{cpp,h} shrink to a getPlatformVersion
method-channel handler. RunPythonProgram*/RunPythonScript* and the
std::thread worker are gone.
- serious_python_windows.dart's run() becomes one FFI call to
serious_python_run via DartBridge.instance (which picks the Debug or
Release DLL based on kDebugMode). path: ^1.9.0 added.
Note: python3X.dll + python3.dll + Lib/ + DLLs/ + site-packages still
get bundled — libdart_bridge.dll's import table references python3.dll
(abi3 stub) which forwards to python3X.dll, and Python's import system
needs Lib/site-packages on disk at runtime.
CI: test-bridge-build.yml gains a test_bridge_example_windows job for
all three Python versions.1 parent a4ece59 commit c28bec3
6 files changed
Lines changed: 128 additions & 234 deletions
File tree
- .github/workflows
- src/serious_python_windows
- lib
- windows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
Lines changed: 48 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
7 | 19 | | |
8 | | - | |
9 | 20 | | |
10 | 21 | | |
11 | 22 | | |
12 | | - | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| |||
18 | 28 | | |
19 | 29 | | |
20 | 30 | | |
21 | | - | |
| 31 | + | |
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
| |||
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
37 | 62 | | |
38 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
39 | 76 | | |
40 | 77 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
| |||
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
25 | 35 | | |
26 | 36 | | |
27 | 37 | | |
| |||
30 | 40 | | |
31 | 41 | | |
32 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
33 | 63 | | |
34 | 64 | | |
35 | 65 | | |
| |||
62 | 92 | | |
63 | 93 | | |
64 | 94 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 95 | | |
70 | 96 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 97 | | |
76 | 98 | | |
77 | 99 | | |
78 | 100 | | |
79 | 101 | | |
80 | 102 | | |
81 | 103 | | |
| 104 | + | |
82 | 105 | | |
83 | 106 | | |
84 | 107 | | |
| |||
90 | 113 | | |
91 | 114 | | |
92 | 115 | | |
93 | | - | |
| 116 | + | |
94 | 117 | | |
95 | 118 | | |
96 | | - | |
| 119 | + | |
97 | 120 | | |
98 | 121 | | |
99 | 122 | | |
| |||
0 commit comments