Skip to content

omarchy-mlx: refuse a mismatched ANE asset pin at package time - #891

Open
joshuaswarren wants to merge 2 commits into
omacom:masterfrom
joshuaswarren:mac/ane-pin-package-fail
Open

joshuaswarren wants to merge 2 commits into
omacom:masterfrom
joshuaswarren:mac/ane-pin-package-fail

Conversation

@joshuaswarren

@joshuaswarren joshuaswarren commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Correction (2026-10-09, after the jwm1 install)

The first version of this description said the foreign bytes came from makepkg --nocheck skipping check().
That was wrong. makepkg's strip step runs after package() and rewrites the two pinned ANE files in the wheel
(libane-strict.so 71456 -> 67728 B, mlx-omarchy-ane-worker 161744 -> 134552 B); strip --strip-unneeded on the
wheel's files reproduces the shipped bytes. A normal makepkg run WITH check() made the wrong package too. The fix is
options=(... '!strip') (added in this PR). The package() pin check stays: it catches a stage that something swapped
before packaging, but it runs before the strip step and cannot see the strip.

Problem

jwm1 ran omarchy-mlx 0.7.22-1 built locally with makepkg --nocheck. The package shipped libane-strict.so sha256 6e20168d4924689a6e70cca51098713ca25330c3aa2db62fe29d26942889e812 (67728 B) and mlx-omarchy-ane-worker e45701b0… (134552 B), while the pin json in the same package (parakeet-runtime-pin.json, sha 827464321d…) demands libane d06222a86f3bff26aaf1cec1223ade32f27cad84b994dccb1af9cca965a7da8c (71456 B), the size the release wheels ship. pacman -Qkk reported 0 altered files: the package itself carried the foreign bytes. The same failure class hit 0.7.10-1 on 2026-10-01.

The recipe ran verify_runtime_assets.py only in check(). makepkg --nocheck skips check(), so nothing failed the build.

Change

package_omarchy-mlx() now runs the same stdlib-only checker on the staged venv share tree BEFORE the stage is copied into $pkgdir. A stage that does not match its own pin cannot become a package, with or without --nocheck. check() keeps its call.

Negative control

Simulated package_omarchy-mlx() by sourcing this PKGBUILD against a fake $srcdir holding the extracted v0.7.22 and v0.7.31 release share trees (no full Mesa build):

  • clean trees: checker OK, package step exits 0 (both versions)
  • one flipped byte in libane-strict.so: package step exits 1 with expected/actual digests — this is the --nocheck path, and it now fails

Pin coverage gap (reported, not fixed here)

The pin schema covers bundles/ and libane/ only. It has no worker entry, so a swapped mlx-omarchy-ane-worker still passes this check (jwm1's worker was foreign too); the worker seal refuses it at first use. Extending the schema belongs in joshuaswarren/omarchy-mlx (schema + checker + release).

No install hook

No post_install/post_upgrade pin check here: the package-time gate stops the defect class at the source; post-install drift is caught by pacman -Qkk and the worker's runtime seal. If a warning-only post_upgrade tripwire is wanted, it can fold into the omarchy-mlx.install that #839 adds (that file currently carries the udev hook only).

Order

Either order is safe: this PR touches only package_omarchy-mlx() in the PKGBUILD; #839 touches the header (version, sums) and adds omarchy-mlx.install. No hunks overlap.

makepkg --nocheck skips check(), which is the only place the recipe ran
verify_runtime_assets.py; the local 0.7.10-1 and 0.7.22-1 builds on jwm1
shipped a foreign libane-strict.so (6e20168d, 67728 B) and worker beside
the wheel's untouched pin (d06222a8) and pacman -Qkk stayed clean. Run
the same checker in package_omarchy-mlx() before the stage is copied
into $pkgdir so a stage that disagrees with its own pin cannot become a
package, with or without --nocheck.

The pin json has no worker entry, so a swapped mlx-omarchy-ane-worker is
still outside pin coverage; that extension belongs in omarchy-mlx itself.

Signed-off-by: Joshua Warren <[email protected]>
… files)

makepkg strips after package(): libane-strict.so 71456 -> 67728 B and mlx-omarchy-ane-worker 161744 -> 134552 B, so the installed bytes no longer match parakeet-runtime-pin.json. check() and package() run before the strip. Reproduced with strip --strip-unneeded / --strip-all on the wheel's two files.
@joshuaswarren

joshuaswarren commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor Author

I found why the installed omarchy-mlx package carries a foreign libane-strict.so and worker. The fix is one line: options=('!debug' '!lto' '!strip').

makepkg strips binaries after package() runs. The strip rewrites the wheel's two pinned ANE files. The installed bytes then stop matching the pin.

  • libane-strict.so: pinned d06222a8, 71,456 bytes. After strip: 6e20168d, 67,728 bytes.
  • mlx-omarchy-ane-worker: wheel file f4562eff, 161,744 bytes. After strip: 134,552 bytes.

I checked this on jwm1 today.

  • I built the 0.7.31 PKGBUILD with check() on. The package carried 6e20168d and the small worker. check() passed, because it looks at the stage, and the stage was correct. The verifier says OK on the stage and MISMATCH on the final package tree.
  • I ran strip --strip-unneeded on the wheel's libane-strict.so and strip --strip-all on the worker. The output equals the shipped bytes.
  • I re-packaged the same build tree with !strip. The package now holds d06222a8 (71,456 bytes) and the wheel's own worker (161,744 bytes, f4562eff). I read both from the package file. Nothing is installed yet.

So check() and the verifier call in package() cannot catch this. Both run before the strip. The --nocheck flag was not the cause of the 0.7.22-1 defect. I corrected that comment in #891. The verifier call there still guards against a swapped stage.

Not tested yet: installing the re-packaged package on a Mac (planned next), and a CI build of the new PKGBUILD. This text is unvoiced: the voice service is down.

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Note

🤖 openai-codex/gpt-6.1-terra responding on behalf of joshuaswarren

At 4fe188df, self-tests and build-isolation passed, while the package build is awaiting approval. The package-time check catches changes to the staged ANE files before packaging. What else would help move this to merge?

@joshuaswarren

Copy link
Copy Markdown
Contributor Author

Note

🤖 openai-codex/gpt-6.1-terra responding on behalf of joshuaswarren

[Joshua's agent] The native package build waits for the maintainer-applied build-approved label.

This branch has not been deployed

No deployments
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