apollographql / router

A configurable, high-performance routing runtime for Apollo Federation 🚀
https://www.apollographql.com/docs/router/
Other
814 stars 271 forks source link

Opentelemtry_sdk pulls in async-std #4262

Open semtexzv opened 1 year ago

semtexzv commented 1 year ago

Describe the bug Latest version of apollo-router includes opentelemetry crate with defaults enabled, and somehow this ends up including async_std into the dependency tree.

bnjjj commented 1 year ago

Hmm indeed, good catch. I think it's due to this line https://github.com/apollographql/router/commit/bca9d860424972288eb39e760fbd4faba3c86c9a#diff-aca654efc6c22bebf4bd167370ab3bf380f3e086befe3d7c6761a8f7eb59d89cR139

If we only require that feature in dev-deps I think it will be enough to get rid of async-std in the router deps. I'm not on my computer right now, feel free to open a PR and check it works as expected

bnjjj commented 1 year ago

My bad, it's already part of our dev-deps

nicholascioli commented 10 months ago

Looks like fixing this might require changes to upstream. The issue is that one of the dev-dependencies pulls in the testing feature from opentelemetry_sdk which pulls in all of the supported async runtimes.

A potential fix would be to just copy all of the features currently in the testing set and remove async-std, but since the feature set includes feature flags for dependencies of opentelemetry_sdk and cargo does not allow / in feature sets defined outside of the owning project, this isn't yet possible to do without upstream changes.

(As a note, it does seem like this might be possible in a later edition of rust)