Skip to content

Commit

Permalink
CI check against Rust feature bleed (paritytech#12341)
Browse files Browse the repository at this point in the history
* CI check for rust feature bleed

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Cargo not available

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Handle missing programs

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Check for deps

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use correct CI image

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove --offline

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Install cargo-workspaces

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Remove cargo-workspaces dep

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix try-runtime feature

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix features

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix features

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix more features...

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Use pipeline-script

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* 🤡

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make stupid change to test the CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* This reverts commit ad2746a.

* Use correct branch

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Allow failure

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make stupid change to test the CI

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Revert "Make stupid change to test the CI"

This reverts commit 16ec00e.

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored and ark0f committed Feb 27, 2023
1 parent 2634bb3 commit 9ec9c25
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/node-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ runtime-benchmarks = [
]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = ["node-template-runtime/try-runtime", "try-runtime-cli"]
try-runtime = ["node-template-runtime/try-runtime", "try-runtime-cli/try-runtime"]
2 changes: 1 addition & 1 deletion bin/node-template/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ runtime-benchmarks = [
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-try-runtime",
"frame-try-runtime/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-support/try-runtime",
Expand Down
2 changes: 1 addition & 1 deletion bin/node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ runtime-benchmarks = [
]
# Enable features that allow the runtime to be tried and debugged. Name might be subject to change
# in the near future.
try-runtime = ["kitchensink-runtime/try-runtime", "try-runtime-cli"]
try-runtime = ["kitchensink-runtime/try-runtime", "try-runtime-cli/try-runtime"]

[[bench]]
name = "transaction_pool"
Expand Down
2 changes: 1 addition & 1 deletion bin/node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ runtime-benchmarks = [
"frame-system-benchmarking/runtime-benchmarks",
]
try-runtime = [
"frame-try-runtime",
"frame-try-runtime/try-runtime",
"frame-executive/try-runtime",
"frame-system/try-runtime",
"frame-support/try-runtime",
Expand Down
2 changes: 1 addition & 1 deletion frame/executive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ std = [
"sp-std/std",
"sp-tracing/std",
]
try-runtime = ["frame-support/try-runtime", "frame-try-runtime" ]
try-runtime = ["frame-support/try-runtime", "frame-try-runtime/try-runtime" ]
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::pallet::Def;

///
/// * implement the trait `sp_runtime::BuildModuleGenesisStorage`
/// * add #[cfg(features = "std")] to GenesisBuild implementation.
/// * add #[cfg(feature = "std")] to GenesisBuild implementation.
pub fn expand_genesis_build(def: &mut Def) -> proc_macro2::TokenStream {
let genesis_config = if let Some(genesis_config) = &def.genesis_config {
genesis_config
Expand Down
5 changes: 4 additions & 1 deletion frame/try-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"]}
frame-support = { version = "4.0.0-dev", default-features = false, features = [ "try-runtime" ], path = "../support" }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" }
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "4.0.0", default-features = false, path = "../../primitives/std" }
Expand All @@ -28,3 +28,6 @@ std = [
"sp-runtime/std",
"sp-std/std",
]
try-runtime = [
"frame-support/try-runtime",
]
1 change: 1 addition & 0 deletions frame/try-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
//! Supporting types for try-runtime, testing and dry-running commands.
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg(feature = "try-runtime")]

pub use frame_support::traits::TryStateSelect;
use frame_support::weights::Weight;
Expand Down
14 changes: 13 additions & 1 deletion scripts/ci/gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ test-dependency-rules:
script:
- ./scripts/ci/gitlab/ensure-deps.sh

test-rust-features:
stage: check
extends:
- .kubernetes-env
- .test-refs-no-trigger-prs-only
allow_failure: true
script:
- git clone
--depth=1
--branch="$PIPELINE_SCRIPTS_TAG"
https://github.com/paritytech/pipeline-scripts
- bash ./pipeline-scripts/rust-features.sh .

test-prometheus-alerting-rules:
stage: check
extends: .kubernetes-env
Expand All @@ -51,4 +64,3 @@ test-prometheus-alerting-rules:
- promtool check rules ./scripts/ci/monitoring/alerting-rules/alerting-rules.yaml
- cat ./scripts/ci/monitoring/alerting-rules/alerting-rules.yaml |
promtool test rules ./scripts/ci/monitoring/alerting-rules/alerting-rule-tests.yaml

7 changes: 6 additions & 1 deletion utils/frame/try-runtime/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ sp-runtime = { version = "6.0.0", path = "../../../../primitives/runtime" }
sp-state-machine = { version = "0.12.0", path = "../../../../primitives/state-machine" }
sp-version = { version = "5.0.0", path = "../../../../primitives/version" }
sp-weights = { version = "4.0.0", path = "../../../../primitives/weights" }
frame-try-runtime = { path = "../../../../frame/try-runtime" }
frame-try-runtime = { optional = true, path = "../../../../frame/try-runtime" }
substrate-rpc-client = { path = "../../rpc/client" }

[dev-dependencies]
tokio = "1.17.0"

[features]
try-runtime = [
"frame-try-runtime/try-runtime",
]
2 changes: 2 additions & 0 deletions utils/frame/try-runtime/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@
//! -s snap \
//! ```
#![cfg(feature = "try-runtime")]

use parity_scale_codec::Decode;
use remote_externalities::{
Builder, Mode, OfflineConfig, OnlineConfig, SnapshotConfig, TestExternalities,
Expand Down

0 comments on commit 9ec9c25

Please sign in to comment.