Releases: BSN4/grpc-php-rs
Release list
v0.2.6
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
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
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
What's Changed
- Honor
grpc.max_receive_message_lengthandgrpc.max_send_message_lengthchannel options — These channel args are now mapped to tonic'smax_decoding_message_sizeandmax_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
- @jumper423 made their first contribution in #10
Full Changelog: v0.2.2...v0.2.3
v0.2.2
Alpine Linux Support
Pre-built binaries and Docker install images now available for Alpine Linux (musl libc). Fixes #9.
What's New
- Alpine binary builds —
linux-musl.sofiles 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-ztsvariant). - Alpine Docker images —
latest-php{X.Y}-alpineandlatest-php{X.Y}-alpine-ztstags pushed toghcr.io/bsn4/grpc-php-rs. The image bundleslibgcc_s.so.1so users don't needapk add libgccseparately.
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/grpcPIE 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
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_vectorcallfeature 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))]tosrc/lib.rs - Restored
build-windowsjob in release workflow (nightly + rustfmt) - Updated README with Windows in supported platforms
Full Changelog: v0.2.0...v0.2.1
v0.2.0
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 streaming —
ServerStreamingCallnow works correctly. A background tokio task drives the tonic response stream and communicates with PHP via channels, allowing multiplestartBatch([RECV_MESSAGE])calls to read messages one at a time. - Client streaming —
ClientStreamingCallsends multiple messages over a single HTTP/2 stream. EachstartBatch([SEND_MESSAGE])pushes through an mpsc channel to the tonic request stream. - Bidi streaming —
BidiStreamingCallsupports interleaved send and receive on the same stream. Both client and bidi streaming usetonic::client::Grpc::streaming()under the hood.
Bug Fixes
- Empty protobuf responses return
""instead ofnull— 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) andBidiEcho(bidi streaming) RPCs to the test server - Added streaming tests covering all three streaming patterns
- Added empty response test
./test.sh allnow runs the full test suite: smoke, compat, grpc-gcp, streaming, and leak tests
New Contributors
Full Changelog: v0.1.9...v0.2.0
v0.1.9
What's Changed
- Add server streaming support to startBatch — streaming RPCs (used by Google Cloud AI Platform
streamGenerateContent, SpannerExecuteStreamingSql, 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
- @keithbrink made their first contribution in #5
Full Changelog: v0.1.8...v0.1.9