diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 823e63b54f52..b70f15ee25b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ variables: CI_IMAGE: "paritytech/ci-linux:production" DOCKER_OS: "debian:stretch" ARCH: "x86_64" - ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.1.3" + ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.1.4" VAULT_SERVER_URL: "https://vault.parity-mgmt-vault.parity.io" VAULT_AUTH_PATH: "gitlab-parity-io-jwt" VAULT_AUTH_ROLE: "cicd_gitlab_parity_${CI_PROJECT_NAME}" @@ -198,13 +198,12 @@ test-build-linux-stable: script: - ./scripts/gitlab/test_linux_stable.sh # we're using the bin built here, instead of having a parallel `build-linux-release` - # disputes feature is needed for zombie-net parachains malus test - - time cargo build --release --verbose --bin polkadot + - time cargo build --profile testnet --verbose --bin polkadot - sccache -s # pack artifacts - mkdir -p ./artifacts - VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name - - mv ./target/release/polkadot ./artifacts/. + - mv ./target/testnet/polkadot ./artifacts/. - pushd artifacts - sha256sum polkadot | tee polkadot.sha256 - shasum -c polkadot.sha256 @@ -260,11 +259,11 @@ build-adder-collator: <<: *compiler-info <<: *rules-test-and-rococo script: - - time cargo build --release --verbose -p test-parachain-adder-collator + - time cargo build --profile testnet --verbose -p test-parachain-adder-collator - sccache -s # pack artifacts - mkdir -p ./artifacts - - mv ./target/release/adder-collator ./artifacts/. + - mv ./target/testnet/adder-collator ./artifacts/. - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" @@ -280,11 +279,11 @@ build-malus: - if: $CI_COMMIT_REF_NAME == "master" - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs script: - - time cargo build --release --verbose -p polkadot-test-malus + - time cargo build --profile testnet --verbose -p polkadot-test-malus - sccache -s # pack artifacts - mkdir -p ./artifacts - - mv ./target/release/malus ./artifacts/. + - mv ./target/testnet/malus ./artifacts/. - echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION - echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG - echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))" diff --git a/Cargo.toml b/Cargo.toml index 1eda0c0f499a..beda86e5eff5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ license = "GPL-3.0-only" version = "0.9.13" authors = ["Parity Technologies "] edition = "2018" +rust-version = "1.57.0" # custom profiles readme = "README.md" [dependencies] @@ -114,6 +115,16 @@ opt-level = 3 # Polkadot runtime requires unwinding. panic = "unwind" +[profile.production] +inherits = "release" +lto = true + +[profile.testnet] +inherits = "release" +debug = true # debug symbols are useful for profilers +debug-assertions = true +overflow-checks = true + [features] runtime-benchmarks= [ "polkadot-cli/runtime-benchmarks" ] try-runtime = [ "polkadot-cli/try-runtime" ] diff --git a/scripts/gitlab/test_linux_stable.sh b/scripts/gitlab/test_linux_stable.sh index 7f11e08d9edd..24f2a8b273b5 100755 --- a/scripts/gitlab/test_linux_stable.sh +++ b/scripts/gitlab/test_linux_stable.sh @@ -5,4 +5,4 @@ set -eux source "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/../common/lib.sh" # Builds with the runtime benchmarks/metrics features are only to be used for testing. -time cargo test --workspace --release --verbose --locked --features=runtime-benchmarks,runtime-metrics +time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics