Skip to content

Commit 12cb5a2

Browse files
committed
Merge branch 'mp-2522' into 'master'
Update as per paritytech/polkadot#2522 See merge request chevdor/srtool!4
2 parents 67a8d69 + bf99ade commit 12cb5a2

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

scripts/build

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,22 @@ else
101101
COLOR=always
102102
fi
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
120126
fi
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`
124130
SHA256=0x`shasum -a 256 $WASM | awk '{print $1}'`
125131

126132
SIZE=`wc -c < $WASM`

0 commit comments

Comments
 (0)