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

tonic-build: Regression in generated code dependency surface area #683

Closed
olix0r opened this issue Jun 16, 2021 · 2 comments
Closed

tonic-build: Regression in generated code dependency surface area #683

olix0r opened this issue Jun 16, 2021 · 2 comments
Labels
A-build C-bug Category: Something isn't working E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@olix0r
Copy link
Contributor

olix0r commented Jun 16, 2021

Bug Report

6c898a2 appears have to introduced a regression of sorts in tonic-build: now that futures_core is explicitly referenced in generated code, code that would previously compile now fails with, e.g.:

error[E0433]: failed to resolve: use of undeclared crate or module `futures_core`
    |
277 | ...erve method."] type ObserveStream : futures_core :: Stream < Item = Result < super :: TapEvent , tonic :: Status >> + Send + Sync + 's...
    |                                        ^^^^^^^^^^^^ use of undeclared crate or module `futures_core`

I assume that this means that applications need to pull in a dependency on futures-core explicitly? It seems preferable for tonic to re-export everything generated code depends on so that applications don't have to worry about these dependencies. I.e., generated code should depend on something like ::tonic_codegen::Stream

@olix0r olix0r changed the title tonic-build: Regression tonic-build: Regression in generated code dependency surface area Jun 16, 2021
@davidpdrsn
Copy link
Member

Totally! We should make Stream part of the codegen module and use that re-export from the generated code.

@davidpdrsn davidpdrsn added A-build C-bug Category: Something isn't working E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue. labels Jun 16, 2021
@olix0r
Copy link
Contributor Author

olix0r commented Jun 16, 2021

Actually, I was wrong about the cause: I updated tonic-build without updating tonic (thanks, Dependabot). So, the futures_core re-export was missing in generated code.

I think technically 6c898a2 was an API breakage, but I'm okay now that I've just updated tonic.

@olix0r olix0r closed this as completed Jun 16, 2021
olix0r added a commit to linkerd/linkerd2-proxy that referenced this issue Jun 16, 2021
We updated tonic-build without updating tonic. There was a hidden API
breakage such that the old tonic version could not be used.

See hyperium/tonic#683
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build C-bug Category: Something isn't working E-easy Call for participation: Experience needed to fix: Easy / not much E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

2 participants