60 lines
1.9 KiB
Bash
Raw Normal View History

2025-12-18 09:58:47 +01:00
#!/usr/bin/env bash
set -euo pipefail
2026-01-26 16:36:51 +01:00
LOGOS_BLOCKCHAIN_NODE_REV="${LOGOS_BLOCKCHAIN_NODE_REV:?LOGOS_BLOCKCHAIN_NODE_REV build arg missing}"
2025-12-18 09:58:47 +01:00
mkdir -p /workspace/artifacts
TARGET_ARCH="$(uname -m)"
have_prebuilt() {
[ -f testing-framework/assets/stack/bin/logos-blockchain-node ] && \
2026-01-26 08:26:15 +01:00
[ -f testing-framework/assets/stack/bin/logos-blockchain-node ]
2025-12-18 09:58:47 +01:00
}
bin_matches_arch() {
local info
info="$(file -b testing-framework/assets/stack/bin/logos-blockchain-node 2>/dev/null || true)"
2025-12-18 09:58:47 +01:00
case "${info}" in
*ELF*) : ;;
*) return 1 ;;
esac
local pattern
case "${TARGET_ARCH}" in
x86_64) pattern="x86-64|x86_64" ;;
aarch64|arm64) pattern="arm64|aarch64" ;;
*) pattern="${TARGET_ARCH}" ;;
esac
echo "${info}" | grep -Eqi "${pattern}"
}
if have_prebuilt && bin_matches_arch; then
echo "Using prebuilt logos-blockchain binaries from testing-framework/assets/stack/bin"
cp testing-framework/assets/stack/bin/logos-blockchain-node /workspace/artifacts/logos-blockchain-node
2025-12-18 09:58:47 +01:00
exit 0
fi
if have_prebuilt; then
echo "Prebuilt logos-blockchain binaries do not match target architecture (${TARGET_ARCH}); rebuilding from source"
2025-12-18 09:58:47 +01:00
else
echo "Prebuilt logos-blockchain binaries missing; building from source"
2025-12-18 09:58:47 +01:00
fi
2026-01-26 16:36:51 +01:00
echo "Building logos-blockchain binaries from source (rev ${LOGOS_BLOCKCHAIN_NODE_REV})"
2025-12-18 09:58:47 +01:00
git clone https://github.com/logos-co/nomos-node.git /tmp/nomos-node
cd /tmp/nomos-node
2026-01-26 16:36:51 +01:00
git fetch --depth 1 origin "${LOGOS_BLOCKCHAIN_NODE_REV}"
git checkout "${LOGOS_BLOCKCHAIN_NODE_REV}"
2025-12-18 09:58:47 +01:00
git reset --hard
git clean -fdx
2026-02-05 08:23:14 +02:00
# Enable high-active-slot-coefficient via cfg to keep test blocks frequent.
RUSTFLAGS='--cfg feature="high-active-slot-coefficient"' \
2026-01-26 08:26:15 +01:00
cargo build --features "testing" -p logos-blockchain-node
2025-12-18 09:58:47 +01:00
cp /tmp/nomos-node/target/debug/logos-blockchain-node /workspace/artifacts/logos-blockchain-node
2025-12-18 09:58:47 +01:00
rm -rf /tmp/nomos-node/target/debug/incremental