0

I try to use barebones-x509 which is no_std friendly to parse x509 certificate. But encounter the mistake. Will you have some advice?

error: duplicate lang item in crate `std` (which `barebones_x509` depends on): `panic_impl`.                                                                                          
  |
  = note: the lang item is first defined in crate `ink_env` (which `blbc` depends on)
  = note: first definition in `ink_env` loaded from \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libink_env-08ee0ee200503572.rlib, \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libink_env-08ee0ee200503572.rmeta
  = note: second definition in `std` loaded from \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libstd-5c2faf671e59e752.rlib, \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libstd-5c2faf671e59e752.rmeta

error: duplicate lang item in crate `std` (which `barebones_x509` depends on): `oom`.
  |
  = note: the lang item is first defined in crate `ink_allocator` (which `ink_env` depends on)
  = note: first definition in `ink_allocator` loaded from \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libink_allocator-3d57f925da559e39.rlib, \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libink_allocator-3d57f925da559e39.rmeta
  = note: second definition in `std` loaded from \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libstd-5c2faf671e59e752.rlib, \\?\F:\CLIONproject\github\blbc\target\ink\wasm32-unknown-unknown\release\deps\libstd-5c2faf671e59e752.rmeta
3

1 Answer 1

1

This is likely because you are not using the correct features for barebones-x509 in your Cargo.toml. To be sure you would have to post it.

I suspect that you are missing something like this:

@@ -11,6 +11,8 @@ ink = { path = "../../crates/ink", default-features = false }
 scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
 scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
 
+barebones-x509 = { version = "0.5.2", default-features = false }
+
 [dev-dependencies]
 ink_e2e = { path = "../../crates/e2e" }
 
@@ -25,6 +27,7 @@ std = [
     "ink/std",
     "scale/std",
     "scale-info/std",
+    "barebones-x509/std"
 ]
 ink-as-dependency = []

It's hard to tell though without knowing how you depend on the crate. Please post your Cargo.toml if it still doesn't work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.