Skip to content

chore: download pact_ffi 0.5.12 from the dist-built release - #570

Draft
JP-Ellis wants to merge 1 commit into
masterfrom
chore/pact-ffi-dist-release
Draft

JP-Ellis wants to merge 1 commit into
masterfrom
chore/pact-ffi-dist-release

Conversation

@JP-Ellis

Copy link
Copy Markdown
Member

Goal

pact-reference now builds pact_ffi with cargo-dist. From 0.5.12, each release is tagged pact_ffi-v<version> and carries one archive per Rust target triple. The legacy libpact_ffi-v<version> release, with the single-file .gz names this script downloads, stops on 2027-06-30.

Changes

  • build/download-native-libs.sh:
    • downloads pact_ffi-<target>.tar.xz (.zip for Windows) and its .sha256;
    • verifies the digest; the checksum files end with a blank line, which is stripped first;
    • extracts only the shared library, to the same build/<os>/<arch>/ path as before;
    • fails on HTTP errors.
  • The same five targets as before: win-x64, linux x64/arm64, macOS x64/arm64.
  • CONTRIBUTING.md names the new archives and tools.

FFI 0.4.27 → 0.5.12

The archive layout only exists from 0.5.12, so this PR also moves the FFI from 0.4.27 to 0.5.12. The tests change with it:

  • Pact metadata records ffi 0.5.12 and models 1.3.16.
  • Behaviour change for users. Since pact_ffi 0.5.10, only known multi-value headers split on commas (pact-reference@2e7fe4a5). A custom header such as X-Request with a comma-joined value stays one value, and requests that send the two values got a 500. The 8 affected tests use Accept-Language, which is on the allowlist. Users with comma-joined custom headers will see the same change.

Testing

  • The script ran against the real 0.5.12 release on macOS arm64. All five archives verified and extracted, and a corrupted checksum fails the script.
  • dotnet test PactNet.sln: 52 + 146 + 4 + 1 passed, 0 failed.
  • Not run locally: the Windows CI leg. The script needs Git Bash with unzip or 7z (it falls back to tar), and a tar that handles xz.

pact-reference publishes pact_ffi through cargo-dist from 0.5.12, under
the release tag `pact_ffi-v<version>`. Each Rust target triple has one
archive, `pact_ffi-<target>.tar.xz` or `.zip` on Windows. The legacy
`libpact_ffi-v<version>` release with single-file .gz assets stops on
2027-06-30.

download-native-libs.sh fetches each archive and its .sha256, verifies
the digest, and extracts the shared library to the same
build/<os>/<arch>/ path. The checksum files end with a blank line, which
is stripped before the check. curl now fails on HTTP errors.

The archive layout exists from 0.5.12, so the FFI moves from 0.4.27 to
0.5.12. The tests change with it:

- Pact metadata now records ffi 0.5.12 and models 1.3.16.
- Since 0.5.10 the FFI splits only known multi-value headers on commas.
  The tests' two-value custom headers are now one value, and requests
  that send them get a 500. The tests use Accept-Language, a known
  multi-value header.

Assisted-by: Claude Code:claude-opus-5-5
@JP-Ellis

JP-Ellis commented Oct 20, 2026 •

Copy link
Copy Markdown
Member Author

I got Claude to do a sweep across all the downstream users of the FFI.

I know that there are other things blocking the upgrade to 0.5.x, so I will leave this as a draft for now, and when the upstream fix for the headers lands, the FFI version can be appropriately bumped.

See: #569

@YOU54F

YOU54F commented Oct 20, 2026

Copy link
Copy Markdown
Member

Thanks @JP-Ellis, appreciate your work in pact-ref on the ci/release workflow side

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