Skip to content

Hubtools and loading#657

Open
mkeeter wants to merge 4 commits intodelete-old-coresfrom
hubtools-and-loading
Open

Hubtools and loading#657
mkeeter wants to merge 4 commits intodelete-old-coresfrom
hubtools-and-loading

Conversation

@mkeeter
Copy link
Copy Markdown
Contributor

@mkeeter mkeeter commented May 6, 2026

(staged on #656)

This PR is based on #633 (using hubtools for Hubris archive manipulation), with two changes:

  • It's rebased to be in the big stack o' refactoring PRs
  • It changes how archives are loaded

The idea behind the second change is simple. In our existing code, we construct a default HubrisArchive, then incrementally populate it; if you are given a HubrisArchive, you do not know if it is valid or not. This feels like a C-style "allocate then populate" workflow, but is not idiomatic in Rust. This PR changes archive construction so that a HubrisArchive is valid by the time you get it.

To start, the only way to build a HubrisArchive is now from a hubtools::RawHubrisArchive. During construction, functions which used to mutate a half-populated archive (taking &mut self) are now methods which return data. Some functions are moved around: constructing the HubrisManifest is moved into methods on that type, instead of on the HubrisArchive itself. Same for I2C: I introduced a new HubrisManifestI2cConfig and HubrisI2cBusList to contain I2C data and methods for building it. There's a lot of code moving around, but not many logic changes.

Along the way, this eliminates the notion of "archive doneness": a HubrisArchive is fully populated, and if you don't like that, you can get the RawHubrisArchive instead.

(Apologies for the size of this PR; I tried to do minimal changes, but each fix required changing something else until I had done the full refactoring)

@mkeeter mkeeter requested a review from labbott May 6, 2026 13:28
@mkeeter mkeeter force-pushed the hubtools-and-loading branch from 16ea8d2 to fe3feff Compare May 6, 2026 13:37
@mkeeter mkeeter force-pushed the delete-old-cores branch from ed20bcf to cf5a21a Compare May 6, 2026 13:37
@mkeeter mkeeter force-pushed the hubtools-and-loading branch 3 times, most recently from a80da4f to f8548f9 Compare May 7, 2026 15:41
labbott and others added 4 commits May 7, 2026 11:46
When humility/hubris were first developed we didn't have many
details of the hubris archive beyond "it's a zip". We've since
developed a separate library for hubris manipulation. Let
humility use it too.
@mkeeter mkeeter force-pushed the hubtools-and-loading branch from f8548f9 to d1f50d6 Compare May 7, 2026 15:46
@mkeeter mkeeter force-pushed the delete-old-cores branch from be13148 to a1838d8 Compare May 7, 2026 15:46
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