Skip to content

Feature gate heavy tracing dependencies #549

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

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

nathanwhit
Copy link
Member

There were some concerns raised about chalk's dependency on tracing, tracing-subscriber, and tracing-tree, particularly in how they might affect the compilation time and binary size of rust-analyzer.

This PR experimentally gates tracing-subscriber, tracing-tree, and the attributes feature of tracing behind a new feature tracing-full. The handling of the instrument attribute macro from tracing (which only works with the attributes feature enabled) is in particular a bit hacky. In order to avoid manually adding cfg_attr to each usage of the instrument macro, this PR creates a wrapper macro exported from chalk-derive which does so.

Copy link
Member

@jackh726 jackh726 left a comment

Choose a reason for hiding this comment

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

I'm okay with the tracing-full feature flag, but I don't think we want to gate instrument at all.

@nathanwhit
Copy link
Member Author

nathanwhit commented Jul 1, 2020

I'm okay with the tracing-full feature flag, but I don't think we want to gate instrument at all.

I looked into this a bit more and indeed gating instrument doesn't seem to have much of a benefit in terms of compilation time or binary size (which makes sense, the only heavy dependency it uses is syn which we already depend on).

Just pushed some changes so now we don't gate instrument.

@nathanwhit nathanwhit changed the title Experiment: Feature gate heavy tracing dependencies Feature gate heavy tracing dependencies Jul 1, 2020
@jackh726 jackh726 merged commit e7d8893 into rust-lang:master Jul 1, 2020
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.

3 participants