Skip to content

Commit

Permalink
Bug Fix (#882) Use correct feature flags with srtool (#884)
Browse files Browse the repository at this point in the history
# Goal
The goal of this PR is to make sure that the correct feature flags are
being used with srtool for wasm generation

Closes #882 

# Discussion
- srtool default-features flag does not work as intended
- Instead using build-opts
- Enabled debug logging in srtool for easier checking
- Added subwasm check to test the output wasm

Test Runs:
- Mainnet:
https://github.com/LibertyDSNP/frequency/actions/runs/3859784794/jobs/6579633360
<img width="1010" alt="image"
src="https://user-images.githubusercontent.com/1252199/211126355-d6f917d3-0ef2-447c-8f81-ac5333ce34d1.png">

- Rococo:
https://github.com/LibertyDSNP/frequency/actions/runs/3859784794/jobs/6579633325
<img width="892" alt="image"
src="https://user-images.githubusercontent.com/1252199/211126378-037467be-b34d-4e6c-bafb-effdafb46328.png">


# Checklist
- [x] Tests added
  • Loading branch information
wilwade authored and abadaa committed Jan 10, 2023
1 parent 71e63ae commit 45f21a3
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,15 @@ jobs:
built-wasm-file-name-prefix: frequency_runtime
release-wasm-file-name-prefix: frequency-rococo_runtime
features: frequency-rococo-testnet
wasm-core-version: frequency-rococo
- network: mainnet
build-profile: production
package: frequency-runtime
runtime-dir: runtime/frequency
built-wasm-file-name-prefix: frequency_runtime
release-wasm-file-name-prefix: frequency_runtime
features: frequency
wasm-core-version: frequency
runs-on: [self-hosted, Linux, X64]
steps:
- name: Set Ubuntu Env Vars
Expand Down Expand Up @@ -189,15 +191,24 @@ jobs:
- name: Build Deterministic WASM
run: |
set -ex
srtool build \
--default-features="on-chain-release-build,no-metadata-docs,${{matrix.features}}" \
RUST_LOG=debug srtool build \
--build-opts="'--features on-chain-release-build,no-metadata-docs,${{matrix.features}}'" \
--profile=${{matrix.build-profile}} \
--package=${{matrix.package}} \
--root
- name: Rename WASM file
run: |
cp -p ./${{env.WASM_DIR}}/${{env.BUILT_WASM_FILENAME}} \
./${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}}
- name: Install subwasm
run: |
cargo install --locked --git https://github.com/chevdor/subwasm --tag v0.18.0
subwasm --version
- name: Test WASM file
run: |
subwasm info ${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}}
subwasm info ${{env.WASM_DIR}}/${{env.RELEASE_WASM_FILENAME}} | grep "Core version:.*${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" || \
(echo "ERROR: WASM Core version didn't match ${{matrix.wasm-core-version}}-${{env.RUNTIME_SPEC_VERSION}}" && exit 1)
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit 45f21a3

Please sign in to comment.