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

feat(axum-core): move axum::Router to axum-core #3244

Closed
1 task done
dzmitry-lahoda opened this issue Mar 4, 2025 · 3 comments
Closed
1 task done

feat(axum-core): move axum::Router to axum-core #3244

dzmitry-lahoda opened this issue Mar 4, 2025 · 3 comments

Comments

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Mar 4, 2025

  • I have looked for existing issues (including closed) about this

Feature Request

move axum::Router to axum-core

Motivation

because tonic uses it
https://github.com/hyperium/tonic/blob/72b0fd59442d71804d4104e313ef6f140ab8f6d1/tonic/src/service/mod.rs#L15

because open-telemetry/opentelemetry-rust#2720

and I got weird build issues.

so I expect such low level libs to use axum-core, not axum (they actually do not even use axum web api features, just tonic uses some nice code from axum).

Proposal

  • axum_core::routing::Router and relevant code enough to move tonic from axum to axum-core.

Alternatives

  • patch when needed
[patch.crates-io]
# i used axum-extra 0.10 which works on only with axum 0.8
# while opentelemetry drags all features tonic which drags axum 0.7.9
# but we do not use axum integration of opentelemetry at all...
tonic = { rev = "ab19a89ccf7b57de59942e3d334b36dd4af137be", git = "https://github.com/dzmitry-lahoda-forks/tonic/"}
  • why at all tonic depends on axum::Router, can we somehow use opentelemetry with tonic but without axum::Router? may be tonic need to be fixed?
@dzmitry-lahoda
Copy link
Author

I can do it if it is fine to do so.

@jplatte
Copy link
Member

jplatte commented Mar 4, 2025

axum-core is the minimal building blocks for implementing extractors and response types. Router is way more complex, moving it there would defeat the purpose of the core crate.

@jplatte jplatte closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2025
@jplatte
Copy link
Member

jplatte commented Mar 4, 2025

I don't know why tonic depends on axum by the way, you should ask tonic and not us.

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

No branches or pull requests

2 participants