Skip to content

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

@olix0r

Description

@olix0r

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-buildC-bugCategory: Something isn't workingE-easyCall for participation: Experience needed to fix: Easy / not muchE-help-wantedCall for participation: Help is requested to fix this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions