Releases: Arwalk/zig-protobuf
v2.0.0
IMPORTANT BREAKING CHANGE
An encoding error was identified for int32
protobuf fields. Any other fields (sint32
, uint32
, ...) are not concerned.
The problem
I assumed wrongly that protobuf would chooses the smallest representation for int32 fields, but the specification is clear: int32 fields are actually encoded as int64 fields in the wire format. This means that negative values are encoded with 10 bytes, not 5. Sadly, zig-protobuf was encoding with 5 bytes, which meant that other (and more correct) implementations of protobuf would not decode them as their actual values.
If you have int32
fields in your proto messages
If your software only communicates with another zig-protobuf implementation
Update zig-protobuf to this version or up on all your systems.
If your software sends int32
data to another implementation
Check if your messages have used negative values, ensure the other system did not have any problem.
If negative values were never used, you do not have any problem. Update zig-protobuf asap.
If your software receives int32
from another implementation
Negatives values would have not been properly decoded and an error would have been returned. You probably would have noticed already.
If you have saved to disk/database encoded protobuf data with int32
fields that could contain negative values
first: backup everything.
then let's say you have this .proto file
message AnExample{
int32 a_field = 1;
}
- Create a new recovery .protofile with equivalent fields but
int32
are nowint64
message AnExampleForRecovery{
int64 a_field = 1;
}
- read from disk/database the data using the old zig-protobuf, and save it back using the new recovery message.
- update zig-protobuf
- read from disk/database with the fixed zig-protobuf and the new recovery message, save it with your original .proto message
If you don't know what to do
I'll do my best to give some support for people who could have been affected. I can be contacted in the discussions on this repository, or you can find me on the official zig discord server.
Changelog
Note: json is a work in progress subject, consider it beta.
What's Changed
- Change std.debug.print -> std.log.warn by @Detegr in #51
- JSON (de)serialization by @librolibro in #49
- Allow for external protoc by @BonusPlay in #66
- 56 Errors with
Unknown field received in ....
by @Arwalk in #63 - fix: memory leak when decoding Lists of Bytes by @kantai-chris in #68
- Fix: prevent unsafe cast on decoding by @Arwalk in #72
- #74
dupe()
methods fail to compile by @Arwalk in #75 - fix: Convert OOB enums from panics to runtime errors by @hans-tvs in #76
- 84
encode()
fails to compile by @Arwalk in #85 - Fix integer encoding by @Arwalk in #86
New Contributors
- @Detegr made their first contribution in #51
- @librolibro made their first contribution in #49
- @BonusPlay made their first contribution in #66
- @kantai-chris made their first contribution in #68
Full Changelog: v1.0.6...v2.0.0
v1.0.6
This releases fixes the build system for zig 0.13.0.
What's Changed
New Contributors
Additional Thanks
Full Changelog: v1.0.5...v1.0.6
v1.0.5
v1.0.4
What's Changed
- Update for zig 0.12.0 by @malcolmstill in #45
New Contributors
- @malcolmstill made their first contribution in #45
Full Changelog: v1.0.3...v1.0.4
v1.0.3
What's Changed
- docs: add missing 'paths' field to
build.zig.zon
example in README by @hendriknielaender in #31 - Updating to latest zig by @Arwalk in #36
- Fix README Typo by @jcalabro in #38
- Update to latest zig and build.zig.zon requirements. by @Arwalk in #42
New Contributors
- @hendriknielaender made their first contribution in #31
Full Changelog: v1.0.2...v1.0.3
v1.0.2
What's Changed
- add
.dupe(allocator)
to every message and default values by @menduz in #23 - feature: self contained, auto installing protoc and programatic usage from
build.zig
, enable zig package manager by @menduz in #26 - chore: update to latest Zig in master (0.12.0-dev.1695+e4977f3e8) by @NefixEstrada in #28
- Update to latest zig + fix
zig build test
first pass by @Arwalk in #29
New Contributors
- @NefixEstrada made their first contribution in #28
Full Changelog: v1.0.1...v1.0.2