feat(iqa): add LLAR formula - #147
Conversation
There was a problem hiding this comment.
FennoAI Review — tjdistler/iqa formula
Nice, well-structured formula. It correctly injects a CMakeLists for an upstream that ships none, handles the shared/static + fPIC option matrix, mirrors consumer flags between onBuild metadata and onTest, and re-derives flags from installDir so the test still works on a cache hit. The consumer test (math_utils.h / _max) is valid — both are installed public symbols of iqa.
A few things worth addressing, the license-parsing guard being the most important. Findings are inline.
| licenseEnd := strings.index(license, "*/") | ||
| license = strings.trimSpace(license[:licenseEnd]) |
There was a problem hiding this comment.
[P1] License parse can slice with a negative index when */ is absent
strings.index(license, "*/") returns -1 if iqa.h has no */ sequence, and license[:licenseEnd] then becomes license[:-1] — a negative-bound slice that panics (or silently corrupts the LICENSE). Unlike the sibling formulas (cglm/json-c), which derive license/flags from stable build artifacts, this parses raw header text without a guard. Add a check: if licenseEnd < 0, fail with a clear error rather than slicing.
Minor, in the same block: the * prefix strip on line 83 only matches the exact \n * sequence, so blank comment lines written as \n * (no trailing space) keep their prefix, and after removing /* the result begins with a leading blank line. A final strings.trimSpace would clean that up.
| os.setenv("LD_LIBRARY_PATH", filepath.join(installDir, "lib"))! | ||
| os.setenv("DYLD_LIBRARY_PATH", filepath.join(installDir, "lib"))! |
There was a problem hiding this comment.
[P2] LD_LIBRARY_PATH/DYLD_LIBRARY_PATH overwritten, not prepended
The Windows branch prepends to the existing PATH, but the non-Windows branch replaces LD_LIBRARY_PATH/DYLD_LIBRARY_PATH wholesale, discarding any loader paths already in the test environment. This is inconsistent with the Windows handling in the same block and can drop paths the runtime needs. Prepend instead, e.g. filepath.join(installDir, "lib") + ":" + os.getenv("LD_LIBRARY_PATH"), to match the Windows branch.
| if osName == "linux" { | ||
| flags <- "-lm" | ||
| } |
There was a problem hiding this comment.
[P2] -lm gated on Linux only — omitted for macOS/other Unix
-lm is added to the published metadata only when osName == "linux". iqa uses <math.h>/math routines, so a static consumer on macOS or other Unix that needs libm will get metadata missing -lm. Compare cglm, which documents -lm "on Linux/FreeBSD". Consider broadening the condition to non-Windows (or the specific Unix targets you support) — and the same gate at line 125 in onTest should match. If Linux is genuinely the only supported target, a short comment saying so would make the choice clear.
| defaults { | ||
| "shared": "OFF", | ||
| "fPIC": "ON", | ||
| } |
There was a problem hiding this comment.
[P3] Missing build-contract / options documentation vs sibling formulas
The sibling formulas (Cglm_llar.gox, Jsonc_llar.gox) open with a comment describing the build contract, options, and non-obvious choices. This formula has none. Worth documenting, since several things here are reviewer-relevant and non-obvious: (1) upstream ships no CMakeLists so this formula injects one and globs source/*.c / include/*.h; (2) the shared/fPIC options and why fPIC only applies to static builds (the if !shared guard at lines 72-74); (3) that the license is scraped from the iqa.h header comment. A short header comment block covering these would bring it in line with the repo convention.
| } | ||
| ` | ||
|
|
||
| id "tjdistler/iqa" |
There was a problem hiding this comment.
[P3] Filename iqa_llar.gox differs from PascalCase siblings
Sibling formulas use a capitalized project prefix: Cglm_llar.gox, Jsonc_llar.gox, Zlib_llar.gox. This file is lowercase iqa_llar.gox. If the loader is case-sensitive about the prefix, rename to Iqa_llar.gox for consistency; otherwise confirm lowercase is accepted.
Summary
tjdistler/iqaat source commit0559a8ff2acd9746864975834d35be6892cc9801Source evidence: Conan Center
cci.20181227recipe pinstjdistler/iqacommit0559a8ff2acd9746864975834d35be6892cc9801(SHA-256394e549585c10eb618c918d47961e5d4ed596c20e8c9745fad9e0829ce254c25).Validation:
git diff --check.