Commit 2cd8daa
committed
Replace per-type import bookkeeping with ffigen symbol-file dedup
Cross-module shared types were deduplicated by hand-enumerating every
typedef/struct/union in per-module `imports` lists in modules.yaml, which
build_configs.py rendered into library-imports + type-map blocks. Each new
duplicate required finding the owning module and appending the exact type
name, and the lists (48-50 edges per version) had to be kept in sync with
the C headers.
Replace the enumerated lists with a plain `deps` list of module names and
use ffigen's native symbol-file mechanism instead: a module named in
another module's deps exports a symbol file (output.symbol-file), and the
depending module imports it (import.symbol-files), so ffigen references
the provider's declarations for every shared type automatically. The
dependency edges are unchanged; only the per-type bookkeeping is gone
(-1,288 lines across the six manifests).
- build_configs.py renders provider/consumer blocks from deps, keeps
type-map only for dart:ffi primitive_typedefs, and emits
ffigen_order.txt (topological order, providers first) since a consumer
needs its providers' symbol files to exist.
- generate_bindings.sh runs ffigen in that order and then runs the new
rename_unnamed.py, which prefixes ffigen's per-file UnnamedStructN/
UnnamedUnionN names with the module stem so they are globally unique
and no longer need hide clauses.
- generate_tizen.py now hides any duplicated top-level export (classes,
enums, typedefs, and const macros), recognizing symbol-file aliases
(typedef X = impN.X;) so the real declaration keeps ownership.
- resolve_type_dups.py derives a single deps edge per duplicate pair
instead of growing enumerated type lists, and regenerates changed
modules in dependency order.
- check_consistency.py additionally validates that deps name existing
modules and form a DAG.
The 6.0 dependency edges and rendered configs are identical to the ones
validated on jsuya/ffigen-6.0-pushable (dart analyze clean, integration
test 56/57 on RPI4, the one failure being an unrelated NOT_SUPPORTED).1 parent 259ea64 commit 2cd8daa
17 files changed
Lines changed: 958 additions & 2511 deletions
File tree
- configs
- 10.0
- 6.0
- 6.5
- 7.0
- 8.0
- 9.0
- doc
- scripts
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
| 87 | + | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
89 | | - | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
102 | 106 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 107 | + | |
| 108 | + | |
118 | 109 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 110 | + | |
132 | 111 | | |
133 | 112 | | |
134 | 113 | | |
| |||
141 | 120 | | |
142 | 121 | | |
143 | 122 | | |
144 | | - | |
| 123 | + | |
145 | 124 | | |
146 | 125 | | |
147 | 126 | | |
| |||
158 | 137 | | |
159 | 138 | | |
160 | 139 | | |
161 | | - | |
| 140 | + | |
162 | 141 | | |
163 | 142 | | |
164 | 143 | | |
| |||
172 | 151 | | |
173 | 152 | | |
174 | 153 | | |
175 | | - | |
| 154 | + | |
176 | 155 | | |
177 | 156 | | |
178 | 157 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
0 commit comments