File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed
Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -101,16 +101,22 @@ else
101101 COLOR=always
102102fi
103103
104- CMD=" cargo build --color=$COLOR --$PROFILE -p $PACKAGE --target-dir target/srtool"
105- if [ ! -z " $VERBOSE " ]; then
106- time $CMD
107- else
108- if [[ " $* " == * " --json" * && ! " $* " =~ --app ]]; then
109- $CMD > /dev/null 2>&1
110- else
111- $CMD 2>&1
112- fi
113- fi
104+ # As of https://github.com/paritytech/polkadot/pull/2522 we need to cd to the
105+ # runtime directory itself
106+ RUNTIME_NAME=" ${PACKAGE/ -*/ } "
107+
108+ pushd " runtime/$RUNTIME_NAME " || exit 1
109+ CMD=" cargo build --features on-chain-release-build --color=$COLOR --$PROFILE --target-dir target/srtool"
110+ if [ ! -z " $VERBOSE " ]; then
111+ time $CMD
112+ else
113+ if [[ " $* " == * " --json" * && ! " $* " =~ --app ]]; then
114+ $CMD > /dev/null 2>&1
115+ else
116+ $CMD 2>&1
117+ fi
118+ fi
119+ popd || exit 1
114120
115121# The following would be nice but not in rust stable yet
116122# --out-dir srtool-out
@@ -120,7 +126,7 @@ if [[ ! "$*" =~ --json || "$*" =~ --app ]]; then
120126fi
121127
122128# WASM=`find . -type f -name *.wasm | grep $PROFILE | grep -v deps | grep compact | head -1`
123- WASM=` find . /target/srtool/$PROFILE /wbuild/$PACKAGE /* .compact.wasm`
129+ WASM=` find runtime/ $RUNTIME_NAME /target/srtool/$PROFILE /wbuild/$PACKAGE /* .compact.wasm`
124130SHA256=0x` shasum -a 256 $WASM | awk ' {print $1}' `
125131
126132SIZE=` wc -c < $WASM `
You can’t perform that action at this time.
0 commit comments