Skip to content
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

Update python and c++ protobuf examples to demonstrate dynamic FileDescriptorSet generation #269

Merged
merged 8 commits into from
Nov 9, 2022

Conversation

jtbandes
Copy link
Member

@jtbandes jtbandes commented Nov 9, 2022

Public-Facing Changes
Updated example Python Protobuf server to demonstrate dynamic generation of FileDescriptorSet schemas.
Updated example C++ server to use Protobuf instead of JSON, including dynamic generation of FileDescriptorSet schemas.

Description
Resolves #255
Resolves #138
Relates to foxglove/mcap#694

Checks in generated files for Python because we have not yet published them in a Python package (foxglove/schemas#71).

Screen.Recording.2022-11-09.at.3.04.21.PM.mov

Copy link
Contributor

@defunctzombie defunctzombie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a few more hundred files between friends?

Committing the files does seem weird from the perspective of every other protobuf codebase I've seen out there. So if they are hard to generate maybe thats by design since you are meant to generate them with whatever build system you've selected?

@jtbandes
Copy link
Member Author

jtbandes commented Nov 9, 2022

It's not that they are hard to generate, but they are hard to generate automatically with CMake (and I didn't even explore generation as part of the python build process). With python I think a nice path forward would be foxglove/schemas#71 but didn't want to block this PR on that. For C++ I am not sure what other options we have...I suppose we could similarly publish a conan package with these files.

@defunctzombie
Copy link
Contributor

For C++ I am not sure what other options we have...I suppose we could similarly publish a conan package with these files.

Isn't it common to generate these in your project? Why would we publish the generated files to conan?

@jtbandes
Copy link
Member Author

jtbandes commented Nov 9, 2022

Hm, I see we already have some of the CMake magic figured out in https://github.com/foxglove/mcap/blob/main/cpp/examples/protobuf/CMakeLists.txt. I will have to see if that can be translated.

@jtbandes
Copy link
Member Author

jtbandes commented Nov 9, 2022

Why would we publish the generated files to conan?

The idea was that that people could import and use foxglove schemas without any extra work.

jtbandes added a commit to foxglove/mcap that referenced this pull request Nov 9, 2022
**Public-Facing Changes**
Fixed FileDescriptorSet generation in protobuf examples to avoid adding duplicate types via transitive dependencies.

**Description**
Supersedes / closes #694

Copied the new implementation from foxglove/ws-protocol#269
@jtbandes jtbandes merged commit c1be7d6 into main Nov 9, 2022
@jtbandes jtbandes deleted the jacob/pb-server-descriptorset-example branch November 9, 2022 23:42
jtbandes added a commit that referenced this pull request Jan 11, 2023
**Public-Facing Changes**
Fixed an import error with the python protobuf example server.

**Description**
Follow-up to #269, using
foxglove/schemas#74 now that it is available.
Fixes #333 
Fixes FG-1402
pezy pushed a commit to pezy/ws-protocol that referenced this pull request Jul 27, 2023
**Public-Facing Changes**
Fixed an import error with the python protobuf example server.

**Description**
Follow-up to foxglove#269, using
foxglove/schemas#74 now that it is available.
Fixes foxglove#333 
Fixes FG-1402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Update examples to dynamically generate FileDescriptorSet Add C++ Protobuf example
2 participants