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

Commit 0a98033

Browse files
committed
Merge branch 'master' into overlay_change
2 parents 9904c4f + 5025e6a commit 0a98033

File tree

415 files changed

+17166
-8545
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

415 files changed

+17166
-8545
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ tab_width=4
66
end_of_line=lf
77
charset=utf-8
88
trim_trailing_whitespace=true
9-
max_line_length=120
9+
max_line_length=100
1010
insert_final_newline=true
1111

1212
[*.yml]

.gitlab-ci.yml

Lines changed: 77 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ variables:
4949
- schedules
5050
- web
5151
- /^[0-9]+$/ # PRs
52+
retry:
53+
max: 2
54+
when:
55+
- runner_system_failure
56+
- unknown_failure
57+
- api_failure
5258
tags:
5359
- linux-docker
5460

@@ -130,7 +136,7 @@ test-linux-stable: &test-linux
130136
variables:
131137
- $DEPLOY_TAG
132138
script:
133-
- time cargo test --all --release --verbose --locked |
139+
- WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |
134140
tee output.log
135141
- sccache -s
136142
after_script:
@@ -156,13 +162,24 @@ test-srml-staking: &test-srml-staking
156162
- $DEPLOY_TAG
157163
script:
158164
- cd srml/staking/
159-
- time cargo test --release --verbose --no-default-features --features std
165+
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features std
160166
- sccache -s
161167

162-
163-
164-
165-
168+
test-wasmtime: &test-wasmtime
169+
stage: test
170+
<<: *docker-env
171+
variables:
172+
# Enable debug assertions since we are running optimized builds for testing
173+
# but still want to have debug assertions.
174+
RUSTFLAGS: -Cdebug-assertions=y
175+
RUST_BACKTRACE: 1
176+
except:
177+
variables:
178+
- $DEPLOY_TAG
179+
script:
180+
- cd core/executor
181+
- WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features wasmtime
182+
- sccache -s
166183

167184
test-linux-stable-int:
168185
<<: *test-linux
@@ -174,7 +191,7 @@ test-linux-stable-int:
174191
script:
175192
- echo "___Logs will be partly shown at the end in case of failure.___"
176193
- echo "___Full log will be saved to the job artifacts only in case of failure.___"
177-
- RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace
194+
- WASM_BUILD_NO_COLOR=1 RUST_LOG=sync=trace,consensus=trace,client=trace,state-db=trace,db=trace,forks=trace,state_db=trace,storage_cache=trace
178195
time cargo test -p node-cli --release --verbose --locked -- --ignored --test-threads=1
179196
&> ${CI_COMMIT_SHORT_SHA}_int_failure.log
180197
- sccache -s
@@ -203,20 +220,9 @@ check-web-wasm:
203220
- time cargo web build -p substrate-consensus-aura
204221
- time cargo web build -p substrate-consensus-babe
205222
- time cargo web build -p substrate-consensus-common
206-
- time cargo web build -p substrate-keyring
207-
- time cargo web build -p substrate-keystore
208-
- time cargo web build -p substrate-executor
209-
- time cargo web build -p substrate-network
210-
- time cargo web build -p substrate-offchain
211-
- time cargo web build -p substrate-panic-handler
212-
- time cargo web build -p substrate-peerset
213-
- time cargo web build -p substrate-primitives
214-
- time cargo web build -p substrate-rpc-servers
215-
- time cargo web build -p substrate-serializer
216-
- time cargo web build -p substrate-state-db
217-
- time cargo web build -p substrate-state-machine
218223
- time cargo web build -p substrate-telemetry
219-
- time cargo web build -p substrate-trie
224+
# Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way.
225+
- time cargo build --manifest-path=node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown
220226
- sccache -s
221227

222228
node-exits:
@@ -227,6 +233,26 @@ node-exits:
227233
script:
228234
- ./ci/check_for_exit.sh
229235

236+
237+
test-full-crypto-feature: &test-full-crypto-feature
238+
stage: test
239+
<<: *docker-env
240+
variables:
241+
# Enable debug assertions since we are running optimized builds for testing
242+
# but still want to have debug assertions.
243+
RUSTFLAGS: -Cdebug-assertions=y
244+
RUST_BACKTRACE: 1
245+
except:
246+
variables:
247+
- $DEPLOY_TAG
248+
script:
249+
- cd core/primitives/
250+
- time cargo +nightly build --verbose --no-default-features --features full_crypto
251+
- cd ../application-crypto
252+
- time cargo +nightly build --verbose --no-default-features --features full_crypto
253+
- sccache -s
254+
255+
230256
#### stage: build
231257

232258
build-linux-substrate:
@@ -238,7 +264,7 @@ build-linux-substrate:
238264
variables:
239265
- $DEPLOY_TAG
240266
script:
241-
- time cargo build --release --verbose
267+
- WASM_BUILD_NO_COLOR=1 time cargo build --release --verbose
242268
- mkdir -p ./artifacts/substrate/
243269
- mv ./target/release/substrate ./artifacts/substrate/.
244270
- echo -n "Substrate version = "
@@ -266,7 +292,7 @@ build-linux-subkey:
266292
script:
267293
- cd ./subkey
268294
- BUILD_DUMMY_WASM_BINARY=1 time cargo build --release --verbose
269-
- cd ..
295+
- cd -
270296
- sccache -s
271297
- mkdir -p ./artifacts/subkey
272298
- mv ./target/release/subkey ./artifacts/subkey/.
@@ -315,6 +341,35 @@ check_warnings:
315341
fi
316342
allow_failure: true
317343

344+
# Check whether Polkadot 'master' branch builds using this Substrate commit.
345+
check_polkadot:
346+
stage: build
347+
<<: *docker-env
348+
allow_failure: true
349+
dependencies:
350+
- test-linux-stable
351+
script:
352+
- COMMIT_HASH=$(git rev-parse HEAD)
353+
- SUBSTRATE_PATH=$(pwd)
354+
# Clone the current Polkadot master branch into ./polkadot.
355+
- git clone --depth 1 https://gitlab.parity.io/parity/polkadot.git
356+
- cd polkadot
357+
# Within Polkadot 'master' alter each Cargo.toml that references the
358+
# Substrate 'polkadot-master' branch:
359+
# 1. Replace the 'branch = "polkadot-master"' statements with the rev of our
360+
# commit.
361+
# 2. Replace 'git = "https://.*"' with 'git = "file://.*"' (the local
362+
# checked out Substrate repository one folder above).
363+
# 3. Remove any trailing commas.
364+
- git grep -l "polkadot-master" | grep toml | xargs sed -i "s/branch.*=.*\"polkadot-master\"/rev = \"$COMMIT_HASH\"/; s~https://github.com/paritytech/substrate~file://$SUBSTRATE_PATH~; s/,\s*}/ }/"
365+
# Make sure 'Cargo.lock' matches 'Cargo.toml'. It's enough to update one
366+
# package, others are updated along the way.
367+
- cargo update -p sr-io
368+
# Check whether Polkadot 'master' branch builds with this Substrate commit.
369+
- time cargo check
370+
- cd -
371+
- sccache -s
372+
318373
#### stage: publish
319374

320375
.publish-docker-release: &publish-docker-release

0 commit comments

Comments
 (0)