Skip to content

Commit

Permalink
chore: fix serde std flags for no-std build (bluealloy#987)
Browse files Browse the repository at this point in the history
* use serde as no-std

* optional serde std

* delete comment #"std"

* "preserve_order"

* revme revert

* Update bins/revme/Cargo.toml

---------

Co-authored-by: Leo Alt <leo@ethereum.org>
  • Loading branch information
CeciliaZ030 and Leo Alt authored Jan 18, 2024
1 parent 0629883 commit b330f14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/interpreter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ rustdoc-args = ["--cfg", "docsrs"]
revm-primitives = { path = "../primitives", version = "1.3.0", default-features = false }

# optional
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
serde = { version = "1.0", default-features = false, features = ["derive", "rc"], optional = true }

[features]
default = ["std"]
std = ["revm-primitives/std"]
std = ["serde?/std", "revm-primitives/std"]
serde = ["dep:serde", "revm-primitives/serde"]
arbitrary = ["std", "revm-primitives/arbitrary"]
asm-keccak = ["revm-primitives/asm-keccak"]
Expand Down
5 changes: 3 additions & 2 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ enumn = "0.1"
derive_more = { version = "0.99", optional = true }

# optional
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
serde = { version = "1.0", default-features = false, features = ["derive", "rc"], optional = true }

[build-dependencies]
hex = "0.4"
hex = { version = "0.4", default-features = false }

[features]
default = ["std", "c-kzg"]
std = [
"serde?/std",
"alloy-primitives/std",
"hex/std",
"bitvec/std",
Expand Down
6 changes: 3 additions & 3 deletions crates/revm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ revm-precompile = { path = "../precompile", version = "2.2.0", default-features
auto_impl = { version = "1.1", default-features = false }

# Optional
serde = { version = "1.0", features = ["derive", "rc"], optional = true }
serde_json = { version = "1.0", features = ["preserve_order"], optional = true }
serde = { version = "1.0", default-features = false, features = ["derive", "rc"], optional = true }
serde_json = { version = "1.0", default-features = false, features = ["alloc", "preserve_order"], optional = true }

# ethersdb
tokio = { version = "1.35", features = [
Expand All @@ -42,7 +42,7 @@ indicatif = "0.17"

[features]
default = ["std", "c-kzg", "secp256k1"]
std = ["revm-interpreter/std", "revm-precompile/std"]
std = ["serde?/std", "serde_json?/std", "revm-interpreter/std", "revm-precompile/std"]
serde = ["dep:serde", "dep:serde_json", "revm-interpreter/serde"]
arbitrary = ["revm-interpreter/arbitrary"]
asm-keccak = ["revm-interpreter/asm-keccak", "revm-precompile/asm-keccak"]
Expand Down

0 comments on commit b330f14

Please sign in to comment.