Skip to content
This repository was archived by the owner on Feb 14, 2021. It is now read-only.
This repository was archived by the owner on Feb 14, 2021. It is now read-only.

pwasm-abi-derive is not compatible with no-std libs #54

@Pzixel

Description

@Pzixel

I've tested it with serde, but I'm pretty sure the problem is wider.

Sample code

#![no_std]

extern crate pwasm_ethereum;
#[macro_use]
extern crate serde_derive;
extern crate serde;

Cargo.toml

[package]
name = "pwasm-tutorial-contract"
version = "0.1.0"
authors = ["Alexey Frolov <[email protected]>"]

[dependencies]
pwasm-std = "0.9"
pwasm-ethereum = "0.5"
pwasm-abi = "0.1.2"
pwasm-abi-derive = "0.1.2"
serde_derive = { version = "1.0", default-features = false }
serde = { version = "1.0", default-features = false }

[lib]
crate-type = ["cdylib"]

[profile.release]
panic = "abort"
lto = true
opt-level = "z"

Expected result

everything compiles

Actual result:

$ ./build.sh
   Compiling pwasm-tutorial-contract v0.1.0 (file:///C:/Users/Alex/Documents/Repo/pwasm-tutorial/step-0)
warning: unused `#[macro_use]` import
 --> src\lib.rs:6:1
  |
6 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

error: duplicate lang item in crate `std`: `panic_impl`.
  |
  = note: first defined in crate `pwasm_std`.

error: duplicate lang item in crate `std`: `oom`.
  |
  = note: first defined in crate `pwasm_std`.

error: aborting due to 2 previous errors

error: Could not compile `pwasm-tutorial-contract`.

P.S.

Combinations that work:

  • Cargo.toml without pwasm-abi-derive = "0.1.2"
  • lib.rs without extern crate serde;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions