Skip to content

Commit

Permalink
Remove workspace flag from build script (#1029)
Browse files Browse the repository at this point in the history
* remove workspace flag

* build cumulus from root polkadot-sdk dir

* check if the relay chain needs to be built

---------

Co-authored-by: claravanstaden <Cats 4 life!>
  • Loading branch information
claravanstaden authored Nov 29, 2023
1 parent 9d28d96 commit 3964ee5
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions web/packages/test/scripts/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,39 @@ build_binaries() {
features=--features beacon-spec-mainnet
fi

echo "Building polkadot binary"
cargo build --release --workspace --locked --bin polkadot --bin polkadot-execute-worker --bin polkadot-prepare-worker
check_local_changes "polkadot"
check_local_changes "substrate"

# Check that all 3 binaries are available and no changes made in the polkadot and substrate dirs
if [[ ! -e "target/release/polkadot" || ! -e "target/release/polkadot-execute-worker" || ! -e "target/release/polkadot-prepare-worker" || "$changes_detected" -eq 1 ]]; then
echo "Building polkadot binary, due to changes detected in polkadot or substrate, or binaries not found"
cargo build --release --locked --bin polkadot --bin polkadot-execute-worker --bin polkadot-prepare-worker
else
echo "No changes detected in polkadot or substrate and binaries are available, not rebuilding relaychain binaries."
fi

cp target/release/polkadot $output_bin_dir/polkadot
cp target/release/polkadot-execute-worker $output_bin_dir/polkadot-execute-worker
cp target/release/polkadot-prepare-worker $output_bin_dir/polkadot-prepare-worker

echo "Building polkadot-parachain binary"
cargo build --release --workspace --locked --bin polkadot-parachain $features
cargo build --release --locked -p polkadot-parachain-bin --bin polkadot-parachain $features
cp target/release/polkadot-parachain $output_bin_dir/polkadot-parachain

popd
}

changes_detected=0

check_local_changes() {
local dir=$1
cd "$dir"
if git status --porcelain | grep .; then
changes_detected=1
fi
cd -
}

build_contracts() {
echo "Building contracts"
pushd $root_dir/contracts
Expand Down

0 comments on commit 3964ee5

Please sign in to comment.