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

raw-cpuid 4.0.0 depends on heavyweight serde crate #27

Closed
ColinFinck opened this issue Jul 12, 2018 · 6 comments
Closed

raw-cpuid 4.0.0 depends on heavyweight serde crate #27

ColinFinck opened this issue Jul 12, 2018 · 6 comments

Comments

@ColinFinck
Copy link
Contributor

raw-cpuid is advertised as "A library to parse the x86 CPUID instruction, written in rust with no external dependencies" and until 3.1.0, this was the case.

However, the recent 4.0.0 release added a dependency to the heavyweight "serde" crate.
While that was an optional feature when introduced by @alex-mckenna in ef3a6f5, it quietly became a hard dependency in 686a7c5 by @gz

Please make "serde" optional again in a subsequent release to keep raw-cpuid a small and universal crate.

ColinFinck added a commit to hermit-os/kernel that referenced this issue Jul 12, 2018
@gz
Copy link
Owner

gz commented Jul 12, 2018

Hi, just for clarification what do you consider heavy-weight? You can (or should) still compile raw-cpuid for no_std environments even with serde.

I'm perfectly ok with making serde optional if there is good reason for it. My change was mostly because I didn't want unnecessary complexity due to feature pollution since serde does compile just fine for no_std and we only use it for trait derivations.

@lachlansneff
Copy link

I've been having issues with serde compiling incorrectly when using this on a no_std environment. Please move it back.

gz added a commit that referenced this issue Jul 13, 2018
Signed-off-by: Gerd Zellweger <mail@gerdzellweger.com>
@gz
Copy link
Owner

gz commented Jul 13, 2018

Thanks for reporting this. I released cpuid 5.0 on which makes serde an optional dependcy again.
I'd be curious to know what breaks for you when using serde on no_std (maybe we should report it to serde itself.

But it may be best to require for all dependencies to always be optional for this particular crate...

@lachlansneff @ColinFinck please let me know if there are still issues with 5.0

@gz gz closed this as completed Jul 13, 2018
@ColinFinck
Copy link
Contributor Author

Thanks for the prompt reply!
While I haven't witnessed actual build problems, the build time for my Rust-based kernel doubled with raw-cpuid 4.0.0 due to the "serde" dependency and all other packages it depends on.
Will try version 5.0.

@phil-opp
Copy link

@gz

I'd be curious to know what breaks for you when using serde on no_std

I had a similar issue reported at rust-osdev/cargo-xbuild: rust-osdev/cargo-xbuild#10. After some investigation it seems like it is a cargo issue: rust-lang/cargo#5730

@gz
Copy link
Owner

gz commented Jul 16, 2018

@phil-opp Thanks that's good to know!

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

4 participants