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
Fix annotations on ostree_mutable_tree_lookup() #2620
Conversation
(nullable) and (optional) were missing on lookup()'s out parameters, which caused the rust bindings for the function to not work. Due to the missing (nullable), it would return a Result<(GString, MutableTree), _>, not a Result<(Option<GString>, Option<MutableTree>), _>, which led to panics.
Hi @jameswestman. Thanks for your PR. I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/approve |
Thanks for the PR! Could you maybe share a reproducer or a backtrace from the panics you are seeing? While you reasoning seems right to me, looking into the logic of |
Based on the if statement on line 423, it seems that the function returns one or the other, but never both. Here is the backtrace:
|
You are right, I now see what you mean, I misread the logic. ostree/src/libostree/ostree-mutable-tree.c Lines 402 to 435 in 00e39eb
Thanks for the patch, LGTM! |
So one thing we can suddenly start doing is actually updating the Rust bindings in the same PR that changes the annotations...but it's fine not to do it, I'll look at a followup PR. |
(nullable) and (optional) were missing on lookup()'s out parameters, which caused the rust bindings for the function to not work. Due to the missing (nullable), it would return a
Result<(GString, MutableTree), _>
, not aResult<(Option<GString>, Option<MutableTree>), _>
, which led to panics.