-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support multiple packages per run #40
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
Conversation
I've tested this locally against github.com/cockroachdb/cockroach, the generated code is identical. @dsymonds PTAL? |
I'm unsure I want to proceed with this. It seems odd. When one compiles a Go program, one doesn't give all the files to the compiler at once and hope the compiler will sort out which files go in which package. Instead, each package is treated as a compilation unit. I understand we're talking about protoc, not gc, but I think the point still stands. |
I disagree. For other languages, protoc supports this functionality; it is not appropriate to use |
Why did these import statements have to change?
|
@awalterschulze I actually manually moved those imports so that the test suite exercises this change. So they're related, but they are not a side effect. In fact, the generated code hasn't changed at all. |
This would be great to get in... this has caused me a lot of headaches when writing automation around protobuffers for go. |
@tamird are you still maintaining this PR ? |
Sure. |
I'm really hoping this can be merged, I'm currently working of a fork with this merged as I require this for proper code generation. |
@tarmird I believe in the goal of this Pull Request. However, I think it would be important to also convert to calculating import aliases per file, instead of globally. Otherwise this is going to introduce even more non-determinism (and hence spurious changes) than the plugin already has: every build could change almost anything. |
@zellyn I'm not going to make any changes here until the maintainers (or some other Google employees) express their support. Feel free to submit your own PR. |
@tamird at this point I don't think there's much hope of getting changes upstreamed. I've written a protoc wrapper that calls protoc one package at a time, and also renames and rewrites the generated files to treat |
@robpike As you know, unlike Go, protobufs can and do include the full target package path. There's no chance of ambiguity, unlike Go packages, so I'm not sure what the downside is? It seems to be an arbitrary restriction with no advantages, and the downside of having to write scripts/tools to implement the same functionality. |
|
Fixes #39.