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

grpc-gen-swift generates all dependency protos instead of only requested ones #1057

Closed
jagobagascon opened this issue Nov 27, 2020 · 6 comments · Fixed by #1058
Closed

grpc-gen-swift generates all dependency protos instead of only requested ones #1057

jagobagascon opened this issue Nov 27, 2020 · 6 comments · Fixed by #1058
Labels
kind/bug Feature doesn't work as expected.

Comments

@jagobagascon
Copy link
Contributor

Describe the bug

We recently upgraded form version alpha.14 to alpha.20. After this change, when we try to generate a proto that has a dependency on another proto, the generator is creating code for both protos (and not only the requested one).

Let's say foo.proto depends on bar.proto, we generate both independently and move each of them to a different swift module. After upgrading to alpha.20 generating foo.proto is creating files for bar.proto (which I think is wrong).

foo/
    foo.grpc.swift
    bar.grpc.swift <-- This should not be created when generating code using only foo.proto
bar/
    bar.grpc.swift

To reproduce

I created this repo for another bug, but it can be reproduced by calling make generate in it: ModuleB will contain code generated from b.proto and ModuleA will contain both code generated from a.proto and also b.proto.
https://github.com/jagobagascon/grpc-swift-modules-test

Expected behaviour

grpc compiler should only generate code for explicitly passed protos, not its dependencies.

Additional information

This happened in the past and was fixed in this PR. I think this is a regression added in this commit.

Unless it was added by some reason, I think that reverting back to the change made by the PR should fix this problem.

@jagobagascon jagobagascon added the kind/bug Feature doesn't work as expected. label Nov 27, 2020
glbrntt added a commit to glbrntt/grpc-swift that referenced this issue Nov 27, 2020
Motivation:

Code should only be generated for files listed in the codegen request.
This regressed in grpc#889.

Modifications:

- Drive code generation from files to generate

Result:

Resolves grpc#1057
glbrntt added a commit to glbrntt/grpc-swift that referenced this issue Nov 27, 2020
Motivation:

Code should only be generated for files listed in the codegen request.
This regressed in grpc#889.

Modifications:

- Drive code generation from files to generate

Result:

Resolves grpc#1057
@glbrntt
Copy link
Collaborator

glbrntt commented Nov 27, 2020

Agh, sorry for regressing this @jagobagascon.

glbrntt added a commit that referenced this issue Nov 30, 2020
Motivation:

Code should only be generated for files listed in the codegen request.
This regressed in #889.

Modifications:

- Drive code generation from files to generate

Result:

Resolves #1057
@jagobagascon
Copy link
Contributor Author

Thank you for the quick response!

@jagobagascon
Copy link
Contributor Author

Hi! This issue is messing with our automated build (the code does not compile) and we want to avoid using a specific commit so, is it too much to ask for an alpha.22 release? 😇
Anyway it would be really helpful to know when it's planned. To add a temporary fix or just wait for the release.

Thanks!

@glbrntt
Copy link
Collaborator

glbrntt commented Dec 9, 2020

There are a couple of outstanding PRs which I'd like to get merged then I'll happily tag a release for you. ETA is next couple of days if that's not too big a problem for you?

@jagobagascon
Copy link
Contributor Author

Two days is completely acceptable 😄 . Thank you very much!

@glbrntt
Copy link
Collaborator

glbrntt commented Dec 15, 2020

@jagobagascon done! Thanks for your patience with this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Feature doesn't work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants