Merge v0.16.0 into main — promote zig 0.16 upgrade to default branch#10
Merged
Merged
Conversation
`decode` and `decodeFromReader` rejected a stream that contained only the 10-byte stream-identifier chunk with `FrameError.NotFramed`, even though the Snappy framing spec treats it as a valid representation of an empty payload. Go's `snappy.NewReader` and Rust's `snap::read::FrameDecoder` both accept the same input and decode it to an empty slice; cross-client interop fixtures (e.g. leanSpec's `test_snappy_frame_empty`) emit exactly this 10-byte form for empty input. The terminal post-loop check in both decode paths now requires that both `saw_stream_identifier` and `saw_data_chunk` be unset to declare the input unframed. A stream with the identifier alone — and no data chunks — returns an empty slice. Adds two regression tests against the canonical 10-byte `"\xff\x06\x00\x00sNaPpY"` input (`decode` and `decodeFromReader`). The existing `frame roundtrip samples` test already covered round-tripping `""` through the lib's own encoder, but the encoder appends an empty data chunk in `finish()`, which masked the gap on the decode side. This is the zig-0.16-ready version of blockblaz#8 (which was cut against the 0.15.2 commit base and never reconciled with the `v0.16.0` branch).
…-0.16 fix: accept identifier-only stream as empty payload (zig-0.16 rebase of blockblaz#8)
Reconcile the `main` and `v0.16.0` branches so the default branch ships zig 0.16 support together with the empty-stream decode fix. Both branches independently cherry-picked the same logical empty-fix on different bases (main on 0.15.2 via blockblaz#8, v0.16.0 on 0.16 via blockblaz#9), which produced two collisions when merging: 1. The terminal `if (!saw_data_chunk)` check in `decodeFromReader` and `decodeFramed` is the same line on both sides; keep one copy with v0.16.0's longer comment (more interop context). 2. `test "decode accepts identifier-only stream as empty payload"` and `test "decodeFromReader accepts identifier-only stream as empty payload"` appear on both branches. The main copy still uses `std.io.fixedBufferStream` / `ArrayListUnmanaged.writer`, which were removed in zig 0.16 — drop those duplicates and keep the v0.16.0 versions that use the new `std.Io.Reader.fixed(...)` / `Writer.Allocating` API. After the merge `main` carries the zig 0.16 upgrade (`df262c6`, `f939ed6`) plus a single canonical empty-fix regression suite, and `zig build test` is green under zig 0.16.0 (3/3 build steps, 13/13 tests). Downstream consumers can now point at the default branch instead of the `v0.16.0` release-style branch (which has been the only 0.16-ready snapshot until today).
`build.zig.zon` listed two dependencies — `.snappyz` and `.zig_snappy`
— with the same URL and same content hash, but `build.zig` only ever
references the first via `b.dependency("snappyz", ...)`. The
`.zig_snappy` entry has been dead since it was introduced; remove it.
No behavioural change: same lockfile content, same package tree.
`zig build test` on 0.16.0 — 3/3 build steps, 13/13 tests passed.
GrapeBaBa
added a commit
to blockblaz/zeam
that referenced
this pull request
May 11, 2026
The vendored copy of `pkgs/third_party/snappyframesz/build.zig.zon`
carried two identical dependency entries — `.snappyz` and
`.zig_snappy` — with the same URL and hash. The library's `build.zig`
only references the first one (`b.dependency("snappyz", ...)`); the
second is dead weight inherited from the upstream `v0.16.0` tip.
Drop it here so the vendored copy doesn't propagate the noise. The
same change is also stacked on the upstream PR that promotes
`v0.16.0` to `main` (blockblaz/snappyframesz#10) so the next sync
won't reintroduce it.
GrapeBaBa
added a commit
to blockblaz/zeam
that referenced
this pull request
May 11, 2026
Upstream blockblaz/snappyframesz#10 merged the zig 0.16 upgrade + the empty-stream decode fix into main. Pin e95759d9 and delete pkgs/third_party/snappyframesz/.
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
Promote the zig-0.16-ready state from the
v0.16.0release-style branch intomain, so the default branch finally ships:df262c6upgrade to zig 0.16.0f939ed6upgrade zig version in CImainis currently stuck on the 0.15.2 base — downstream consumers on zig 0.16 (e.g. zeam's spectest suite) are forced to pin thev0.16.0branch or vendor the library because the default branch doesn't compile under 0.16. This PR consolidates the two branches so the default branch is the canonical 0.16-ready snapshot and the release-style branch can be retired.Conflicts that were resolved in the merge
if (!saw_data_chunk)→if (!saw_stream_identifier and !saw_data_chunk)change appears on both branches in bothdecodeFromReaderanddecodeFramed. The lines are functionally identical; kept v0.16.0's longer comment (more interop context).decode accepts identifier-only stream as empty payloadanddecodeFromReader accepts identifier-only stream as empty payload) exist on both branches. Themaincopy from fix: accept identifier-only stream as empty payload #8 usesstd.io.fixedBufferStream/std.ArrayListUnmanaged.writer, both removed in zig 0.16. Dropped those duplicates; kept the v0.16.0 versions from fix: accept identifier-only stream as empty payload (zig-0.16 rebase of #8) #9 which use the newstd.Io.Reader.fixed(...)/Writer.AllocatingAPI and would compile on the post-merge state.After the merge there is exactly one copy of each test, on the 0.16 API.
Test plan
zig build teston zig 0.16.0 after the merge — Build Summary: 3/3 steps succeeded; 13/13 tests passed.After this lands
v0.16.0branch can be deleted (or left as a tag for historical reference).mainagain.