Skip to content

fix(pact_verifier_cli): build against xrust 2.4 - #610

Merged
JP-Ellis merged 2 commits into
masterfrom
fix/pact-verifier-cli-xrust-2.4
Nov 23, 2026
Merged

JP-Ellis merged 2 commits into
masterfrom
fix/pact-verifier-cli-xrust-2.4

Conversation

@JP-Ellis

Copy link
Copy Markdown
Member

pact_verifier_cli 1.5.0 fails to compile when dependency resolution picks up xrust 2.4.x, which the requirement xrust = "2.0.3" admits. This hits cargo install pact_verifier_cli without --locked, and any downstream lockfile update. pact-foundation/pact-cli#210 is one example.

xrust broke its API in two minor releases:

  • 2.3.0 gave ParseError::MissingNameSpace the fields prefix, nsuri and message.
  • 2.4.0 renamed StaticContextBuilder::fetcher to external. The external-resource callback now takes &External and returns Sequence<N>, in the builder and in xslt::from_document.

Commits

  1. test: snapshot the HTML report. No test ran the XSLT step of the HTML report. The new snapshot was recorded on xrust 2.2.0, the version in the lockfile on master.
  2. fix: build against xrust 2.4. Ports reports/mod.rs to the 2.4 API and raises the requirement to xrust = "2.4.1". The lockfile changes only xrust and qualname, which only xrust uses.

The HTML snapshot is byte-identical under 2.4.1.

Alternative considered

Capping the requirement at ~2.2 would also fix the build. It would leave the crate on an old xrust and would need lifting later anyway, so this PR ports the code instead.

Once this merges, a pact_verifier_cli 1.5.1 release unblocks pact-cli.

Nothing exercised the XSLT step of the HTML report, so an xrust
upgrade could change its output unnoticed. The snapshot pins the
output of the default stylesheet for a failing result with a notice
and a passing interaction.

Assisted-by: Claude Code:claude-opus-5-5
xrust broke its API in two minor releases, and the old requirement
`xrust = "2.0.3"` admitted both:

- 2.3.0 gave `ParseError::MissingNameSpace` the fields `prefix`,
  `nsuri` and `message`.
- 2.4.0 renamed `StaticContextBuilder::fetcher` to `external`. The
  callback for external resources now takes `&External` and returns
  `Sequence<N>`, both in the builder and in `xslt::from_document`.

Any build that resolved dependencies afresh, such as `cargo install`
without `--locked` or a downstream lockfile update, picked up 2.4.1 and
failed to compile the report module. The requirement is now 2.4.1, the
first release with the current API.

The HTML report snapshot is unchanged under 2.4.1.

Assisted-by: Claude Code:claude-opus-5-5
@JP-Ellis
JP-Ellis merged commit 4a24afc into master Nov 23, 2026
26 checks passed
@JP-Ellis
JP-Ellis deleted the fix/pact-verifier-cli-xrust-2.4 branch November 23, 2026 04:09
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