-
Notifications
You must be signed in to change notification settings - Fork 346
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
Investigate to use thiserror
in our crates
#1377
Comments
@chermehdi I'm happy if you have interested in this issue. But this issue is not easy and take a lof of time to achieve better than other good first issues. |
Sounds good, let us do them in that order, the first one should give us a pretty good idea about how will the others look like, and how much effort is required as well. |
@chermehdi That's right, libcontainer is going to be quite large task, so if there is a way to make it divisible that would be nice too. May I assign you? There is no deadline, etc. Of course, I can help you whenever. |
@utam0k yeah sounds good, just assing me. |
@utam0k |
Ops, sorry. You don't need to take it. Let's look into libcgroups. |
@utam0k Where do we want to use thiserror? I suggest to minimize the changes we only introduce thiserror usage right at the edge of the library and keep error handling internally using anyhow/context. this will minimize the number of changes we have to make. Another thing that I want us to think about is what is our API boundary, and how we want this to be used as a library.
|
@chermehdi Sorry for the late reply. 💯
Ideally, yes. Once this is possible, it can be spun out and offered like containers/oci-spec-rs.
|
Has there been any progress on this? If not, I'd be happy to help! |
👋 Hi, @squili. Unfortunately, we don't have any progress. I would like to introduce thiserror with libcgroup and libcontainer. Are you interested? |
Sure, I'd love to help with that! |
Which crate would you like to choose? |
Looks like libcgroup needs to be first, since it's a dependency of libcontainer |
@squili |
@chermehdi If you have made any progress, please let me know. I know you are probably very busy. |
Here's the current plan:
|
@squili Do you want to create a feature branch? |
I can make a branch on a fork and PR |
Finished work for libcgroups, ready to review! It still uses anyhow in tests because it's useful for tests, but it's been removed as a dependency for everything else. |
Here we go.
At the top level, we should have a concrete error type in Finally
@squili Let's just leave a note in this thread to coordinate :) |
@yihuaf ill make sure to leave a note for the things i work on! though im going through a few things right now so it may be a bit |
I plan on to work on these today: apparmor |
Introduction
Now we are using
anyhow
everywhere. But It would be better to provide some codes as crates(e.g. libcontainer, libcgroup...). Their crates in their current state are not very user-friendly of error handling.Goal
Investigate and implement to use of
thiserror
instead ofanyhow
in cratesTracking
Let's do the following order because of the number of codes.
liboci-cliWe don't need useanyhow
in itthiserror
for libcgroups #1872thiserror
for libcontainer - Part 1 #1876thiserror
for libcontainer (Part 2) #1881thiserror
for libcontainer - Part 3 #1895thiserror
for libcontainer - Part 4 #1912anyhow
Finally, removeanyhow
from the libcontainer dependency. #1937The text was updated successfully, but these errors were encountered: