Skip to content

feat(iqa): add LLAR formula - #147

Open
MeteorsLiu wants to merge 1 commit into
xgo-dev:mainfrom
MeteorsLiu:issue/91-iqa
Open

feat(iqa): add LLAR formula#147
MeteorsLiu wants to merge 1 commit into
xgo-dev:mainfrom
MeteorsLiu:issue/91-iqa

Conversation

@MeteorsLiu

Copy link
Copy Markdown
Collaborator

Summary

  • add a Formula for tjdistler/iqa at source commit 0559a8ff2acd9746864975834d35be6892cc9801
  • mirror the Conan Center CMake build, shared/fPIC defaults, license install, and Linux math dependency
  • add an installed-header/library consumer check based on the CCI test package

Source evidence: Conan Center cci.20181227 recipe pins tjdistler/iqa commit 0559a8ff2acd9746864975834d35be6892cc9801 (SHA-256 394e549585c10eb618c918d47961e5d4ed596c20e8c9745fad9e0829ce254c25).

Validation: git diff --check.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +80 to +81
licenseEnd := strings.index(license, "*/")
license = strings.trimSpace(license[:licenseEnd])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Comment on lines +137 to +138
os.setenv("LD_LIBRARY_PATH", filepath.join(installDir, "lib"))!
os.setenv("DYLD_LIBRARY_PATH", filepath.join(installDir, "lib"))!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Comment on lines +98 to +100
if osName == "linux" {
flags <- "-lm"
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Comment on lines +42 to +45
defaults {
"shared": "OFF",
"fPIC": "ON",
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant