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

Update tower version to fix build issue #553

Closed
ShawnROGrady opened this issue Feb 3, 2021 · 0 comments · Fixed by #554
Closed

Update tower version to fix build issue #553

ShawnROGrady opened this issue Feb 3, 2021 · 0 comments · Fixed by #554

Comments

@ShawnROGrady
Copy link

ShawnROGrady commented Feb 3, 2021

Bug Report

Version

tonic v0.4.0

Description

I tried updating tonic for one of my projects to finish migrating to v1 of tokio and began seeing build issues:

Compiling tower v0.4.0
error[E0432]: unresolved imports `tower_layer::layer_fn`, `tower_layer::LayerFn`
 --> /Users/Shawn/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tower-0.4.0/src/util/boxed/sync.rs:1:19
  |
1 | use tower_layer::{layer_fn, LayerFn};
  |                   ^^^^^^^^  ^^^^^^^
  |                   |         |
  |                   |         no `LayerFn` in the root
  |                   |         help: a similar name exists in the module: `Layer`
  |                   no `layer_fn` in the root

error[E0432]: unresolved imports `tower_layer::layer_fn`, `tower_layer::LayerFn`
 --> /Users/Shawn/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/tower-0.4.0/src/util/boxed/unsync.rs:1:19
  |
1 | use tower_layer::{layer_fn, LayerFn};
  |                   ^^^^^^^^  ^^^^^^^
  |                   |         |
  |                   |         no `LayerFn` in the root
  |                   |         help: a similar name exists in the module: `Layer`
  |                   no `layer_fn` in the root

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0432`.
error: could not compile `tower`.

It appears as though this issue has been fixed in a newer version of tower (release: https://github.com/tower-rs/tower/releases/tag/tower-0.4.1, commit: tower-rs/tower@b447771)

EDIT: this may be a cargo issue because explicitly adding tower = { version = "0.4.1" } to my Cargo.toml (I'm not directly depending on tower so I didn't previously have this dependency) resolved the issue. Still might be best to update tonic/Cargo.toml to set the tower version to ^0.4.1 so others don't run in to similar issues updating.

davidpdrsn added a commit to davidpdrsn/tonic that referenced this issue Feb 3, 2021
In tower 0.4.0 we missed a couple of re-exports that tonic 0.4.0 depends
on. So tonic really depends on tower at least version 0.4.1. Since
specifying your tower depedency as 0.4 means you might get 0.4.0, you
might get build errors when updating tonic. Such as [hyperium#553] and [hyperium#552].

This fixes that by bumping tonic's dependency on tower to 0.4.4. That
means users will get at least tower version 0.4.4, but semver compatible
updates are still allowed.

[hyperium#553]: hyperium#553
[hyperium#552]: hyperium#552
davidpdrsn added a commit to davidpdrsn/tonic that referenced this issue Feb 3, 2021
In tower 0.4.0 we missed a couple of re-exports that tonic 0.4.0 depends
on. So tonic really depends on tower at least version 0.4.1. Since
specifying your tower depedency as 0.4 means you might get 0.4.0, you
might get build errors when updating tonic. Such as [hyperium#553] and [hyperium#552].

This fixes that by bumping tonic's dependency on tower to 0.4.4. That
means users will get at least tower version 0.4.4, but semver compatible
updates are still allowed.

Fixes hyperium#553

[hyperium#553]: hyperium#553
[hyperium#552]: hyperium#552
LucioFranco pushed a commit that referenced this issue Feb 12, 2021
In tower 0.4.0 we missed a couple of re-exports that tonic 0.4.0 depends
on. So tonic really depends on tower at least version 0.4.1. Since
specifying your tower depedency as 0.4 means you might get 0.4.0, you
might get build errors when updating tonic. Such as [#553] and [#552].

This fixes that by bumping tonic's dependency on tower to 0.4.4. That
means users will get at least tower version 0.4.4, but semver compatible
updates are still allowed.

Fixes #553

[#553]: #553
[#552]: #552
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant