Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

pcre2: publish the Unicode regex dependency root - #37

Merged
brandonpayton merged 5 commits into
mainfrom
migrate/pcre2-dependency-root
Jul 12, 2026
Merged

pcre2: publish the Unicode regex dependency root#37
brandonpayton merged 5 commits into
mainfrom
migrate/pcre2-dependency-root

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Jul 11, 2026

Copy link
Copy Markdown
Member

Purpose

Replace the source-only registry entry with a first-class Kandelo Homebrew PCRE2 10.44 formula.

The formula builds through the normal Kandelo SDK and publishes the actual development and tool surface: 8-, 16-, and 32-bit static libraries, the POSIX wrapper, public headers, pkg-config metadata, pcre2-config, pcre2grep, and pcre2test.

Registry reconciliation

packages/registry/pcre2-source/package.toml is authoritative for:

The downloaded source archive matches that digest. The Homebrew package is named pcre2 because it now publishes built, consumer-visible artifacts rather than an unpacked source cache.

Formula contract

  • wasm32 scope is explicit.
  • Builds static libpcre2-8, libpcre2-16, libpcre2-32, and libpcre2-posix.
  • Installs pcre2.h, pcre2posix.h, all four upstream pkg-config files, and pcre2-config.
  • Rewrites installed consumer metadata from the versioned Cellar staging path to the stable opt prefix.
  • Builds pcre2grep and pcre2test with Unicode/UTF/UCP and full pcre2grep fork/exec callouts.
  • Disables JIT because native executable-memory code generation is not a WebAssembly capability.
  • Keeps optional zlib/bzip2 compressed-input support out of this first dependency-free target contract. Tap main does not yet publish the libbz2 header/static-library surface; compression: publish linkable bzip2 and xz libraries #25 can support a separate follow-up.
  • Declares pkgconf for both build and test, with WABT and Binaryen as build tools.
  • Fork-instruments pcre2grep and rejects ABI mismatch, Asyncify residue, missing fork exports, or an unexpected uninstrumented fork import before installation.
  • Treats /bin/sh as Kandelo base-system state supplied by dash, not a formula dependency.

Platform and bottle gates

The source formula may merge independently after formula review. Bottle construction and publication must wait until the applicable platform gates are green:

The pthread fork-continuation fix and ABI 18 transition from #867 are merged.

The deterministic-instrumentation gate is fully isolated. Immutable uninstrumented pcre2grep input SHA-256 6d3a835bf6cca612c4b722c8b60291e30f07b51bf51eaf6288c355efbf6592bb and exact instrumenter SHA-256 4f25fdc47f546ded0b042ceff337ac976bd456fbaa42df973eeb8bd258f064d4 produced two same-size outputs:

  • 3f15de738b73ee63ab5e898804ae02ae5ad3b78e3fdb9cdad47c67ad20e10667
  • effdff934a21c79107332ebb6b572793af2ad84e4d5884d4fe1567b703c2dea8

The specific cause is crates/fork-instrument/src/instrument.rs in instrument_one_function_nested_switch: iterating the regions HashMap keys while building pending carryover plans randomizes subsequent module.locals.add allocation order. That changes only synthetic local indices in the Code section. Section sizes, function/export/data/name ordering, and normalized instructions are identical. Sorting that allocation loop made two outputs byte-identical in an isolated proof; sorting only the later body-parameter loop did not.

No formula workaround or bottle hash is proposed. #888 fixes the tool at its allocation-order root cause; CI must rebuild this formula after that platform change lands and the remaining publisher gates are green.

Validation

Functional validation used scripts/dev-shell.sh, ABI 18 platform artifacts, the #882 ABI parser, and exact formula head 40ad3b52e47a7e44125e31a9a070c49beb573404. The branch was then rebased semantic-preservingly onto current tap main at adb2364. Commit 11d291f subsequently changed only shared-support loading and the pkgconf test dependency; the four artifact-producing commits retain identical stable patch IDs and artifact logic:

  • Exact-head source reinstall passed: 229 installed files, 6.1 MB.
  • Exact-head brew test passed.
  • Node: pcre2grep/pcre2test feature reporting, UTF-8 Unicode property matching, fork/exec callout through /bin/sh, stable pkg-config output, and linked 8/POSIX, 16, and 32-bit consumers passed.
  • Chromium: the linked PCRE2/POSIX consumer, Unicode pcre2grep behavior, and fork/exec callout passed with exact expected output.
  • Final executable audit: ABI 18; imports only from env and kernel; no Asyncify. pcre2grep has all five fork exports; pcre2test has no fork instrumentation requirement.
  • One exact-head local artifact instance: pcre2grep SHA-256 cd92b403c5cb1289b0caf9810ec61f02b964405d55639e01384289baa937cf0e; pcre2test SHA-256 6c4968b2393298439628c7c11378f74a37daa9e843d3fc76f67ee9ebb6c3c48c. These are validation evidence, not publishable bottle hashes while determinism is gated.
  • Current tap formula-support tests: 21 runs, 186 assertions.
  • homebrew-validate: passed for the unchanged checked sidecar set.
  • brew audit --strict: passed.
  • brew style: no offenses.
  • Ruby syntax and git diff --check: passed.
  • Post-rebase brew style, Homebrew Ruby syntax, formula-support tests, and git diff --check: passed.
  • At 11d291f, Homebrew Ruby syntax, brew style, a literal formula load through Tap.fetch, formula-support tests (21 runs, 186 assertions), and git diff --check passed through Kandelo's dev shell.

No bottle block or PCRE2 sidecar is included.

@brandonpayton
brandonpayton force-pushed the migrate/pcre2-dependency-root branch from 40ad3b5 to adb2364 Compare July 11, 2026 23:09
@brandonpayton
brandonpayton merged commit 306d727 into main Jul 12, 2026
@brandonpayton
brandonpayton deleted the migrate/pcre2-dependency-root branch July 15, 2026 00:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant