Skip to content

Commit

Permalink
fix: wasmer1_default feature actually selects wasmer1 (#4281)
Browse files Browse the repository at this point in the history
We use this feature in ./runtime/near-vm-runner/src/vm_kind.rs.

So, it should be declared in `vm_runner` Cargo.toml rather than in
`vm_logic`.

This is #4279 submitted against master. 

Not sure how to make sure that similar errors don't happen in the future. The culprit here is that you can have `cfg(feature = "some-typo")`, and you won't see any warnings about this anywhere...
  • Loading branch information
matklad authored May 7, 2021
1 parent 884c6d1 commit 354c7a5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 0 additions & 4 deletions runtime/near-vm-logic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ protocol_feature_evm = ["near-primitives-core/protocol_feature_evm"]
protocol_feature_alt_bn128 = ["bn", "near-primitives-core/protocol_feature_alt_bn128", "near-vm-errors/protocol_feature_alt_bn128"]
protocol_feature_allow_create_account_on_delete = []

wasmer0_default = []
wasmtime_default = []
wasmer1_default = []

# Use this feature to enable counting of fees and costs applied.
costs_counting = ["near-primitives-core/costs_counting"]

Expand Down
5 changes: 5 additions & 0 deletions runtime/near-vm-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ default = ["wasmer0_vm", "wasmtime_vm", "wasmer1_vm"]
wasmer0_vm = [ "wasmer-runtime" ]
wasmtime_vm = [ "wasmtime", "anyhow"]
wasmer1_vm = [ "wasmer", "wasmer-types", "wasmer-compiler-singlepass", "wasmer-compiler-cranelift", "wasmer-engine-native", ]

wasmer0_default = []
wasmtime_default = []
wasmer1_default = []

lightbeam = ["wasmtime/lightbeam"]
no_cpu_compatibility_checks = []
protocol_feature_evm = ["near-primitives/protocol_feature_evm", "near-evm-runner/protocol_feature_evm"]
Expand Down
2 changes: 1 addition & 1 deletion runtime/runtime-params-estimator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ costs_counting = ["near-vm-logic/costs_counting"]
# Required feature for proper config, but can't be enabled by default because it is leaked to other release crates.
required = ["costs_counting", "near-vm-runner/no_cpu_compatibility_checks", "no_cache"]
no_cache = ["node-runtime/no_cache", "near-store/no_cache"]
wasmtime = ["near-vm-logic/wasmtime_default"]
wasmtime = ["near-vm-runner/wasmtime_default"]
lightbeam = ["wasmtime", "near-vm-runner/lightbeam"]
nightly_protocol = ["near-primitives/nightly_protocol"]
nightly_protocol_features = ["protocol_feature_alt_bn128", "protocol_feature_evm"]
Expand Down
6 changes: 3 additions & 3 deletions runtime/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ protocol_feature_evm = ["near-evm-runner/protocol_feature_evm", "near-primitives
wasmer1_vm = ["near-vm-runner/wasmer1_vm"]
wasmer0_vm = ["near-vm-runner/wasmer0_vm"]
wasmtime_vm = ["near-vm-runner/wasmtime_vm"]
wasmer1_default = ["wasmer1_vm", "near-vm-logic/wasmer1_default"]
wasmer0_default = ["wasmer0_vm", "near-vm-logic/wasmer0_default"]
wasmtime_default = ["wasmtime_vm", "near-vm-logic/wasmtime_default"]
wasmer1_default = ["wasmer1_vm", "near-vm-runner/wasmer1_default"]
wasmer0_default = ["wasmer0_vm", "near-vm-runner/wasmer0_default"]
wasmtime_default = ["wasmtime_vm", "near-vm-runner/wasmtime_default"]

no_cpu_compatibility_checks = [ "near-vm-runner/no_cpu_compatibility_checks"]

Expand Down

0 comments on commit 354c7a5

Please sign in to comment.