Verify native library integrity during extraction/load#2368
Verify native library integrity during extraction/load#2368mcm001 merged 26 commits intoPhotonVision:mainfrom
Conversation
85f5254 to
c726440
Compare
4c59257 to
1031073
Compare
|
Testing locally seems to be succesful. I can corrupt a file, and it'll be replaced when files are re-extracted. |
photon-targeting/src/main/java/org/photonvision/jni/CombinedRuntimeLoader.java
Show resolved
Hide resolved
photon-targeting/src/main/java/org/photonvision/jni/CombinedRuntimeLoader.java
Outdated
Show resolved
Hide resolved
|
One run from my laptop: (units in milliseconds) |
|
On an rpi3b, This was run on an extraction of the latest jar's native libraries. |
|
The bug here is that every call to |
|
Looks like on my Ubuntu laptop, main loads native libraries in |
mcm001
left a comment
There was a problem hiding this comment.
No more juice left to squeeze on Linux x64 at least
Description
We've hit a problem where the
CombinedRuntimeLoaderextracts native files, but gets interrupted in the middle. This is bad, cause allCombinedRuntimeLoaderused 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: