meson: make zip container support optional - #299
Draft
igoropaniuk wants to merge 1 commit into
Draft
Conversation
qdl unconditionally links against libzip, although zip archives are just one of the supported input formats: both the flash-from-zip path and the create-zip subcommand are conveniences on top of the plain contents.xml / flashmap.json flows. That unconditional dependency gets in the way of integrating qdl into minimal embedded distributions. In Yocto, for example, libzip lives in meta-openembedded rather than oe-core, so packaging qdl means pulling in a whole extra layer for a feature many products never use. Introduce a zip-container feature option (default auto) and gate all libzip-backed code on it: - move the libzip implementation out of file.c into file_zip.c, which is only compiled when the feature is enabled; file.c keeps the plain POSIX file handling and dispatches through small helpers that turn into inert stubs in file.h otherwise - provide no-zip fallbacks of qdl_zip_open/get/put where open reports "not a zip archive", so the contents.xml and flashmap.json flows work unchanged; these remain real symbols rather than inline stubs because the unit tests replace them with mock definitions - build zipper.c only with the feature and stub out zipper_write(), with create-zip and a failed flash of a zip archive reporting that this qdl was built without zip-container support Signed-off-by: Igor Opaniuk <igor.opaniuk@oss.qualcomm.com>
Member
|
Can we make this an explicit opt-out instead of relying on library autodetection? I fear this may be easily overlooked and lead to not-fully-featured builds landing in distros |
Contributor
Author
Makes sense, will fix, thanks! |
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.
qdl unconditionally links against libzip, although zip archives are just one of the supported input formats: both the flash-from-zip path and the create-zip subcommand are conveniences on top of the plain contents.xml / flashmap.json flows.
That unconditional dependency gets in the way of integrating qdl into minimal embedded distributions. In Yocto, for example, libzip lives in meta-openembedded rather than oe-core, so packaging qdl means pulling in a whole extra layer for a feature many products never use.
Introduce a zip-container feature option (default auto) and gate all libzip-backed code on it: