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

CI check against Rust feature bleed #12341

Merged
merged 25 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
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
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
alvicsam marked this conversation as resolved.
Show resolved Hide resolved
- .test-refs-no-trigger-prs-only
allow_failure: true
Copy link
Member Author

Choose a reason for hiding this comment

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

I marked it as allowed to fail for now, until it is prove not to hold up development.

script:
- git clone
--depth=1
--branch="$PIPELINE_SCRIPTS_TAG"
https://github.com/paritytech/pipeline-scripts
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
- 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,7 +31,12 @@ sp-keystore = { version = "0.12.0", path = "../../../../primitives/keystore" }
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" }
frame-try-runtime = { path = "../../../../frame/try-runtime" }
frame-try-runtime = { optional = true, path = "../../../../frame/try-runtime" }

[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")]
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

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