Skip to content

Replace libprotobuf with upb for dynamic decode #7988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2027
Choose a base branch
from

Conversation

Gold856
Copy link
Contributor

@Gold856 Gold856 commented May 26, 2025

libprotobuf is a very annoying dependency to deal with, and with the switch to nanopb for generated C++ code, libprotobuf is only used for dynamic decode in the GUI apps. libprotobuf has been swapped out with upb, a much smaller C-based library that supports reflection and can therefore do dynamic decode. This means we can remove the libprotobuf dependency and stop dealing with build issues because of it. Closes #6610 and closes #7250.

@github-actions github-actions bot added component: wpiutil WPI utility library component: wpimath Math library component: glass Glass app and backend labels May 26, 2025
@Gold856 Gold856 force-pushed the use-upb branch 11 times, most recently from 6d2a32e to 965d05f Compare May 26, 2025 07:08
@Gold856
Copy link
Contributor Author

Gold856 commented May 26, 2025

Confirmed to be working on Windows:
image
Workflows need to be rerun, I can rerun them myself once the dependent PR is merged and/or we decide if this goes into main or 2027.

@Gold856 Gold856 force-pushed the use-upb branch 2 times, most recently from 1b8ec22 to a104e38 Compare May 26, 2025 22:46
@PeterJohnson
Copy link
Member

We're trying to minimize changes for 2026. Let's target this to 2027.

@Gold856
Copy link
Contributor Author

Gold856 commented May 27, 2025

I'll rebase this when #7983 gets merged into main and main gets merged into 2027.

@Gold856 Gold856 marked this pull request as ready for review May 30, 2025 03:40
@Gold856 Gold856 requested review from PeterJohnson and a team as code owners May 30, 2025 03:40
@Gold856 Gold856 requested review from a team as code owners May 30, 2025 15:49
@github-actions github-actions bot added 2027 2027 target and removed component: outlineviewer OutlineViewer app component: datalogtool DataLog Tool component: wpinet WPI networking library component: apriltag AprilTag library component: examples component: sysid SysId app component: usage reporting Analytics for library usage sent to FIRST on competition fields. component: wpiunits Java units library component: epilogue Annotation-based logging library component: wpical WPIcal labels May 30, 2025
@Gold856 Gold856 changed the base branch from 2027 to main May 30, 2025 15:55
@github-actions github-actions bot removed component: teamnumbersetter roboRIO Team Number Setter 2027 2027 target labels May 30, 2025
@Gold856 Gold856 changed the base branch from main to 2027 May 30, 2025 15:56
@github-actions github-actions bot added the 2027 2027 target label May 30, 2025
@PeterJohnson
Copy link
Member

I merged main to 2027 but there's some fixes I need to make so it fully builds again.

@Gold856 Gold856 force-pushed the use-upb branch 4 times, most recently from 0172a65 to c8371e7 Compare June 4, 2025 12:20
@Gold856
Copy link
Contributor Author

Gold856 commented Jun 6, 2025

I will note that protobuf@3 on Homebrew will be deactivated on July 1st, and while we could switch main to protobuf@29, which I confirmed would work, I would prefer that this gets shipped to main so we don't have to deal with it at all. I doubt that many users actually depend on libprotobuf directly, and I don't really think we considered it to be a public interface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2027 2027 target component: glass Glass app and backend component: wpimath Math library component: wpiutil WPI utility library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated C++ Protobuf MergeImpl causes linker errors Add abseil-cpp as a 3rd party library
2 participants