Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Reference into a separate crate #159

Open
cgwalters opened this issue Aug 18, 2024 · 4 comments
Open

Split Reference into a separate crate #159

cgwalters opened this issue Aug 18, 2024 · 4 comments

Comments

@cgwalters
Copy link

cgwalters commented Aug 18, 2024

Hi, any opinion on splitting https://github.com/oras-project/rust-oci-client/blob/main/src/reference.rs into a separate crate ("oci-reference" e.g.)? It'd be a natural thing to use in https://github.com/containers/containers-image-proxy-rs which is a different way to fetch container images but wraps with a Rust API.

@cgwalters
Copy link
Author

Or actually, is there a reason this crate doesn't depend on https://github.com/containers/oci-spec-rs ? If it did then we could just move the reference type there, cc youki-dev/oci-spec-rs#205

@flavio
Copy link
Contributor

flavio commented Aug 29, 2024

I've been thinking about moving Reference to a dedicated crate. I've a couple of project that just need this portion of the whole oci-client crate.

I would be fine moving the code to oci-spec-rs too.

What do you think @thomastaylor312 ?

@thomastaylor312
Copy link
Contributor

This was already asked for in #102 and I am also completely fine with having the reference stuff be external from this crate. The main issue here is getting the time to do this. So I am completely on board with moving to the oci-spec-rs since it helps us avoid redefining types and makes things more unified. But it is going to be a major change that would also affect dependent projects. So we have to do the work to integrate oci-spec-rs into this repo, add the reference stuff into oci-spec-rs, and then cut a new release with a warning that the types are breaking.

I personally don't have time to do that in at least the next month, so if someone is willing to work on it, I'd be more than willing to review the PR and get it merged

cgwalters added a commit to cgwalters/oci-spec-rs that referenced this issue Aug 30, 2024
Almost all tools which operate with OCI will end up
wanting to parse and use proper references. Import
the code from the rust-oci-client crate.

I imported the code with history with this blog
which I found helpful:
https://savorywatt.com/2015/01/25/move-files-and-folders-between-git-repos-using-patches/

Changes:

- Move `regex.rs` code inline into this file
- Switch to std `LazyLock` instead of `lazy_static` crate

For more see:

- youki-dev#205
- oras-project/rust-oci-client#159

Signed-off-by: Colin Walters <[email protected]>
cgwalters added a commit to cgwalters/oci-spec-rs that referenced this issue Aug 30, 2024
Almost all tools which operate with OCI will end up
wanting to parse and use proper references. Import
the code from the rust-oci-client crate.

I imported the code with history with this blog
which I found helpful:
https://savorywatt.com/2015/01/25/move-files-and-folders-between-git-repos-using-patches/

Changes:

- Move `regex.rs` code inline into this file
- Switch to std `LazyLock` instead of `lazy_static` crate

For more see:

- youki-dev#205
- oras-project/rust-oci-client#159

Signed-off-by: Colin Walters <[email protected]>
@cgwalters
Copy link
Author

First step in youki-dev/oci-spec-rs#207

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

No branches or pull requests

3 participants