Skip to content

Commit

Permalink
Add WASM CI checks and make availability-store compile for WASM (pari…
Browse files Browse the repository at this point in the history
…tytech#626)

* Make availability-store compile for WASM

* Use --manifest-path instead
  • Loading branch information
tomaka authored and gavofyork committed Nov 29, 2019
1 parent 6eb9c71 commit 5598ed9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ variables:
.docker-env: &docker-env
retry:
max: 2
when:
when:
- runner_system_failure
- unknown_failure
- api_failure
Expand Down Expand Up @@ -131,6 +131,23 @@ test-linux-stable: &test
- sccache -s


check-web-wasm: &test
stage: test
<<: *test-refs
<<: *docker-env
<<: *compiler_info
script:
# WASM support is in progress. As more and more crates support WASM, we
# should add entries here. See https://github.com/paritytech/polkadot/issues/625
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path availability-store/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path executor/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path erasure-coding/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path parachain/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path primitives/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path rpc/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path runtime/Cargo.toml
- time cargo build --locked --target=wasm32-unknown-unknown --manifest-path statement-table/Cargo.toml
- sccache -s


build-linux-release: &build
Expand Down Expand Up @@ -209,7 +226,7 @@ publish-docker-release:
- docker build
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--tag $CONTAINER_IMAGE:$VERSION
--tag $CONTAINER_IMAGE:$VERSION
--tag $CONTAINER_IMAGE:$EXTRATAG .
- docker push $CONTAINER_IMAGE:$VERSION
- docker push $CONTAINER_IMAGE:$EXTRATAG
Expand Down
4 changes: 3 additions & 1 deletion availability-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@ log = "0.4.8"
codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] }
substrate-primitives = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" }
kvdb = "0.1.1"
kvdb-rocksdb = "0.2"
kvdb-memorydb = "0.1.2"

[target.'cfg(not(target_os = "unknown"))'.dependencies]
kvdb-rocksdb = "0.2"
3 changes: 2 additions & 1 deletion availability-store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

use codec::{Encode, Decode};
use kvdb::{KeyValueDB, DBTransaction};
use kvdb_rocksdb::{Database, DatabaseConfig};
use polkadot_primitives::Hash;
use polkadot_primitives::parachain::{Id as ParaId, BlockData, Message};
use log::warn;
Expand Down Expand Up @@ -74,7 +73,9 @@ pub struct Store {

impl Store {
/// Create a new `Store` with given config on disk.
#[cfg(not(target_os = "unknown"))]
pub fn new(config: Config) -> io::Result<Self> {
use kvdb_rocksdb::{Database, DatabaseConfig};
let mut db_config = DatabaseConfig::with_columns(Some(columns::NUM_COLUMNS));

if let Some(cache_size) = config.cache_size {
Expand Down

0 comments on commit 5598ed9

Please sign in to comment.