Skip to content

Commit

Permalink
Fix runtime-benchmarks feature propagation for cumulus test utils (…
Browse files Browse the repository at this point in the history
…backport for 1.5) (#3357)

This PR should fix compilation for BridgeHub runtimes with
`runtime-benchmarks`. This problem occurs only if we try to build exact
package:
```
cargo test -p bridge-hub-rococo-runtime --release --features=runtime-benchmarks,try-runtime
cargo test -p bridge-hub-westend-runtime --release --features=runtime-benchmarks,try-runtime
```
This problem was discovered in the `fellows` repo when trying to split
test pipelines per runtime:
polkadot-fellows/runtimes#189. E.g.
https://github.com/polkadot-fellows/runtimes/actions/runs/7918178465/job/21616001877?pr=189

Relevant patched crates:
- asset-test-utils
- bridge-hub-test-utils
- parachains-runtimes-test-utils
  • Loading branch information
bkontur authored Feb 16, 2024
1 parent 47c253c commit d15487b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions cumulus/parachains/runtimes/assets/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ std = [
"xcm-executor/std",
"xcm/std",
]

runtime-benchmarks = [
"assets-common/runtime-benchmarks",
]
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ std = [
]

runtime-benchmarks = [
"bridge-hub-test-utils/runtime-benchmarks",
"bridge-runtime-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ std = [
]

runtime-benchmarks = [
"bridge-hub-test-utils/runtime-benchmarks",
"bridge-runtime-common/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
Expand Down
4 changes: 4 additions & 0 deletions cumulus/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,7 @@ std = [
"xcm-executor/std",
"xcm/std",
]

runtime-benchmarks = [
"asset-test-utils/runtime-benchmarks",
]
2 changes: 0 additions & 2 deletions cumulus/parachains/runtimes/test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ cumulus-pallet-xcmp-queue = { path = "../../../pallets/xcmp-queue", default-feat
pallet-collator-selection = { path = "../../../pallets/collator-selection", default-features = false, version = "8.0.0" }
parachains-common = { path = "../../common", default-features = false, version = "6.0.0" }
parachain-info = { package = "staging-parachain-info", path = "../../pallets/parachain-info", default-features = false, version = "0.6.0" }
assets-common = { path = "../assets/common", default-features = false, version = "0.6.0" }
cumulus-primitives-core = { path = "../../../primitives/core", default-features = false, version = "0.6.0" }
cumulus-primitives-parachain-inherent = { path = "../../../primitives/parachain-inherent", default-features = false, version = "0.6.0" }
cumulus-test-relay-sproof-builder = { path = "../../../test/relay-sproof-builder", default-features = false, version = "0.6.0" }
Expand All @@ -48,7 +47,6 @@ substrate-wasm-builder = { version = "16.0.0", path = "../../../../substrate/uti
[features]
default = ["std"]
std = [
"assets-common/std",
"codec/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcmp-queue/std",
Expand Down

0 comments on commit d15487b

Please sign in to comment.