Skip to content

ci: publish the Zig FFI library image to GHCR#49

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/task-4o29rq
Jun 26, 2026
Merged

ci: publish the Zig FFI library image to GHCR#49
hyperpolymath merged 1 commit into
mainfrom
claude/task-4o29rq

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

What

Adds a Containerfile + .github/workflows/publish-image.yml so checky-monkey publishes its own image to ghcr.io/hyperpolymath/checky-monkey, and fixes a pre-existing Zig compile error so the library actually builds.

Why

Part of the cross-repo GHCR attribution cleanup. The checky-monkey package was mis-attributed to odds-and-sods-package-manager, whose vendored Containerfile built a Rust/axum service that does not exist in this repo. Publishing from here re-links the package to its real source.

What the image is

checky-monkey on disk is a Zig C-ABI library (libchecky_monkey.{so,a}) with Idris2 ABI bindings — not a running service (the Haskell/Servant platform in the README/TOPOLOGY is aspirational and not yet on disk). So the image is a distribution artifact carrying the compiled library (and its source) for downstream FFI consumers to COPY --from. No EXPOSE/service HEALTHCHECK.

Source fix (so it compiles)

  • ffi/zig/src/main.zig: Handle was declared as opaque { allocator, initialized }, which Zig rejects — opaque types cannot carry fields. Changed to a struct (still exposed to C only as an opaque *Handle pointer, so the C-ABI is unchanged).
  • The Containerfile builds the library directly with zig build-lib src/main.zig ... -lc (libc is required by std.heap.c_allocator), bypassing the in-tree build.zig, which is a not-yet-instantiated scaffold template ({{project}} placeholders + a referenced-but-missing include/ header).

Verification

Built locally with Zig 0.13.0: after the opaquestruct fix and -lc, both libchecky_monkey.so and libchecky_monkey.a build cleanly.

Note: the GHCR package → repo re-link is a one-time manual step in the package settings UI; this workflow makes every subsequent push publish with the correct source label.

🤖 Generated with Claude Code

https://claude.ai/code/session_012kWck3NjBo5orHKAXMHm5W


Generated by Claude Code

Add a publish-image workflow + Containerfile so checky-monkey publishes its own
GHCR image, re-linking the ghcr.io/hyperpolymath/checky-monkey package back to
this repo (it was previously mis-attributed to odds-and-sods-package-manager,
which built a Rust/axum service that does not exist here).

checky-monkey is currently a Zig C-ABI library (libchecky_monkey.{so,a}) with
Idris2 ABI bindings — not a running service — so the image is a distribution
artifact carrying the compiled library for downstream FFI consumers.

Also fixes a pre-existing compile error so the library builds:
- ffi/zig/src/main.zig: `Handle` was declared as `opaque { ...fields... }`,
  which Zig rejects (opaque types cannot carry fields). Declared it as a struct;
  it is still exposed to C only as an opaque `*Handle` pointer.
- The Containerfile builds the lib directly with `zig build-lib ... -lc` (libc
  is needed for std.heap.c_allocator), bypassing the in-tree build.zig, which is
  a not-yet-instantiated scaffold template ({{project}} placeholders + a missing
  include/ header).

Verified locally with Zig 0.13.0: both the shared and static libraries build.
Actions are SHA-pinned, permissions least-privilege, provenance attested.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012kWck3NjBo5orHKAXMHm5W
@hyperpolymath hyperpolymath marked this pull request as ready for review June 26, 2026 22:37
@hyperpolymath hyperpolymath merged commit 85ca5bd into main Jun 26, 2026
19 of 22 checks passed
@hyperpolymath hyperpolymath deleted the claude/task-4o29rq branch June 26, 2026 22:38
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.

2 participants