Skip to content

Commit

Permalink
Add build options to the srtool build step (#4956)
Browse files Browse the repository at this point in the history
This PR adds possibility to set BUILD_OPTIONS to the "Srtool Build" step
in the release pipeline while building runtimes.

Colses: paritytech/release-engineering#213

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: EgorPopelyaev <EgorPopelyaev@users.noreply.github.com>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent ad0de74 commit 3cbefaf
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release-30_publish_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
uses: "./.github/workflows/release-srtool.yml"
with:
excluded_runtimes: "substrate-test bp cumulus-test kitchensink minimal-template parachain-template penpal polkadot-test seedling shell frame-try sp solochain-template"
build_opts: "--features on-chain-release-build"

build-binaries:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/release-srtool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
inputs:
excluded_runtimes:
type: string
build_opts:
type: string
outputs:
published_runtimes:
value: ${{ jobs.find-runtimes.outputs.runtime }}
Expand Down Expand Up @@ -74,6 +76,8 @@ jobs:
- name: Srtool build
id: srtool_build
uses: chevdor/srtool-actions@v0.9.2
env:
BUILD_OPTS: ${{ inputs.build_opts }}
with:
chain: ${{ matrix.chain }}
runtime_dir: ${{ matrix.runtime_dir }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = ["metadata-hash"]
Original file line number Diff line number Diff line change
Expand Up @@ -262,4 +262,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = ["metadata-hash"]
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,4 @@ fast-runtime = []
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = []
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,6 @@ try-runtime = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = []

fast-runtime = []
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ std = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = []
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,4 @@ try-runtime = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = []
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = ["metadata-hash"]
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,4 @@ metadata-hash = ["substrate-wasm-builder/metadata-hash"]
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = ["metadata-hash"]
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,4 @@ try-runtime = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]
on-chain-release-build = []
5 changes: 5 additions & 0 deletions cumulus/parachains/runtimes/people/people-rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,8 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]

# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = []
5 changes: 5 additions & 0 deletions cumulus/parachains/runtimes/people/people-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,8 @@ try-runtime = [
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime",
]

# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = []
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,8 @@ runtime-benchmarks = [
"xcm-builder/runtime-benchmarks",
"xcm-executor/runtime-benchmarks",
]

# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = []
2 changes: 1 addition & 1 deletion polkadot/runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@ runtime-metrics = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = ["metadata-hash"]
2 changes: 1 addition & 1 deletion polkadot/runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -358,4 +358,4 @@ runtime-metrics = [
# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"]
on-chain-release-build = ["metadata-hash"]
39 changes: 39 additions & 0 deletions prdoc/pr_4956.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
title: Add build options to the srtool build step and delete `disanle-logging` feature

doc:
- audience: Runtime Dev
description: |
This PR adds possibility to set BUILD_OPTIONS to the "Srtool Build\" step in the release pipeline while building runtimes.
And deletes the `disable-logging` feature from test runtimes to be able to build those with an activated logging.



crates:
- name: people-rococo-runtime
bump: patch
- name: people-westend-runtime
bump: patch
- name: rococo-parachain-runtime
bump: patch
- name: asset-hub-rococo-runtime
bump: patch
- name: asset-hub-westend-runtime
bump: patch
- name: bridge-hub-rococo-runtime
bump: patch
- name: bridge-hub-westend-runtime
bump: patch
- name: collectives-westend-runtime
bump: patch
- name: contracts-rococo-runtime
bump: patch
- name: coretime-rococo-runtime
bump: patch
- name: coretime-westend-runtime
bump: patch
- name: glutton-westend-runtime
bump: patch
- name: rococo-runtime
bump: patch
- name: westend-runtime
bump: patch

0 comments on commit 3cbefaf

Please sign in to comment.