oxidecomputer / oxidecomputer/hubtools
Migrate Hubris archive implementation details to the hubtools repo
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2
- Forks
- 5
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
Knowledge about how to construct a Hubris archive and how to access the components within should be centralized into the hubtools repo.
This would improve our ability to maintain the code, test the code and our understanding of archive behavior, and make changes without breaking other repos. Any code found outside of hubtools that knows about the zip file contents is a candidate for refactoring into a hubtools function.
As an example, knowledge about the "img/final.bin" and "img/final.elf" files is distributed between several crates. When the archive is first constructed, care is taken to make sure that the executable contained in "img/final.elf" matches the contents of "img/final.bin". "img/final.bin" is essentially a cached copy of that part of "img/final.elf". Note the code in MGS that checks that the two files match. It doesn't seem right that this check is outside of hubtools.
facade/mfgtool/src/main.rs: let mut af = match archive.by_name("img/final.bin") {
hubris/master/build/xtask/src/dist.rs: .extract_file("img/final.bin")
humility/cmd/gdb/src/lib.rs: .extract_file_to("img/final.elf", &work_dir.path().join("final.elf"))?;
humility/cmd/rebootleby/src/lib.rs: .by_name("img/final.bin")
humility/cmd/rebootleby/src/lib.rs: .context("can't find bootleby.bin or img/final.bin in bundle")?;
humility/humility-core/src/hubris.rs: .by_name("img/final.elf")
humility/humility-core/src/hubris.rs: .by_name("img/final.elf")
humility/humility-core/src/hubris.rs: elf: slurp!("img/final.elf"),
management-gateway-service/gateway-sp-comms/src/single_sp/update.rs: "hubtools `image.to_binary()` DOES NOT MATCH `img/final.bin`",
management-gateway-service/gateway-sp-comms/src/single_sp/update.rs: "hubtools `image.to_binary()` DOES NOT MATCH `img/final.bin`",
management-gateway-service/gateway-sp-comms/src/single_sp/update.rs: if let Ok(final_bin) = archive.extract_file("img/final.bin")
management-gateway-service/gateway-sp-comms/src/single_sp/update.rs: if let Ok(final_bin) = archive.extract_file("img/final.bin") {
management-gateway-service/gateway-sp-comms/src/single_sp/update.rs: // would manually extract `img/final.bin` from the archive
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the archive accesses listed in facade/mfgtool/src/main.rs, hubris/master/build/xtask/src/dist.rs, humility/cmd/*, humility/humility-core/src/hubris.rs, and management-gateway-service/gateway-sp-comms/src/single_sp/update.rs. Identify archive-format knowledge that can move into hubtools, including the img/final.bin and img/final.elf consistency check; done means callers use centralized hubtools behavior without duplicated archive assumptions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100