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

Fails to compile in a empty project #82

Closed
josemanuelp opened this issue Nov 1, 2024 · 4 comments · Fixed by #89 or #90
Closed

Fails to compile in a empty project #82

josemanuelp opened this issue Nov 1, 2024 · 4 comments · Fixed by #89 or #90

Comments

@josemanuelp
Copy link

josemanuelp commented Nov 1, 2024

Issue Report: Compilation Failure with qubit Dependency

Project Setup:
In a minimal "Hello, World" Rust project with only the qubit dependency, the build fails due to missing features in the tower crate.

Steps to Reproduce:

  1. Create a new Rust project:
    cargo new hello_world
    cd hello_world
  2. Add qubit as a dependency in Cargo.toml:
    [dependencies]
    qubit = "0.10.0"
  3. Run cargo build.

Observed Output:
The build fails with the following error messages:

error[E0432]: unresolved import `tower::util`
   --> /path/to/cargo/registry/src/utils.rs:37:12
    |
37  | use tower::util::Oneshot;
    |            ^^^^ could not find `util` in `tower`

error[E0432]: unresolved import `tower::ServiceExt`
   --> /path/to/cargo/registry/src/utils.rs:38:5
    |
38  | use tower::ServiceExt;
    |     ^^^^^^^----------
    |     |      |
    |     |      help: a similar name exists in the module: `Service`
    |     no `ServiceExt` in the root

These errors indicate that tower is attempting to use features that are not enabled by default, such as util.

Temporary Solution:
To resolve the issue temporarily, I added tower as a local dependency to qubit project with the util feature enabled:

cargo add tower --features util

Expected Solution:
For a permanent solution, consider updating the project dependencies so that tower is included with the required features enabled by default.

@josemanuelp josemanuelp changed the title In a empty project fails to compile Fails to compile in a empty project Nov 1, 2024
@andogq
Copy link
Owner

andogq commented Dec 2, 2024

Is this still an issue that you're facing? I tried following your reproduction steps, however it appears to work for me without the error you're mentioning.

I'm planning on upgrading to a more recent tower version anyway, so that may fix the problem if you're still encountering it!

@andogq
Copy link
Owner

andogq commented Dec 2, 2024

I take all of that back. It worked completely fine locally for me (even with a clean cache), however started dying in CI for some reason.

paritytech/jsonrpsee#1464 seems similar (and equally confused), but I'll enable the feature for now until jsonrpsee can be upgraded!

@andogq andogq closed this as completed in #89 Dec 2, 2024
@andogq andogq closed this as completed in 1aec8be Dec 2, 2024
andogq added a commit that referenced this issue Dec 2, 2024
andogq added a commit that referenced this issue Dec 2, 2024
# Version Updates

Merging this PR will release new versions of the following packages
based on your change files.




# qubit

## [0.10.2]
- 1aec8be Enable the `util` feature on `tower` to close #82
@andogq
Copy link
Owner

andogq commented Dec 2, 2024

[email protected] should now work correctly

@josemanuelp
Copy link
Author

Thanks!

And thanks for the great work on this project!

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.

2 participants