#!/bin/bash cd "$(dirname "${BASH_SOURCE[0]}")" set -ea shopt -s expand_aliases PROFILE=${PROFILE:-release} if [ "${PROFILE}" = "release" ]; then BUILD_FLAGS="--release" fi if [ -z "$ARCH" ]; then ARCH=$(uname -m) fi if [ "$ARCH" = "arm64" ]; then ARCH="aarch64" fi RUST_ARCH="$ARCH" if [ "$ARCH" = "riscv64" ]; then RUST_ARCH="riscv64gc" fi cd .. FEATURES="$(echo $ENVIRONMENT | sed 's/-/,/g')" RUSTFLAGS="" if [[ "${ENVIRONMENT}" =~ (^|-)console($|-) ]]; then RUSTFLAGS="--cfg tokio_unstable" fi echo "FEATURES=\"$FEATURES\"" echo "RUSTFLAGS=\"$RUSTFLAGS\"" cross build --manifest-path=./core/Cargo.toml $BUILD_FLAGS --no-default-features --features cli-container,$FEATURES --locked --bin containerbox --target=$RUST_ARCH-unknown-linux-musl