Skip to content

feat(JuliaStrings/utf8proc): add utf8proc v2.9.0 LLAR formula - #118

Open
fennoai[bot] wants to merge 1 commit into
mainfrom
fennoai/issue-22-1785407797
Open

feat(JuliaStrings/utf8proc): add utf8proc v2.9.0 LLAR formula#118
fennoai[bot] wants to merge 1 commit into
mainfrom
fennoai/issue-22-1785407797

Conversation

@fennoai

@fennoai fennoai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Closes #22.

Translates the Conan Center utf8proc recipe (snapshot ffe30df1, version 2.9.0) into an idiomatic LLAR Formula for JuliaStrings/utf8proc.

Files

  • JuliaStrings/utf8proc/versions.json — no dependencies (utf8proc is a self-contained single-file C library; upstream v2.9.0 declares no third-party requirements).
  • JuliaStrings/utf8proc/Utf8proc_cmp.gox — semver comparator for the leading-v release tags.
  • JuliaStrings/utf8proc/v2.9.0/Utf8proc_llar.gox:
    • onBuild uses the CMake helper to build the static archive (the upstream and Conan default). Pins CMAKE_POLICY_VERSION_MINIMUM=3.5 and CMAKE_POLICY_DEFAULT_CMP0042=NEW exactly as the recipe does for pre-2.10.0 releases, CMAKE_POSITION_INDEPENDENT_CODE=ON to match Conan's default fPIC=True, and UTF8PROC_ENABLE_TESTING=OFF to keep the build hermetic.
    • Metadata is derived from the installed libutf8proc.pc via pkg-config, plus -DUTF8PROC_STATIC to mirror the Conan static package_info branch.
    • onTest compiles and runs a consumer modelled on the Conan test_package (utf8proc_version / utf8proc_unicode_version) in a build tree independent of the onBuild scratch dir, so it also passes on a cache hit.

Version boundary

fromVer is pinned to v2.9.0. The earlier versions served by the same Conan folder (e.g. v2.5.0) use a lower CMake floor (2.8.12) and do not install a pkg-config file, so their build contract differs and is not verified here. A lower threshold should be added only after those revisions are inspected and tested — per the translation guidance to add a threshold rather than claim an unverified range.

Notes on options

The Conan shared/fPIC options were reviewed. In the current llar, matrix --option overrides propagate to the cache key/install path but are not injected into the formula body (target.options only ever reflects defaults, and there is no public accessor for the matrix string). Rather than expose a shared toggle that would silently always build static, this formula builds the static default (matching Conan shared=False) and documents fPIC=True behavior directly. A shared option can be added once option selection reaches onBuild.

Validation

Built llar from source and ran on linux/amd64:

llar test -v ./JuliaStrings/utf8proc@v2.9.0     # cache-miss: PASS
llar test    ./JuliaStrings/utf8proc@v2.9.0     # cache-hit (onBuild skipped, onTest runs): PASS
llar test --os linux --arch amd64 ./JuliaStrings/utf8proc@v2.9.0   # PASS
llar make --json ./JuliaStrings/utf8proc@v2.9.0

The install produces include/utf8proc.h, lib/libutf8proc.a, and lib/pkgconfig/libutf8proc.pc; the consumer prints utf8proc version: 2.9.0 and Unicode version: 15.1.0. No system libutf8proc is present, confirming the test links the freshly built artifact.

Translate the Conan Center utf8proc recipe (snapshot
ffe30df101afd4dc95aac2f14b25bf345e64d7be, version 2.9.0) into an
idiomatic LLAR Formula for JuliaStrings/utf8proc.

- versions.json: no dependencies (utf8proc is a self-contained C library;
  upstream v2.9.0 declares no third-party requirements).
- Utf8proc_cmp.gox: semver comparator for the leading-"v" release tags.
- v2.9.0/Utf8proc_llar.gox:
  - onBuild uses the CMake helper to build the static archive (the upstream
    and Conan default), pinning CMAKE_POLICY_VERSION_MINIMUM=3.5 and
    CMAKE_POLICY_DEFAULT_CMP0042=NEW as the recipe does for pre-2.10.0, with
    fPIC on to match Conan's default and testing off to stay hermetic.
  - Metadata is derived from the installed libutf8proc.pc via pkg-config,
    plus -DUTF8PROC_STATIC to mirror the Conan static package_info branch.
  - onTest compiles and runs a consumer modelled on the Conan test_package
    (utf8proc_version / utf8proc_unicode_version) in a build tree independent
    of the onBuild scratch dir, so it also passes on a cache hit.

fromVer is pinned to v2.9.0: the earlier recipe versions (e.g. v2.5.0) use a
different CMake floor and do not install a pkg-config file, so their build
contract is not verified here. Add a lower threshold once those are checked.

Verified with `llar test` (cache-miss and cache-hit) and `llar make --json`
on linux/amd64: static lib, header, and libutf8proc.pc install; the consumer
prints utf8proc 2.9.0 / Unicode 15.1.0.

Co-authored-by: fennoai[bot] <231223108+fennoai[bot]@users.noreply.github.com>
Co-authored-by: MeteorsLiu <17515813+MeteorsLiu@users.noreply.github.com>

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Review summary

This PR adds a new JuliaStrings/utf8proc formula (build + test + semver comparator) and refactors madler/zlib onto the current single-context Formula API. The zlib refactor, the _cmp.gox, versions.json, and the large docs/skill extraction all look correct and internally consistent (mirrored .claude/.agents copies match, internal links resolve, docs describe the new API rather than the removed error-return surface).

One important correctness issue in the utf8proc onBuild metadata step, plus one minor robustness note — both inline.

Non-blocking observations (no change required):

  • onTest recompiles the C consumer on every run including cache hits. This is intentional per the inline comment (cache-hit/cache-miss parity) and the compile is tiny; noted only for awareness.
  • SKILL.md frontmatter differs between the .claude (has argument-hint/allowed-tools) and .agents copies. Likely deliberate since .agents uses agents/openai.yaml for interface metadata — worth a quick confirm.

Findings without inline locations

  • JuliaStrings/utf8proc/v2.9.0/Utf8proc_llar.gox:86: Minor robustness: this line uses sh -c only to run a fixed binary with no shell features. Invoking it directly with exec "'" ... is unnecessary — exec bin would run the binary without a shell round-trip and sidesteps the single-quote escaping concern entirely (single-quoting protects against a | in the matrix suffix but not an embedded ' in the path). Not exploitable given these are trusted sandbox paths; purely a cleanliness/robustness note.

// the Conan package_info static branch.
meta = strings.trimSpace(meta + " -DUTF8PROC_STATIC")
ctx.setMetadata meta
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Missing lastErr check before reading output. After a capout block, the reference convention requires validating the command result (if lastErr != nil { panic lastErr }) before consuming output — the onTest sections below do exactly this, and so does the reference's complete example.

Here, if pkg-config fails (missing .pc, wrong name, or not installed), the hook does not error: output is empty/stale, so metadata is silently set to just -DUTF8PROC_STATIC, producing an install with broken consumer link/compile flags instead of a clear build failure.

capout => {
    exec "pkg-config", "--libs", "--cflags", "libutf8proc"
}
if lastErr != nil {
    panic lastErr
}
meta := strings.trimSpace(output)

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.

Translate Conan Center utf8proc recipe to LLAR

0 participants