Erofs counterparts - #385
Conversation
3d7bfde to
fb0a740
Compare
cgwalters
left a comment
There was a problem hiding this comment.
Looks sane, though...I probably would have preferred exposing/reusing the existing APIs we already have to query images via varlink too, then we wouldn't need a new struct.
| } | ||
| } | ||
|
|
||
| /// Extension trait that adds OCI EROFS counterpart lookups to [`Repository`]. |
There was a problem hiding this comment.
Wait why can't this just be part of the existing oci interface
There was a problem hiding this comment.
I think it makes more sense to call this as repo.list_erofs_images. I'd've liked to had have this in the impl Repository itself, but that crate is stripped off of any oci features.
Also yeah, the can just be list_erofs_images(repo). I'll go with this since this matches the APIs we currently have
| /// | ||
| /// Returns an empty vec if `id` does not match any known EROFS | ||
| /// image ref in this image | ||
| pub fn linked_erofs_images(&self, id: &ObjectID) -> Vec<LinkedErofsImage<ObjectID>> { |
There was a problem hiding this comment.
From a type system perspective I think Option<Vec1<...>> would be cleaner (yes another crate, but it's well maintained)
There was a problem hiding this comment.
Or since this is somewhat specialized anyways, it could just be default_image_from_bootable(id) -> Option<id>...
There was a problem hiding this comment.
From a type system perspective I think Option<Vec1<...>> would be cleaner
Someone could use this api to query whether an OCI image is linked to an erofs image or not, so Vec1 would not work out here
There was a problem hiding this comment.
Hmmmm wait do we ever have a use case for not generating an erofs image for an OCI?
| pub xattr_mode: Option<XattrFiltering>, | ||
| } | ||
|
|
||
| impl<ObjectID: FsVerityHashValue> Serialize for LinkedErofsImage<ObjectID> { |
There was a problem hiding this comment.
why the manual Serialize impl?
There was a problem hiding this comment.
It's mainly for the CLI command output, and id's serialization is just raw bytes
Add an extension trait to Repository which contains a single fuction which receives an EROFS image's fsverity and returns the non-bootable counterpart if the passed in image was a bootable one and vice-versa. Traverses all oci image refs to find the image and its counterparts Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Generated by ClaudeCode Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
…tructs Return LinkedErofsImage structs (with id, bootable, version, xattr_mode) instead of raw ObjectIDs, and return all EROFS images linked to the same OCI image rather than only the opposite-category counterparts. Add has_erofs_id() and all_erofs_images() helpers on OciImage Assisted-By: Claude Code (Opus) Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Following the format of other oci APIs, convert this to a function that accepts a repository as a parameter Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
8819f99 to
a102ec6
Compare
Fix the following
```rust
error: using `chunks_exact` with a constant chunk size
--> crates/composefs-ostree/src/delta.rs:578:22
|
578 | .chunks_exact(OBJTYPE_CSUM_LEN)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `as_chunks` instead: `as_chunks::<OBJTYPE_CSUM_LEN>().0.iter()`
```
Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
Symlink .filez objects in ostree archive-z2 repos contain only the sized variant header with no compressed content after it. The code unconditionally wrapped the remaining file data in DeflateDecoder, which works on zlib-ng-compat (Fedora) but fails with "incomplete deflate stream" on standard zlib (Ubuntu CI) because an empty input is not a valid deflate stream. For LocalRepo, compare the header size against the file size and return an empty reader when there is no remaining data. For RemoteRepo, check the parsed header mode for symlinks and skip decompression entirely. Assisted-by: AI Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
|
Fixed some CI errors |
oci/repo: Add function to return EROFS counterparts
Add an extension trait to Repository which contains a single fuction
which receives an EROFS image's fsverity and returns the non-bootable
counterpart if the passed in image was a bootable one and vice-versa.
Traverses all oci image refs to find the image and its counterparts
cli: Add option to get erofs counterparts
Add tests for erofs-counterparts
This simplifies bootc-dev/bootc#2380