Add scripts/verify-rust-build.sh to verify all Rust crates (veza-common, veza-chat-server, veza-stream-server) compile in release mode. Phase 1 audit - P1.2
40 lines
899 B
Bash
Executable file
40 lines
899 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Verify that all Rust services (veza-common, veza-chat-server, veza-stream-server) compile in release mode.
|
|
# Usage: ./scripts/verify-rust-build.sh
|
|
# Exit: 0 on success, 1 on failure
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
cd "$REPO_ROOT"
|
|
|
|
echo "=== Verifying Rust build (release mode) ==="
|
|
|
|
build_crate() {
|
|
local crate="$1"
|
|
echo ""
|
|
echo "Building $crate..."
|
|
if (cd "$crate" && cargo build --release); then
|
|
echo " OK: $crate"
|
|
return 0
|
|
else
|
|
echo " FAILED: $crate"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
failed=0
|
|
|
|
build_crate "veza-common" || failed=1
|
|
build_crate "veza-chat-server" || failed=1
|
|
build_crate "veza-stream-server" || failed=1
|
|
|
|
echo ""
|
|
if [ $failed -eq 0 ]; then
|
|
echo "=== All Rust crates built successfully ==="
|
|
exit 0
|
|
else
|
|
echo "=== Some Rust crates failed to build ==="
|
|
exit 1
|
|
fi
|