Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add WASM CI checks and make availability-store compile for WASM #626

Merged
merged 4 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copy-pasted these lines but I have no idea what they are.

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