Add ebiggers/libdeflate Formula (v1.22, v1.25) - #114
Open
fennoai[bot] wants to merge 1 commit into
Open
Conversation
Translate the Conan Center libdeflate recipe into an idiomatic LLAR Formula. One Formula (fromVer "v1.22") serves both v1.22 and v1.25, whose upstream CMake build, options, and installed interface are identical. - onBuild uses the CMake helper to build a single linkage selected by the `shared` option (default OFF -> static), with LIBDEFLATE_BUILD_GZIP and LIBDEFLATE_BUILD_TESTS off, matching the Conan package intent. Install layout is pinned to lib/ so the library, headers, and pkg-config file land where consumers expect them. - Consumer metadata (-I.../include -L.../lib -ldeflate) mirrors the installed libdeflate.pc. - onTest compiles and runs a small C consumer (allocate/free a compressor, as in the Conan test_package) against the installed output, in a build tree independent of onBuild so it also passes on a cache hit. - versions.json declares no dependencies; upstream libdeflate has none. The Conan `fPIC` option is dropped: libdeflate has no PIC build switch and the choice does not change the installed interface, metadata, or dependencies. Co-authored-by: fennoai[bot] <231223108+fennoai[bot]@users.noreply.github.com> Co-authored-by: MeteorsLiu <17515813+MeteorsLiu@users.noreply.github.com>
Author
There was a problem hiding this comment.
Review: ebiggers/libdeflate Formula (v1.22, v1.25)
No blocking issues found. The Formula follows the LLAR reference conventions and the existing madler/zlib example, and the upstream facts it relies on were verified against ebiggers/libdeflate v1.22:
- CMake option names (
LIBDEFLATE_BUILD_STATIC_LIB,LIBDEFLATE_BUILD_SHARED_LIB,LIBDEFLATE_BUILD_GZIP,LIBDEFLATE_BUILD_TESTS) exist and are used correctly; upstream usesGNUInstallDirs/CMAKE_INSTALL_LIBDIR. - The installed
libdeflate.pcgeneratesCflags: -I${includedir}andLibs: -L${libdir} -ldeflate, matching the manually-emitted metadata (-I.../include -L.../lib -ldeflate). consumer.cuses the correct signatures —libdeflate_alloc_compressor(int)/libdeflate_free_compressor(ptr)with<libdeflate.h>; level12is the valid maximum.- Layout/naming rules hold: class stem
Libdeflate,versions.json.path==id== directory,fromVer "v1.22"literal, emptydeps {}is correct (libdeflate has no library dependencies). - Error handling,
filter,defaults, and the cache-safeonTest(separate build tree, shippedconsumer.c, no metadata mutation) all match the reference.
Security and performance passes returned no findings — exec uses the explicit-argument form (no shell), and exactly one linkage is built per shared selection.
Minor (optional, non-blocking)
ebiggers/libdeflate/v1.22/Libdeflate_llar.gox— the emitted metadata's correctness silently depends on theCMAKE_INSTALL_LIBDIR "lib"pin (c.define "CMAKE_INSTALL_LIBDIR", "lib") and onincludedir=include. ThesetMetadatastring hardcodes.../liband.../include. This is adequately documented by the surrounding comments; a future edit that changes the libdir pin without updating the metadata line would silently break consumers. Consider a one-line cross-reference between the two lines to guard against that. (The comment's claim that LLAR's artifact encoder rewrites the absolute prefix into a portable form is consistent with the LLAR reference, so the absolute path in metadata is expected, not a defect.)
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.
Closes #13.
Translates the Conan Center
libdeflaterecipe into an idiomatic LLAR Formula forebiggers/libdeflate, covering source tagsv1.22andv1.25.Files
ebiggers/libdeflate/versions.json— module path, no dependencies (upstream libdeflate has none).ebiggers/libdeflate/v1.22/Libdeflate_llar.gox— the Formula (fromVer "v1.22").ebiggers/libdeflate/v1.22/consumer.c— theonTestconsumer.Design
v1.22andv1.25share the same CMake build, options, install layout, and public interface (verified against upstream at both tags), so a singlefromVer "v1.22"Formula serves both.onBuild). Uses the CMake helper to build exactly one linkage selected by thesharedoption, withLIBDEFLATE_BUILD_GZIP=OFFandLIBDEFLATE_BUILD_TESTS=OFF— preserving the Conan package intent (library only, no gzip program, no test suite). The install layout is pinned tolib/(CMAKE_INSTALL_LIBDIR=lib, honored by upstream viaGNUInstallDirs) so headers, the library, and the pkg-config file land where consumers and LLAR'susehelper expect them.shared(defaultOFF→ static) is retained; it is the sole Conan option that changes the installed library. The ConanfPICoption is intentionally dropped — libdeflate has no PIC build switch, always builds its shared library position-independent, and the static-library PIC choice changes neither the installed interface, the metadata, nor dependency resolution.-I<prefix>/include -L<prefix>/lib -ldeflate, mirroring the installedlibdeflate.pc(Cflags: -I${includedir},Libs: -L${libdir} -ldeflate).onTest). Compiles and runs a small C consumer that allocates and frees a compressor (matching the Conantest_package.c) against the installed output, in a build tree independent of theonBuildscratch tree so it also passes on a cache hit.Validation
Built
llarfromgoplus/llar@mainand ran, onlinux/amd64:llar test -v ./ebiggers/libdeflate@v1.22— fresh build + test: pass; cache-hit test: pass.llar test -v ./ebiggers/libdeflate@v1.25— fresh build + test: pass; cache-hit test: pass.onTestgenuinely compiles/links/runs the consumer (a deliberately broken consumer producedonTest failed ... exit status 1, then reverted).sharedmapping by building libdeflate shared from source and running the same consumer against it.Only the module files for
ebiggers/libdeflateare added — no generic Conan importer and no changes to the Formula skill.