Bundle protobuf so the RPM/deb work on Fedora (and any distro)#1
Open
GaimsDevSoftware wants to merge 1 commit into
Open
Bundle protobuf so the RPM/deb work on Fedora (and any distro)#1GaimsDevSoftware wants to merge 1 commit into
GaimsDevSoftware wants to merge 1 commit into
Conversation
The bundled androidtvremote2 ships generated *_pb2.py that import google.protobuf.internal.builder, which only exists in protobuf >= 3.20. Fedora's python3-protobuf is 3.19.6, so the installed app crashed on startup with "cannot import name 'builder'". Vendor protobuf into /opt/tellykeys/lib (alongside androidtvremote2 and aiofiles), strip its arch-specific C extension, and force the pure-Python implementation in the launcher so the package stays noarch / Architecture: all. Drop the now-unnecessary python3-protobuf dependency from both the RPM spec and the deb control. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
The installed RPM crashed on launch on Fedora:
The bundled
androidtvremote2ships generated*_pb2.pythat importgoogle.protobuf.internal.builder, which only exists in protobuf >= 3.20. Fedora shipspython3-protobuf3.19.6, so the dependency declared by the package is too old and the app can't import its remote protocol layer.Fix
Treat protobuf the same way we already treat
androidtvremote2andaiofiles— bundle it from the build venv instead of trusting the distro:cp -a "$SITE/google" → /opt/tellykeys/lib/in bothbuild-rpmandbuild-deb.find … -name '*.so' -delete) and force the pure-Python implementation in the launcher (PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python) so the package staysnoarch/Architecture: all.python3-protobuffrom the RPMRequiresand the debDepends.googlepresence check to the existing "runpip install -e ." guard.python3-cryptographystays a system dependency on purpose — it has a compiled extension, so vendoring it would breaknoarch.Verification
Reproduced the crash with Fedora's protobuf 3.19.6, then confirmed the app launches (
tellykeys --helpexits 0) with protobuf 5.29.6 vendored into/opt/tellykeys/lib, its.soremoved, and the pure-Python implementation forced.🤖 Generated with Claude Code