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

Macros Won't Build in no_std #40

Closed
mriise opened this issue Nov 2, 2020 · 4 comments
Closed

Macros Won't Build in no_std #40

mriise opened this issue Nov 2, 2020 · 4 comments

Comments

@mriise
Copy link
Contributor

mriise commented Nov 2, 2020

While trying to build with a common no_std target thumbv6m-none-eabi.
Changing data-encoding-macro-internal's Cargo.toml to use the the alloc feature allowed for a clean build.
data-encoding = { version = "2.3", path = "../..", default-features = false, features = ["alloc"] }

thumbv6m-none-eabi should probably be added to the CI build list for next time around :)

@mriise
Copy link
Contributor Author

mriise commented Nov 2, 2020

Aaaaand I just read your comment multiformats/rust-multibase#25 (comment)

@ia0
Copy link
Owner

ia0 commented Nov 2, 2020

The macro doesn't need the alloc feature to work, so it shouldn't be necessary to change its dependencies.

The problem is due to rust-lang/cargo#7915 where cargo leaks features of compile-time dependencies like proc-macro. The current fix is to use the host_dep unstable feature for now until it gets stable. Does this fix your issue?

@mriise
Copy link
Contributor Author

mriise commented Nov 2, 2020

@ia0 yes, I was going to close this with my last comment but figured it might be good for anyone else who comes across the problem. Maybe a quick note in the README for the macro lib to prevent others falling into the same hole?

@ia0
Copy link
Owner

ia0 commented Nov 2, 2020

Good point. I updated the README and documentation.

@ia0 ia0 closed this as completed Nov 2, 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

No branches or pull requests

2 participants