-
Notifications
You must be signed in to change notification settings - Fork 726
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
core: vendor lazy_static and spin for no_std support #424
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for working on this, I really appreciate it!
I noticed a few things that will need to be addressed before we can merge this — in particular, I think the doctests in the vendored code is breaking the build, and we need to be able to reexport a Once
type in tracing
for the macros to work correctly. Additionally, I think it's important that the vendored code not be publicly accessible to user code, or at least doc(hidden)
when it has to be reexported.
Also, would you mind adding "Fixes #365" to the PR description before we merge this? Thanks! |
Apologies, my first attempt was far more broken than I realised! I tripped over rust-lang/cargo#5015 - I thought I was building without std but I wasn't. Thanks for the detailed feedback! In the end I removed all the spin tests as they depend on std. The lints helped me prune out the things we weren't using. My first thought was to leave the vendored code as close to upstream as possible but I've been nudged towards just including what we need. My only lingering concern is that |
Yes, it would be great if you would do the following:
Then everything should build successfully on CI, and we can publish a new version of |
Hmm, actually... If that's the case, can we just move the vendored |
I guess another possibility is to let |
Hmm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, this looks good to me. thanks so much for working on this!
Added - `Default` impl for `Dispatch` (#411) Fixed - Removed duplicate `lazy_static` dependencies (#424) - Fixed no-std dependencies being enabled even when `std` feature flag is set (#424) - Broken link to `Metadata` in `Event` docs (#461) Signed-off-by: Eliza Weisman <[email protected]>
Added - `Default` impl for `Dispatch` (#411) Fixed - Removed duplicate `lazy_static` dependencies (#424) - Fixed no-std dependencies being enabled even when `std` feature flag is set (#424) - Broken link to `Metadata` in `Event` docs (#461) Signed-off-by: Eliza Weisman <[email protected]>
Following the suggested fix on #365: #365 (comment)
tracing-core's use of
spin
is feature-gated.lazy_static
is vendored for either feature but I've modified it to respect our feature flags. I've also removed doc comments that no longer compile and suppressed a couple of warnings with the lints that are now being applied.At this point
However I feel like a bull in a china closet, copying in gobs of dependencies to an unfamiliar project. Feedback about how best to arrange this will be greatly appreciated!
Fixes #365