Skip to content

Hash native libraries#8

Merged
mcm001 merged 9 commits intoPhotonVision:mainfrom
samfreund:hash-native-libraries
Feb 19, 2026
Merged

Hash native libraries#8
mcm001 merged 9 commits intoPhotonVision:mainfrom
samfreund:hash-native-libraries

Conversation

@samfreund
Copy link
Member

This PR changes the way native libraries are enumerated in the ResourceInformation.json file. Previously, we used a list of filenames. We now use a map of filenames:MD5_hash. This allows us to check the hashes of native libraries as they're extracted.

@samfreund
Copy link
Member Author

There's likely a better way to do this, I'm pulling from what Thad did for now to get an MVP. We can do cleanup later.

Co-authored-by: Matt Morley <matthew.morley.ca@gmail.com>
@samfreund samfreund force-pushed the hash-native-libraries branch from bd768ae to 164fc9e Compare February 19, 2026 03:05
@samfreund samfreund force-pushed the hash-native-libraries branch from 518c868 to 3fd9481 Compare February 19, 2026 04:55
@samfreund samfreund marked this pull request as ready for review February 19, 2026 04:57
@samfreund samfreund force-pushed the hash-native-libraries branch from af8b78f to c0f6c9a Compare February 19, 2026 05:28
@samfreund samfreund requested a review from mcm001 February 19, 2026 16:09
@mcm001 mcm001 force-pushed the hash-native-libraries branch from ddb3098 to 417c087 Compare February 19, 2026 16:54
@mcm001 mcm001 merged commit 395df42 into PhotonVision:main Feb 19, 2026
6 checks passed
@samfreund samfreund deleted the hash-native-libraries branch February 19, 2026 17:01
mcm001 added a commit to PhotonVision/photonvision that referenced this pull request Feb 19, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants