Skip to content

Releases: BSN4/grpc-php-rs

v0.2.6

Choose a tag to compare

@github-actions github-actions released this 05 Jun 00:24

What's Changed

  • Fix crash (SIGSEGV) when a CallCredentials plugin throws — If the PHP credentials callable threw an exception (e.g. Google auth failing to fetch a token with unconfigured/invalid credentials), the process crashed with a stack overflow while formatting the error. Affected real-world flows like `FirestoreClient->set()` without working ADC credentials. PHP now gets a clean catchable exception naming the real failure, e.g. `callback failed: plugin threw GuzzleHttp\Exception\ClientException: ...`.
  • Report ext-grpc compat version 1.81.0 — keeps pace with Packagist's `grpc/grpc` 1.81.0 so `version_compare()` checks (google-ads-php) keep passing.
  • ext-php-rs 0.15.13 → 0.15.15 and other dependency updates.
  • New regression test covering the plugin-throws path.

Full Changelog: v0.2.5...v0.2.6

v0.2.5

Choose a tag to compare

@github-actions github-actions released this 18 May 23:15

What's Changed

  • Report ext-grpc compatible version to PHP — `phpversion('grpc')` and `Grpc\VERSION` now report `1.80.0` (latest stable ext-grpc) instead of our internal Rust crate version. PHP libraries that do `version_compare()` checks (e.g. google-ads-php) were rejecting us as too old. Fixes #13.
  • Cargo.toml version synced with git tags (0.1.0 → 0.2.5), plus a CI guard that fails releases if Cargo.toml doesn't match the tag.
  • Dependency bumps — `cargo update` on the main crate; test server bumped to tonic 0.14 / prost 0.14.

Full Changelog: v0.2.4...v0.2.5

v0.2.4

Choose a tag to compare

@github-actions github-actions released this 11 May 20:07
8ed3ac3

What's Changed

  • Surface binary trailing metadata to PHP (`-bin` keys) — Our `metadata_to_php()` only matched the `Ascii` variant and silently dropped `Binary` (`-bin`) metadata. This broke rich-status propagation (`google.rpc.Status` over `grpc-status-details-bin`) — the standard mechanism for typed errors from Google Cloud APIs — and any custom binary trailer. Binary values are now surfaced as PHP binary-safe strings, matching ext-grpc. Thanks @imhmdb in #11.

New Contributors

Full Changelog: v0.2.3...v0.2.4

v0.2.3

Choose a tag to compare

@github-actions github-actions released this 11 May 12:27
6187fca

What's Changed

  • Honor grpc.max_receive_message_length and grpc.max_send_message_length channel options — These channel args are now mapped to tonic's max_decoding_message_size and max_encoding_message_size. Without this fix, tonic's default 4 MiB decoding limit applied to all calls regardless of the PHP-side configuration, causing `"decoded message length too large"` errors on legitimate large responses. The C-based ext-grpc honors these natively; this brings grpc-php-rs to parity. Thanks @jumper423 in #10.

Usage

\$channel = new \\Grpc\\Channel('localhost:50051', [
    'credentials' => \\Grpc\\ChannelCredentials::createInsecure(),
    'grpc.max_receive_message_length' => 128 * 1024 * 1024,  // 128 MiB
    'grpc.max_send_message_length' => -1,                     // unlimited
]);

Semantics:

  • Value `0` or unset → tonic default (4 MiB decoding, unlimited encoding)
  • Value `-1` → unlimited
  • Value `> 0` → exact byte limit

New Contributors

Full Changelog: v0.2.2...v0.2.3

v0.2.2

Choose a tag to compare

@github-actions github-actions released this 02 May 07:23

Alpine Linux Support

Pre-built binaries and Docker install images now available for Alpine Linux (musl libc). Fixes #9.

What's New

  • Alpine binary buildslinux-musl .so files for PHP 8.2/8.3/8.4/8.5 on x86_64 and ARM64, both NTS and ZTS. Asset names follow the standard PIE convention: php_grpc-v0.2.2_php{X.Y}-{arch}-linux-musl.zip (and -zts variant).
  • Alpine Docker imageslatest-php{X.Y}-alpine and latest-php{X.Y}-alpine-zts tags pushed to ghcr.io/bsn4/grpc-php-rs. The image bundles libgcc_s.so.1 so users don't need apk add libgcc separately.

