refactor(ipc-codegen/zig): collapse codegen onto ipc-runtime/zig#23499
Open
charlielye wants to merge 1 commit into
Open
refactor(ipc-codegen/zig): collapse codegen onto ipc-runtime/zig#23499charlielye wants to merge 1 commit into
charlielye wants to merge 1 commit into
Conversation
…nsport Drops the per-service UDS/server template duplication on the Zig side, mirroring the C++ and Rust codegens: ipc-codegen/templates/zig/ - Delete uds_backend.zig and ipc_server.zig — both reimplemented the 4-byte-LE length-prefix UDS framing that ipc-runtime/zig already exposes via Client/Server. - Delete ipc_client.zig and ffi_client.zig — already unreferenced. - backend.zig stays for FFI consumers. ipc-codegen/src/zig_codegen.ts - generateServer no longer emits a `serve(socket_path)` wrapper that pulled in the ipc_server.zig template. It now emits `dispatch` + `DispatchResult` + handler stubs only; consumers wire the transport (typically `ipc_runtime.Server.fromPath` + `listen` + `run`). ipc-runtime/zig/src/main.zig - Added `Client.destroy()` as an alias for `deinit()` so the runtime's Client satisfies the codegen Backend contract (which expects `destroy(self: *T) void`) and slots directly into the generated `<Service>Client(BackendType)`. ipc-codegen/examples/zig/echo - echo_client.zig now imports `ipc_runtime` and constructs `ipc_runtime.Client` as the Backend. No more template-copied uds_backend.zig in generated/. - echo_server.zig now uses `ipc_runtime.Server.fromPath/listen/run` with manual msgpack decode/encode (the codegen's `dispatch()` is invoked from inside the byte handler). - build.zig + build.zig.zon depend on ipc_runtime via path: `../../../../ipc-runtime/zig`. Verified: full 18-test cross-language matrix (4×4 + 2 golden) passes end-to-end with the new wiring.
This was referenced May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stacked on #23498 (cl/ipc-runtime-ts → cl/ipc-bbapi-server-signals → cl/ipc-codegen-migrate-bb-wsdb).
Final language in the cross-language collapse — Zig codegen now uses the shared `ipc-runtime/zig` transport instead of per-service UDS templates.
Changes
Templates deleted (all reimplemented length-prefix UDS framing that ipc-runtime/zig already exposes):
Codegen (`zig_codegen.ts`):
Runtime (`ipc-runtime/zig/src/main.zig`):
Echo example:
Test plan