Commit 3a9cdf7
Verify native library integrity during extraction/load (#2368)
## Description
We've hit a problem where the `CombinedRuntimeLoader` extracts native
files, but gets interrupted in the middle. This is bad, cause all
`CombinedRuntimeLoader` used to check a file was its existence. This
change uses the hash of the file to verify that it's correct. This will
be checked at runtime, everytime, if the file is extant. If this check
fails, we will delete the extant file and attempt to reextract. We also
check a newly extracted file, if that hash does not match we error.
Note that this is reliant on
PhotonVision/wpilib-tool-plugin#8 and should
follow #2367
## Meta
Merge checklist:
- [x] Pull Request title is [short, imperative
summary](https://cbea.ms/git-commit/) of proposed changes
- [x] The description documents the _what_ and _why_, including events
that led to this PR
- [ ] If this PR changes behavior or adds a feature, user documentation
is updated
- [ ] If this PR touches photon-serde, all messages have been
regenerated and hashes have not changed unexpectedly
- [ ] If this PR touches configuration, this is backwards compatible
with all settings going back to the previous seasons's last release
(seasons end after champs ends)
- [ ] If this PR touches pipeline settings or anything related to data
exchange, the frontend typing is updated
- [ ] If this PR addresses a bug, a regression test for it is added
---------
Co-authored-by: Matt M <matthew.morley.ca@gmail.com>1 parent 95f637f commit 3a9cdf7
File tree
4 files changed
+117
-27
lines changed- .github/workflows
- photon-targeting/src/main/java/org/photonvision
- common/hardware
- jni
4 files changed
+117
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
447 | 468 | | |
448 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
449 | 472 | | |
450 | 473 | | |
451 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
Lines changed: 90 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
| 22 | + | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | | - | |
| 33 | + | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
127 | 158 | | |
128 | 159 | | |
129 | 160 | | |
| |||
133 | 164 | | |
134 | 165 | | |
135 | 166 | | |
136 | | - | |
137 | 167 | | |
138 | 168 | | |
139 | | - | |
140 | 169 | | |
141 | | - | |
| 170 | + | |
142 | 171 | | |
143 | | - | |
| 172 | + | |
144 | 173 | | |
145 | 174 | | |
146 | 175 | | |
147 | 176 | | |
148 | 177 | | |
149 | 178 | | |
150 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
151 | 188 | | |
152 | | - | |
| 189 | + | |
| 190 | + | |
153 | 191 | | |
154 | 192 | | |
155 | 193 | | |
156 | 194 | | |
157 | | - | |
| 195 | + | |
| 196 | + | |
158 | 197 | | |
159 | 198 | | |
160 | | - | |
| 199 | + | |
161 | 200 | | |
162 | 201 | | |
163 | 202 | | |
164 | 203 | | |
165 | 204 | | |
166 | 205 | | |
167 | 206 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 207 | + | |
171 | 208 | | |
172 | 209 | | |
173 | 210 | | |
174 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
175 | 215 | | |
176 | 216 | | |
177 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
178 | 226 | | |
179 | 227 | | |
180 | 228 | | |
| |||
183 | 231 | | |
184 | 232 | | |
185 | 233 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
190 | 239 | | |
191 | 240 | | |
192 | 241 | | |
193 | 242 | | |
194 | 243 | | |
195 | 244 | | |
196 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
197 | 260 | | |
198 | 261 | | |
199 | 262 | | |
| |||
229 | 292 | | |
230 | 293 | | |
231 | 294 | | |
232 | | - | |
233 | | - | |
234 | | - | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
235 | 301 | | |
236 | | - | |
237 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
238 | 305 | | |
239 | 306 | | |
240 | 307 | | |
0 commit comments