-
Notifications
You must be signed in to change notification settings - Fork 821
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
Do not check in the generated file from proto
#2616
Comments
After I changed the |
My opinion on this topic is that there is a tradeoff: If you check in the generated file, then the required build tools (e.g. protobuf compiler) are not needed for most developers, thus sometimes simplifying the build environment. However, re-generating the file when changes are made is harder as now the special build tools are required. Thus my opinion is that
All the build environments I deal with (Arrow CI, DataFusion CI, IOx CI) all need |
I will check that concerned from you. |
I think a fair compromise in this case is adding documentation to brew / snap / choco install protoc, which should be a single line per OS. |
Our CI jobs probably also need to install protoc which we can point to as another set of instructions of what to use |
☝️ this, 100% scripts as docs never get out of date and the testing is built in :) It's too bad docker doesn't support snaps because more stuff (including protobuf) is being distributed that way. |
Can we verify this, I'm fairly certain this isn't the case. The build.rs will always require these tools, as it will always "generate" the file regardless if it already exists, based on the modification timestamps of the sources. If the source protos are new, e.g. the repo was just checked out, the generation process will be run and protoc will be required. |
Yes -- exactly, we should verify this. If we always regenerate the files anyways, having them checked in seems unnecessary. If we are going to check the in, we should change our build system (e.g. remove build.rs somehow) to not require them. |
BTW there is a related discussion in tikv/pprof-rs#158 (comment) (which is all fallout from prost-build no longer bundling protoc) |
Since what kicked this off was We could modify |
I would personally prefer not to do this. Reasoning:
|
To clarify, I meant |
👍 My point was that I think this solution would only be used for Thus, if the downstream project used protobuf for some other purpose (e.g. datafusion/ballista using it to serialize plans) then that build system for the downstream project still needs to manage an install protobuf itself and then potentially has two versions of protoc (and thus two potential sources of failure):
Maybe this is better for some reason I don't get yet, but it seems like it might be even worse than the current state of affairs |
No, you got it. I just have a strong preference for zero-dev-setup when it can be done. I'm happy enough leaving it unbundled. You've seen the datafusion PR, and that exemplifies what I'm proposing for arrow. Perhaps we can see how that works out and let it inform our decision over here. |
For anyone following along, apache/datafusion#3333 is the datafusion PR |
We ended up checking the generated code into DataFusion in order to avoid people needing to have protoc installed - apache/datafusion#3950 |
The consensus appears to be that we would prefer to not require downstreams to have protoc installed, and so vendoring the source code is where consensus has landed. |
What's your opinions about this? @alamb @carols10cents
I just know java/go don't check in the diff about the generated file in file.
Originally posted by @liukun4515 in #2586 (comment)
The text was updated successfully, but these errors were encountered: