Skip to content

ci: publish the FFI as an image from this repo - #29

Closed
pigri wants to merge 1 commit into
release/v0.7.3from
feat/publish-ffi-image
Closed

pigri wants to merge 1 commit into
release/v0.7.3from
feat/publish-ffi-image

Conversation

@pigri

@pigri pigri commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

The FFI shared library is currently built downstream: a consumer clones this repo inside its own Docker build, at a commit named in an ARG it bumps by hand, and tags the result with its commit sha.

Two consequences, both of which have already happened:

  • The image identity says nothing about which engine is inside it.
  • The ARG drifted three releases behind — shipping a library with neither ends_with (0.7.2) nor the JSON lookup functions (0.7.4) — and nothing failed, because that ARG was the only thing asserting what the image contained.

Building it here removes the class: the image is produced by the source it ships, tagged with the version that source declares, by the same workflow that already verifies the tag matches Cargo.toml.

Shape

  • Multi-arch on native runners. This is a Rust release build; under QEMU it does not finish inside a sane timeout.
  • Push by digest, then merge. One tag cannot name two single-arch manifests without the second replacing the first.
  • Index digest printed to the step summary, so consumers can pin the digest rather than the tag.
  • workflow_dispatch takes an image-version input, because 0.7.4 shipped before this job existed and its image must be publishable without inventing a crate release to carry it.
  • Layout unchanged at /tmp/libwirefilter_ffi.so, so existing COPY --from=wirefilter consumers keep working.

Verification

Built the image locally and linked rules-validator against the library it contains. All five functions 0.7.4 exports validate against the real engine:

lookup_json_string     VALID
lookup_json_integer    VALID
to_string              VALID
upper                  VALID
remove_query_args      VALID
ends_with              VALID   (0.7.2)
ids.sids               VALID   (smart_firewall scheme)

shellcheck over the new run: blocks is clean and the workflow parses with the expected job graph.

The push path itself cannot be exercised by a PR — it needs a tag or a dispatch. First real test is publishing 0.7.4's image via workflow_dispatch.

Base branch

Targets release/v0.7.3, because v0.7.4 exists only there and a workflow runs as it exists at the tagged commit. That leaves master without this job — reconciling the two is a follow-up, not something to smuggle into this PR.

The shared library was built downstream: a consumer cloned this repo
inside its own Docker build, at a commit named in an ARG it bumped by
hand, and tagged the result with its own commit sha. So the image's
identity said nothing about which engine was in it, and the ARG drifted
three releases behind -- shipping a library with neither ends_with nor
the JSON lookup functions -- without anything failing, because the ARG
was the only thing asserting what it contained.

Building it here removes the class. The image is produced by the source
it ships, tagged with the version that source declares, and pushed
alongside the crate by the same workflow that already verifies the tag
matches Cargo.toml.

Multi-arch on native runners: this is a Rust release build, and under
QEMU it does not finish inside a sane timeout. Each arch pushes by
digest and a second job merges them, because one tag cannot name two
single-arch manifests without the second replacing the first. The index
digest is printed to the step summary so consumers can pin it instead of
the tag.

workflow_dispatch takes an image-version input because 0.7.4 shipped
before this job existed, and its image has to be publishable without
inventing a crate release to carry it.

Layout is unchanged at /tmp/libwirefilter_ffi.so, so existing
`COPY --from=wirefilter` consumers keep working.

Verified by building the image and linking rules-validator against the
library it contains: all five functions 0.7.4 exports validate
(lookup_json_string, lookup_json_integer, to_string, upper,
remove_query_args), as do 0.7.2's ends_with and the smart_firewall
scheme's ids.sids.
@pigri

pigri commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Closing: the image release belongs with the consuming repo's tag train, not in the engine repo.

@pigri pigri closed this Sep 4, 2026
@pigri
pigri deleted the feat/publish-ffi-image branch September 4, 2026 20:20
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