Skip to content

Commit 61248e3

Browse files
Cargo bug workaround (#1564)
* Remove mock feature * Bump versions * Script to publish runtime packages * Merge branch 'staging' into wasm32_fix
1 parent d9f44b2 commit 61248e3

File tree

8 files changed

+40
-41
lines changed

8 files changed

+40
-41
lines changed

Cargo.lock

+16-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/near-runtime-fees/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "near-runtime-fees"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["Near Inc <hello@nearprotocol.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

runtime/near-vm-errors/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "near-vm-errors"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["Near Inc <hello@nearprotocol.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

runtime/near-vm-logic/Cargo.toml

+5-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "near-vm-logic"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["Near Inc <hello@nearprotocol.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -14,10 +14,9 @@ This crate implements the specification of the interface that Near blockchain ex
1414

1515
[dependencies]
1616
bs58 = "0.3"
17-
sodiumoxide = { version = "0.2.5", optional = true }
1817
serde = { version = "1.0", features = ["derive"] }
19-
near-runtime-fees = { path = "../near-runtime-fees", version = "0.3.1" }
20-
near-vm-errors = { path = "../near-vm-errors", version = "0.3.1" }
18+
near-runtime-fees = { path = "../near-runtime-fees", version = "0.3.2" }
19+
near-vm-errors = { path = "../near-vm-errors", version = "0.3.2" }
2120

2221
[dev-dependencies]
2322
serde_json = {version= "1.0", features= ["preserve_order"]}
@@ -26,39 +25,30 @@ serde_json = {version= "1.0", features= ["preserve_order"]}
2625
[[test]]
2726
name = "test_storage_read_write"
2827
path = "tests/test_storage_read_write.rs"
29-
required-features = ["mocks"]
3028

3129
[[test]]
3230
name = "test_context"
3331
path = "tests/test_context.rs"
34-
required-features = ["mocks"]
3532

3633
[[test]]
3734
name = "test_miscs"
3835
path = "tests/test_miscs.rs"
39-
required-features = ["mocks"]
4036

4137
[[test]]
4238
name = "test_registers"
4339
path = "tests/test_registers.rs"
44-
required-features = ["mocks"]
4540

4641
[[test]]
4742
name = "test_storage_usage"
4843
path = "tests/test_storage_usage.rs"
49-
required-features = ["mocks"]
5044

5145
[[test]]
5246
name = "test_promises"
5347
path = "tests/test_promises.rs"
54-
required-features = ["mocks"]
5548

5649
[[test]]
5750
name = "test_iterators"
5851
path = "tests/test_iterators.rs"
59-
required-features = ["mocks"]
6052

61-
[features]
62-
default = []
63-
# Mocks include some unsafe code to workaround lifetimes and therefore are optional.
64-
mocks = ["sodiumoxide"]
53+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
54+
sodiumoxide = "0.2.5"

runtime/near-vm-logic/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod context;
33
mod dependencies;
44
mod gas_counter;
55
mod logic;
6-
#[cfg(feature = "mocks")]
6+
#[cfg(not(target_arch = "wasm32"))]
77
pub mod mocks;
88
pub mod serde_with;
99

runtime/near-vm-runner-standalone/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "near-vm-runner-standalone"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["Near Inc <hello@nearprotocol.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -21,5 +21,5 @@ to make sure it has expected behavior once deployed to the blockchain.
2121
[dependencies]
2222
serde_json = "1.0"
2323
clap = "2.33.0"
24-
near-vm-logic = { path = "../near-vm-logic", features = ["mocks"], version = "0.3.1"}
25-
near-vm-runner = { path = "../near-vm-runner", version = "0.3.1" }
24+
near-vm-logic = { path = "../near-vm-logic", version = "0.3.2"}
25+
near-vm-runner = { path = "../near-vm-runner", version = "0.3.2" }

runtime/near-vm-runner/Cargo.toml

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "near-vm-runner"
3-
version = "0.3.1"
3+
version = "0.3.2"
44
authors = ["Near Inc <hello@nearprotocol.com>"]
55
edition = "2018"
66
license = "Apache-2.0"
@@ -16,13 +16,12 @@ This crate implements the specification of the interface that Near blockchain ex
1616
cached = "0.9.0"
1717
wasmer-runtime = { version = "0.7.0", features = ["singlepass"] }
1818
wasmer-runtime-core = { version = "0.7.0"}
19-
near-vm-logic = { path="../near-vm-logic", version = "0.3.1"}
20-
near-vm-errors = { path = "../near-vm-errors", version = "0.3.1" }
19+
near-vm-logic = { path="../near-vm-logic", version = "0.3.2"}
20+
near-vm-errors = { path = "../near-vm-errors", version = "0.3.2" }
2121
pwasm-utils = "0.11.0"
2222
parity-wasm = "0.40.1"
2323

2424
[dev-dependencies]
25-
near-vm-logic = { path="../near-vm-logic", features=["mocks"], version = "0.3.0"}
2625
assert_matches = "1.3.0"
2726
wabt = "0.9"
2827
bencher = "0.1.5"

runtime/publish.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
for p in near-runtime-fees near-vm-errors near-vm-logic near-vm-runner near-vm-runner-standalone
4+
do
5+
pushd ./${p}
6+
cargo publish
7+
popd
8+
# Sleep a bit to let the previous package upload to crates.io. Otherwise we fail publishing checks.
9+
sleep 10
10+
done

0 commit comments

Comments
 (0)