Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix features #1194

Merged
merged 16 commits into from
Aug 28, 2023
2 changes: 1 addition & 1 deletion .gitlab/pipeline/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cargo-fmt-manifest:
- .docker-env
- .common-refs
script:
- cargo install zepter --locked --version 0.10.0 -q -f --no-default-features && zepter --version
- cargo install zepter --locked --version 0.11.0 -q -f --no-default-features && zepter --version
- echo "👉 Hello developer! If you see this CI check failing then it means that one of the your changes in a Cargo.toml file introduced ill-formatted or unsorted features. Please take a look at 'docs/STYLE_GUIDE.md#manifest-formatting' to find out more."
- zepter format features --check
allow_failure: true # Experimental
Expand Down
8 changes: 8 additions & 0 deletions cumulus/bridges/bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ std = [
"bp-messages/std",
"bp-parachains/std",
"bp-polkadot-core/std",
"bp-relayers/std",
"bp-runtime/std",
"bp-test-utils/std",
"bp-xcm-bridge-hub-router/std",
"codec/std",
"frame-support/std",
"frame-system/std",
"hash-db/std",
"log/std",
"pallet-balances/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-parachains/std",
Expand All @@ -79,10 +82,15 @@ std = [
"xcm/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-bridge-grandpa/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"pallet-bridge-parachains/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
]
integrity-test = [ "static_assertions" ]
11 changes: 10 additions & 1 deletion cumulus/bridges/modules/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,21 @@ std = [
"log/std",
"scale-info/std",
"sp-consensus-grandpa/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"sp-trie/std",
]
runtime-benchmarks = [
"bp-test-utils",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
18 changes: 16 additions & 2 deletions cumulus/bridges/modules/messages/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,30 @@ default = [ "std" ]
std = [
"bp-messages/std",
"bp-runtime/std",
"bp-test-utils/std",
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"log/std",
"num-traits/std",
"pallet-balances/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks" ]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-balances/try-runtime",
"sp-runtime/try-runtime",
]
18 changes: 16 additions & 2 deletions cumulus/bridges/modules/parachains/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,30 @@ std = [
"bp-parachains/std",
"bp-polkadot-core/std",
"bp-runtime/std",
"bp-test-utils/std",
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-bridge-grandpa/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"sp-trie/std",
]
runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks" ]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-bridge-grandpa/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-bridge-grandpa/try-runtime",
"sp-runtime/try-runtime",
]
21 changes: 19 additions & 2 deletions cumulus/bridges/modules/relayers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,27 @@ std = [
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-balances/std",
"pallet-bridge-messages/std",
"scale-info/std",
"sp-arithmetic/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]
runtime-benchmarks = [ "frame-benchmarking/runtime-benchmarks" ]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-balances/try-runtime",
"pallet-bridge-messages/try-runtime",
"sp-runtime/try-runtime",
]
10 changes: 9 additions & 1 deletion cumulus/bridges/modules/xcm-bridge-hub-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,21 @@ std = [
"log/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"xcm-builder/std",
"xcm/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
1 change: 1 addition & 0 deletions cumulus/bridges/primitives/header-chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ hex-literal = "0.4"
default = [ "std" ]
std = [
"bp-runtime/std",
"bp-test-utils/std",
Copy link
Member

Choose a reason for hiding this comment

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

Is it indended that the dev dependency feature is in the list?

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 think with resolver = "2" it should be fine: https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2

Features enabled on dev-dependencies will not be unified when those same dependencies are used as a normal dependency, unless those dev-dependencies are currently being built.

Copy link
Member

@ordian ordian Aug 27, 2023

Choose a reason for hiding this comment

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

The docs mean it would be ok to enable the feature directly in dev-dependencies and not propagate to features section. Which I think is what wanted here unless we need to run tests with both std feature enabled and disabled?
But indeed, it doesn't pull the dev-dependency when std feature is enabled for cargo build.

Copy link
Member

Choose a reason for hiding this comment

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

Which I think is what wanted

This is already the case since we don't specify default-features = false on this bp-test-utils. In that case, specifying "bp-test-utils/std" is harmless, but useless.

Copy link
Member

Choose a reason for hiding this comment

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

This still doesn't make any sense. We don't disable the default-features for bp-test-utils. This also means that we don't need to enable std as it is already enabled by default.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, there were quite a few. Removed in eddb4ae.
CI now takes this into account.

"codec/std",
"finality-grandpa/std",
"frame-support/std",
Expand Down
3 changes: 3 additions & 0 deletions cumulus/bridges/primitives/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ sp-trie = { path = "../../../../substrate/primitives/trie", default-features = f
default = [ "std" ]
std = [
"bp-header-chain/std",
"bp-parachains/std",
"bp-polkadot-core/std",
"bp-runtime/std",
"codec/std",
"ed25519-dalek/std",
"finality-grandpa/std",
Expand All @@ -33,4 +35,5 @@ std = [
"sp-core/std",
"sp-runtime/std",
"sp-std/std",
"sp-trie/std",
]
10 changes: 9 additions & 1 deletion cumulus/pallets/aura-ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ std = [
"frame-support/std",
"frame-system/std",
"pallet-aura/std",
"pallet-timestamp/std",
"scale-info/std",
"sp-application-crypto/std",
"sp-consensus-aura/std",
"sp-runtime/std",
"sp-std/std",
]
try-runtime = [ "frame-support/try-runtime" ]
try-runtime = [
"cumulus-pallet-parachain-system/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-aura/try-runtime",
"pallet-timestamp/try-runtime",
"sp-runtime/try-runtime",
]
22 changes: 21 additions & 1 deletion cumulus/pallets/collator-selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,42 @@ runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
]
std = [
"codec/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-session/std",
"pallet-timestamp/std",
"rand/std",
"scale-info/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-staking/std",
"sp-std/std",
"sp-tracing/std",
]

try-runtime = [ "frame-support/try-runtime" ]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-session/try-runtime",
"pallet-timestamp/try-runtime",
"sp-runtime/try-runtime",
]

experimental = [ "pallet-aura/experimental" ]
8 changes: 7 additions & 1 deletion cumulus/pallets/dmp-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,15 @@ std = [
"frame-system/std",
"log/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"sp-version/std",
"xcm/std",
]
try-runtime = [ "frame-support/try-runtime" ]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
18 changes: 16 additions & 2 deletions cumulus/pallets/parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,38 @@ std = [
"cumulus-pallet-parachain-system-proc-macro/std",
"cumulus-primitives-core/std",
"cumulus-primitives-parachain-inherent/std",
"cumulus-test-relay-sproof-builder/std",
"environmental/std",
"frame-support/std",
"frame-system/std",
"log/std",
"polkadot-parachain/std",
"scale-info/std",
"sp-core/std",
"sp-externalities/std",
"sp-inherents/std",
"sp-io/std",
"sp-runtime/std",
"sp-state-machine/std",
"sp-std/std",
"sp-tracing/std",
"sp-trie/std",
"sp-version/std",
"trie-db/std",
"xcm/std",
]

runtime-benchmarks = [ "sp-runtime/runtime-benchmarks" ]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"polkadot-parachain/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]

try-runtime = [ "frame-support/try-runtime" ]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]

parameterized-consensus-hook = []
1 change: 1 addition & 0 deletions cumulus/pallets/session-benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
std = [
"frame-benchmarking/std",
Expand Down
8 changes: 7 additions & 1 deletion cumulus/pallets/solo-to-para/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ std = [
"sp-runtime/std",
"sp-std/std",
]
try-runtime = [ "frame-support/try-runtime" ]
try-runtime = [
"cumulus-pallet-parachain-system/try-runtime",
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-sudo/try-runtime",
"sp-runtime/try-runtime",
]
7 changes: 6 additions & 1 deletion cumulus/pallets/xcm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ std = [
"frame-support/std",
"frame-system/std",
"scale-info/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"xcm/std",
]
try-runtime = [ "frame-support/try-runtime" ]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
Loading
Loading