Usage

FROM php:8.5-alpine
COPY --from=ghcr.io/bsn4/grpc-php-rs:latest-php8.5-alpine /usr/local/ /usr/local/

For ZTS Alpine (FrankenPHP, Swoole on Alpine):

COPY --from=ghcr.io/bsn4/grpc-php-rs:latest-php8.5-alpine-zts /usr/local/ /usr/local/

Or via PIE:

pie install bsn4/grpc

PIE auto-detects musl and downloads the right binary.

Technical Notes

Rust's musl target is static-only by default and rejects cdylib output. We set RUSTFLAGS="-C target-feature=-crt-static" to enable dynamic linking. Manual binary downloads on Alpine (without using the Docker install image) need apk add --no-cache libgcc since the .so depends on libgcc_s.so.1 at runtime.

Full Changelog: v0.2.1...v0.2.2

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 01 Apr 00:53

Windows Support

Pre-built Windows DLLs are now included in releases for PHP 8.2, 8.3, 8.4, and 8.5.

What's New

  • Windows build support — Added abi_vectorcall feature flag and restored Windows build in the release pipeline using Rust nightly. Thanks to @ptondereau (ext-php-rs maintainer) for the fix. Closes #1.
  • Updated platform table — Windows x86_64 NTS added to supported platforms in README.

What's Changed Since v0.2.0

  • Added #![cfg_attr(windows, feature(abi_vectorcall))] to src/lib.rs
  • Restored build-windows job in release workflow (nightly + rustfmt)
  • Updated README with Windows in supported platforms

Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 27 Mar 08:48

Full gRPC Streaming Support

This release adds complete streaming support, making grpc-php-rs a true drop-in replacement for the C-based ext/grpc extension. All four gRPC call types are now fully supported.

Streaming

  • Server streamingServerStreamingCall now works correctly. A background tokio task drives the tonic response stream and communicates with PHP via channels, allowing multiple startBatch([RECV_MESSAGE]) calls to read messages one at a time.
  • Client streamingClientStreamingCall sends multiple messages over a single HTTP/2 stream. Each startBatch([SEND_MESSAGE]) pushes through an mpsc channel to the tonic request stream.
  • Bidi streamingBidiStreamingCall supports interleaved send and receive on the same stream. Both client and bidi streaming use tonic::client::Grpc::streaming() under the hood.

Bug Fixes

  • Empty protobuf responses return "" instead of null — RPCs returning 0-byte messages (e.g. google.protobuf.Empty) now return an empty string, matching the C extension behavior. Fixes issues with Google Cloud PHP libraries like PubSub and Spanner. (thanks @dkkoma, #8)

Testing

  • Added CollectPayloads (client streaming) and BidiEcho (bidi streaming) RPCs to the test server
  • Added streaming tests covering all three streaming patterns
  • Added empty response test
  • ./test.sh all now runs the full test suite: smoke, compat, grpc-gcp, streaming, and leak tests

New Contributors

  • @dkkoma made their first contribution in #8

Full Changelog: v0.1.9...v0.2.0

v0.1.9

Choose a tag to compare

@github-actions github-actions released this 27 Mar 05:08

What's Changed

  • Add server streaming support to startBatch — streaming RPCs (used by Google Cloud AI Platform streamGenerateContent, Spanner ExecuteStreamingSql, etc.) now work correctly. The extension detects unary vs streaming from the batch pattern and spawns a background tokio task to drive the tonic stream.
  • chore: update GitHub Actions to Node.js 24-compatible versions by @keithbrink in #5

New Contributors

Full Changelog: v0.1.8...v0.1.9

v0.1.8

Choose a tag to compare

@github-actions github-actions released this 10 Mar 21:19

Full Changelog: v0.1.7...v0.1.8

v0.1.7

Choose a tag to compare

@github-actions github-actions released this 06 Mar 19:55

Full Changelog: v0.1.6...v0.1.7