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

chore: tonic with no default deps #2721

Closed

Conversation

dzmitry-lahoda
Copy link

@dzmitry-lahoda dzmitry-lahoda commented Feb 26, 2025

Fixes #2720

Changes

tonic with no default features excludes axum from cargo tree

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.3%. Comparing base (11ed8e0) to head (75c1610).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2721   +/-   ##
=====================================
  Coverage   79.3%   79.3%           
=====================================
  Files        123     123           
  Lines      22670   22670           
=====================================
  Hits       17986   17986           
  Misses      4684    4684           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dzmitry-lahoda
Copy link
Author

but in tonic

router = ["dep:axum", "dep:tower", "tower?/util"]
server = [
  "router",
  "dep:h2",
  "dep:hyper", "hyper?/server",
  "dep:hyper-util", "hyper-util?/service", "hyper-util?/server-auto",
  "dep:socket2",
  "dep:tokio", "tokio?/macros", "tokio?/net", "tokio?/time",
  "tokio-stream/net",
  "dep:tower", "tower?/util", "tower?/limit",
]

so using of server leads to axum.

so fix is only partial in here

@@ -19,7 +19,7 @@ opentelemetry_sdk = { path = "../../opentelemetry-sdk", features = ["rt-tokio"]
opentelemetry-stdout = { workspace = true, features = ["trace"] }
prost = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tonic = { workspace = true, features = ["server"] }
tonic = { workspace = true, default-features = false, features = ["server"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - this would conflict with #2710 based on whichever is merged first.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented, may be these can be made in sync. "server" seems conflicts on deeper "tonic" level and not fix possible without tonic patch.

@@ -34,7 +34,7 @@ opentelemetry-proto = { version = "0.28", path = "../opentelemetry-proto", defau
tracing = {workspace = true, optional = true}

prost = { workspace = true, optional = true }
tonic = { workspace = true, optional = true }
tonic = { workspace = true, default-features = false, optional = true }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it required to state defaut-features=false here, given it is already in the workspace?

@dzmitry-lahoda
Copy link
Author

i see was fixed in other pr, so closing this

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 this pull request may close these issues.

chore: when depend on tonic, use it with default-features = falseh
3 participants