Break compatibility and depend on GExiv2 >= 0.16#30
Open
jmibanez wants to merge 2 commits into
Open
Conversation
GExiv2 0.15 breaks API/ABI compatibility[1] by effectively removing the gexiv_metadata methods that internally handled errors and replacing them with what used to be the *_try variants which expect callers to handle errors themselves. Because those variants have an additional argument **GError, calling the library without passing the last argument triggers a segfault when the library method attempts to deref garbage from the stack or register. Additionally, GExiv2 0.16 removed the actually-deprecated _free() functions (it's been marked deprecated since 0.10.3), with the expectation that callers are already using g_object_unref. However, we can't directly call g_object_unref from the gobject-sys FFI, since that depends on a different type than us. So, add the glue code here to still allow safely freeing GExiv2Metadata and GExiv2PreviewImage. Since we can't define FFIs with optional args, we need to bite the bullet and just add the extra arg in the relevant methods. To make sure this is restricted to only 0.16, enforce this when looking up gexiv2 from pkg-config. --- [1] https://gitlab.gnome.org/GNOME/gexiv2/-/commit/e05fa4a33ead95d56a5a63cec97d8ed6b1c9cecd [2] https://gitlab.gnome.org/GNOME/gexiv2/-/commit/560c9223bf9244823e7d120053d6e87668005623
GExiv2 0.16 actually installs the pkg-config file `gexiv2-0.16.pc` which means that it actually names itself `gexiv2-0.16`. So, probe for it explicitly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GExiv2 0.15 breaks API/ABI compatibility[1] by effectively removing the
gexiv_metadatamethods that internally handled errors and replacing them with what used to be the*_tryvariants which expect callers to handle errors themselves. Because those variants have an additional argument**GError, calling the library without passing the last argument triggers a segfault when the library method attempts to deref garbage from the stack or register.Additionally, GExiv2 0.16 removed the actually-deprecated
_free()functions (it's been marked deprecated since 0.10.3), with the expectation that callers are already usingg_object_unref. However, we can't directly callg_object_unreffrom the gobject-sys FFI, since that depends on a different type than us. So, add the glue code here to still allow safely freeingGExiv2MetadataandGExiv2PreviewImage.Since we can't define FFIs with optional args, we need to bite the bullet and just add the extra arg in the relevant methods. To make sure this is restricted to only 0.16, enforce this when looking up gexiv2 from pkg-config.
This is a breaking ABI change. I'm not sure if you'd like to bump the MV for the project (i.e. to publish this PR in gexiv-sys 2.0), so opening the PR for discussion.
[1] https://gitlab.gnome.org/GNOME/gexiv2/-/commit/e05fa4a33ead95d56a5a63cec97d8ed6b1c9cecd
[2] https://gitlab.gnome.org/GNOME/gexiv2/-/commit/560c9223bf9244823e7d120053d6e87668005623