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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work in no-std environment #262

Open
koxu1996 opened this issue Jun 14, 2024 · 3 comments
Open

Does not work in no-std environment #262

koxu1996 opened this issue Jun 14, 2024 · 3 comments

Comments

@koxu1996
Copy link
Contributor

I am unable to compile my project due to found duplicate lang item panic_impl, which appears to be caused by std library being indirectly included by rasn 馃槰. Even though this library is claimed as no_std its dependencies are not!

Where std gets included?

Latest rasn v0.8.2 depends on custom nom parser with bitvec:

nom-bitvec = { package = "bitvec-nom2", version = "0.2.0" }

This need to be discussed. Why is it custom? Probably because upstream is not supporting bitvec v1 - see rust-bakery/nom-bitvec#1, and relevant PR got stuck. It seems that @XAMPPRocky released fork as renamed package with tag 0.2.0. The different between fork source code and files published in crates.io made my investigation more difficult.

Okay, so let's use crates.io as the source of truth. You can see that bitvec-nom2 depends on bitvec v1:

image

Default features are not disabled, so std gets included:

image

NOTE: I was able to track it down with cargo tree -e features.

@koxu1996
Copy link
Contributor Author

The second place where std is indirectly included in rasn:

snafu = { version = "0.7", default-features = false, features = ["backtraces"] }

You can see that snafu's backtraces feature is enabling it:

image

NOTE: snafu 0.8.0 removed this feature

@XAMPPRocky
Copy link
Collaborator

XAMPPRocky commented Jun 14, 2024

Thank you for your issue! This is definitely not intentional, we should disable std in my fork and put backtraces behind a feature that is disabled by default.

@koxu1996
Copy link
Contributor Author

Also JER should be put behind a feature, as jzon is not no-std compatible as well.

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