Skip to content

Patch to use protobuf - #7

Open
cjac wants to merge 3 commits into
perlbot:masterfrom
LLC-Technologies-Collier:patch-to-use-Protobuf
Open

Patch to use protobuf#7
cjac wants to merge 3 commits into
perlbot:masterfrom
LLC-Technologies-Collier:patch-to-use-Protobuf

Conversation

@cjac

@cjac cjac commented Jul 18, 2026

Copy link
Copy Markdown

feat(protobuf): add Google::ProtocolBuffers::Dynamic compatibility API shim & bump version to 0.09

Summary

This PR introduces a compatibility layer (Google::ProtocolBuffers::Dynamic) for Protobuf backed by the high-performance upb C runtime, refactors downstream client code (App::EvalServerAdvanced), and hardens build targets and CPAN packaging across platforms.

Key Changes

1. Google::ProtocolBuffers::Dynamic Compatibility API Layer

  • Added lib/Google/ProtocolBuffers/Dynamic.pm, providing compatibility shims (load_file, load_string, map_package, encode, decode, new) so legacy codebases written for Google::ProtocolBuffers::Dynamic can seamlessly run against the UPB XS backend.
  • Added dedicated unit test t/025_dynamic_compat.t validating package mapping, encoding, and decoding round-trips.

2. App-EvalServerAdvanced Refactoring

  • Updated App::EvalServerAdvanced::Protocol to consume Google::ProtocolBuffers::Dynamic over the UPB backend.
  • Added share/proto/evalserver.proto and implemented dynamic relative path resolution via File::Spec and __FILE__.

3. Build System & Packaging Hardening (Makefile.PL & makefile.tt)

  • Target Integration: Integrated bin/protoc-gen-perl-pb into standard Makefile all :: and install targets via EXE_FILES.
  • Clean Target Protection: Excluded vendor and upb object path structures from realclean => { FILES => ... } in Makefile.PL, ensuring make realclean cleans build artifacts without deleting tracked C source headers.
  • Git Auto-Restoration: Added automatic fallback (git checkout -- vendor/) in Makefile.PL if vendor/ is missing when executing in a Git workspace.
  • Linker Rules: Removed non-existent libprotobufperl.map file dependency from inc/templates/makefile.tt.
  • Git Hygiene: Untracked compiled ELF binary bin/protoc-gen-perl-pb from Git index and added to .gitignore.

4. Versioning & Acknowledgments

  • Bumped $VERSION to 0.09 across all Protobuf modules.
  • Updated Changes file with release notes for 0.09 (in dev), 0.08, and 0.07.
  • Updated Changes and THANKS.md crediting Ryan Voots (@simcop2387) for testing, feedback, and driving compatibility requirements.

Testing & Verification

  • Unit Tests: prove -b -It/lib t/025_dynamic_compat.t $\rightarrow$ PASS (1/1 tests).
  • App-EvalServerAdvanced Integration: Verified packet encoding and decoding round-trips.
  • Build Hardening: Verified make realclean > /dev/null && cpanm . installs Protobuf-0.09 cleanly.
  • Multi-Container Matrix: Validated pre-commit/pre-push hooks across Debian, Ubuntu, Rocky Linux, and Perl 5.40 containers.

TAG=agy
CONV=90cea78f-e93a-4503-a0da-3ed22cf7f7cc

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.

1 participant