Skip to content

Conversation

@cgwalters
Copy link
Collaborator

No description provided.

@cgwalters cgwalters requested a review from Copilot April 4, 2025 12:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Copy link
Contributor

@allisonkarlitskaya allisonkarlitskaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for turning this into a PR!

This is fine by me, but I wonder if it violates the original purpose of the check that you mentioned in #71 (ie: we don't want to allow the client to successfully read to EOF if we have a checksum error about to be reported)...

///
/// The requested size and digest are verified (by the proxy process).
///
/// Note that because of the implementation details of this function, you should
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the docs here, btw.

@cgwalters
Copy link
Collaborator Author

(ie: we don't want to allow the client to successfully read to EOF if we have a checksum error about to be reported)...

Yeah, it's a fair point! At least today you'd have to explicitly drop the driver future on the floor to run into this problem. If you don't drop the driver future but don't ? on it then you'll get a warning.

I think the most elegant thing here would actually be to return a new struct that just impl BufRead but also has a finish() method that's required to be called?

A related option is to make the reader only start returning data once the driver has been polled once - that would pretty strictly enforce the use of join!.

@allisonkarlitskaya
Copy link
Contributor

...starts to sound like the linear types discussion all over again.

I honestly think the best case scenario here might be to try to plumb the checksum failure through the reader API. You objected to that last time we talked about it, I think, but it would completely avoid the need for a separate driver object...

It's possible to attach arbitrary additional errors objects to stdlib results...

@cgwalters
Copy link
Collaborator Author

I wouldn't object at all support to moving the checking into the reader, it's not unusual to wedge things like this into std::io::ErrorKind::Other I guess.

Though there's another option of offering a GetBlobUnverified that allows the caller to do checksumming instead.

@allisonkarlitskaya
Copy link
Contributor

composefs-rs does the checksum of the uncompressed data only, which is the only thing that's important to us... In fact, I think we completely discard the manifest at present.

This is confusing for sure.

Closes: bootc-dev#71
Signed-off-by: Colin Walters <[email protected]>
@cgwalters
Copy link
Collaborator Author

OK for now I changed this to just document things.

@cgwalters cgwalters merged commit 8327958 into bootc-dev:main Apr 8, 2025
2 checks passed
@allisonkarlitskaya
Copy link
Contributor

Hopefully I/we don't forget about this one again ;)

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