Skip to content

Replace unmaintained bincode with postcard for asset serialization#3618

Open
Xavrir wants to merge 1 commit intosharkdp:masterfrom
Xavrir:replace-bincode-with-postcard
Open

Replace unmaintained bincode with postcard for asset serialization#3618
Xavrir wants to merge 1 commit intosharkdp:masterfrom
Xavrir:replace-bincode-with-postcard

Conversation

@Xavrir
Copy link
Contributor

@Xavrir Xavrir commented Mar 8, 2026

Summary

Replace the unmaintained bincode crate with postcard for asset serialization, addressing RUSTSEC-2025-0141.

Changes

  • Cargo.toml: bincode = "1.0"postcard = { version = "1.0", features = ["alloc"] }
  • src/assets.rs: Deserialization via postcard::from_bytes() instead of bincode::deserialize_from()
  • src/assets/build_assets.rs: Serialization via postcard::to_allocvec() instead of bincode::serialize_into()
  • assets/*.bin: Rebuilt with postcard format via assets/create.sh
  • CHANGELOG.md: Added entry under "Other"

Why postcard?

  • Actively maintained and recommended by RustSec as a replacement
  • Serde-compatible — minimal code changes required
  • Designed for embedded/resource-constrained environments (compact output)
  • Widely used in production Rust projects

Notes

  • Cache compatibility: Users with existing bat cache --build caches from the old bincode format will need to rebuild (bat cache --build). The existing metadata.yaml version check will reject incompatible caches when the minor version bumps.
  • Binary assets: All three .bin files (syntaxes, themes, acknowledgements) have been rebuilt using the new serialization format.
  • All 377 tests pass.
  • Related: replace unmaintained bincode with postcard #3595 (similar approach, currently in draft)

Closes #3582

Replace bincode (RUSTSEC-2025-0141) with postcard for serializing
and deserializing syntax definitions, themes, and acknowledgements.

bincode has been permanently abandoned by its maintainers. postcard
is actively maintained, serde-compatible, and recommended by RustSec
as a replacement.

Closes sharkdp#3582
@Xavrir Xavrir force-pushed the replace-bincode-with-postcard branch from bafaa12 to c114ae2 Compare March 8, 2026 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dependency bincode is unmaintained and flagged by RUSTSEC-2025-0141

1 participant