Skip to content

Commit

Permalink
Fix MANUAL_BUILD_SCRIPTS
Browse files Browse the repository at this point in the history
error: Incompatible capsule version 0.10.1, this project requires a version that's compatible with 0.7.0
  • Loading branch information
Flouse committed Oct 15, 2023
1 parent bdfbeed commit b725340
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions kicker
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ function manual_build() {
if [ "$MANUAL_BUILD_WEB3_INDEXER" = "true" ]; then
info "Start building godwoken-web3-indexer"

srcdir=$WORKSPACE/packages/godwoken
srcdir=$WORKSPACE/packages/godwoken/web3
dstdir=$WORKSPACE/docker/manual-artifacts

# Download repo
Expand All @@ -515,24 +515,25 @@ function manual_build() {
# Cargo fetch Rust dependencies (in order to access network via
# host network). The docker image must have installed cargo, molecule
# and rustfmt.
erun "cd $srcdir/web3 && CARGO_HOME=$WORKSPACE/packages/.cargo cargo fetch --locked && cd -"
erun "cd $srcdir && CARGO_HOME=$WORKSPACE/packages/.cargo cargo fetch --locked && cd -"

erun docker run --rm \
--workdir /app/web3 \
--volume $srcdir:/app \
--volume $WORKSPACE/packages/.rustup:/root/.rustup \
--env CARGO_HOME=$WORKSPACE/packages/.cargo \
--volume $WORKSPACE/packages/.cargo:/app/.cargo \
--env CARGO_HOME=/app/.cargo \
$DOCKER_MANUAL_BUILD_IMAGE cargo build --locked

# Copy the built artifacts to `docker/manual-artifacts/gw-web3-indexer`
#
# More: ./docker/manual-web3-indexer.compose.yml
erun mkdir -p $dstdir
erun cp $srcdir/web3/target/debug/gw-web3-indexer $dstdir
erun cp $srcdir/target/debug/gw-web3-indexer $dstdir

# Remove Rust target to avoid `out of disk` issue in CI
if [[ "$GITHUB_ACTIONS_CLEAN_MID_ARTIFACTS" = "true" ]]; then
sudo rm -rf $srcdir/web3/target
sudo rm -rf $srcdir/target
fi
else
info "skip building godwoken-web3-indexer (gw-web3-indexer)"
Expand All @@ -557,10 +558,11 @@ function manual_build() {
# Godwoken devnet, so `--features gw-config/no-builtin` is appended
# to `cargo build` arguments.
erun docker run --rm \
--env CARGO_HOME=$WORKSPACE/packages/.cargo \
--workdir /app \
--volume $srcdir:/app \
--volume $WORKSPACE/packages/.rustup:/root/.rustup \
--workdir /app \
--volume $WORKSPACE/packages/.cargo:/app/.cargo \
--env CARGO_HOME=/app/.cargo \
$DOCKER_MANUAL_BUILD_IMAGE \
cargo build --locked --features gw-config/no-builtin

Expand Down Expand Up @@ -604,10 +606,12 @@ function manual_build() {
prepare_repo godwoken "$SCRIPTS_GIT_URL" "$SCRIPTS_GIT_CHECKOUT"

# Install capsule
# TODO: use cpasule from godwoken-manual-build image
if [ -z "$(command -v capsule)" ]; then
erun cargo install ckb-capsule
fi
# Fixme: error: Incompatible capsule version 0.10.1, this project requires a version that's compatible with 0.7.0
CAPSULE_VERSION=0.7.0
export CARGO_HOME=$WORKSPACE/packages/.cargo
(which capsule && test "$(capsule --version)" = "Capsule $CAPSULE_VERSION") \
|| erun cargo install ckb-capsule --version $CAPSULE_VERSION --force
$WORKSPACE/packages/.cargo/bin/capsule --version

erun cd $srcdir/c \&\& erun make all-via-docker
erun cd $srcdir \&\& capsule build --release --debug-output
Expand All @@ -620,8 +624,7 @@ function manual_build() {

# Copy the prebuild omni-lock to `docker/manual-artifacts/`
erun $DOCKER_COMPOSE -f $WORKSPACE/docker/docker-compose.yml run \
--rm \
--no-deps \
--rm --no-deps \
--volume=$dstdir:/godwoken-scripts \
--entrypoint "\"bash -c 'cp /scripts/godwoken-scripts/omni_lock /godwoken-scripts/omni_lock'\"" \
godwoken
Expand Down

0 comments on commit b725340

Please sign in to comment.