#!/usr/bin/env bash # SPDX-License-Identifier: MIT # Build the board's own native a2600-bench at the pinned commit, into this repository's # target/ (the board's tree and its Cargo.lock are not changed: --locked), for # scripts/check-node.mjs to compare the wasm against. set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) cd "$ROOT" BOARD_DIR=../a2600-rust-fast BOARD_PIN=ac4b2ed head=$(git -C "$BOARD_DIR" rev-parse --short=7 HEAD) [ "$head" = "$BOARD_PIN" ] || { echo "$BOARD_DIR is at $head, not the pinned $BOARD_PIN"; exit 1; } git -C "$BOARD_DIR" diff --quiet HEAD -- . || { echo "$BOARD_DIR has uncommitted changes"; exit 1; } TOOLCHAIN=${TOOLCHAIN:-"$HOME/.rustup/toolchains/1.93.1-x86_64-unknown-linux-gnu"} CARGO=${CARGO:-"$TOOLCHAIN/bin/cargo"} export RUSTC=${RUSTC:-"$TOOLCHAIN/bin/rustc"} CARGO_TARGET_DIR="$ROOT/target/board-native" "$CARGO" build --release --locked -q \ --manifest-path "$BOARD_DIR/Cargo.toml" --bin a2600-bench echo "built target/board-native/release/a2600-bench (a2600-rust-fast $head)"