Some checks failed
Rust / build-linux (linux-x86_64, X64, ubuntu-24.04, x86_64-unknown-linux-gnu) (pull_request) Failing after 8s
Rust / build-android (29.0.14206865, ubuntu-24.04, 33) (pull_request) Failing after 5s
Rust-lint / lint-linux (pull_request) Failing after 21s
Rust / build-linux (linux-aarch64, ARM64, ubuntu-24.04-arm, aarch64-unknown-linux-gnu) (pull_request) Has been cancelled
Rust / build-windows (windows-aarch64, woa64, windows-11-arm, aarch64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-windows (windows-x86_64, win64, windows-2025, x86_64-pc-windows-msvc) (pull_request) Has been cancelled
Rust / build-macos (macos-aarch64, ARM64, aarch64-apple-darwin) (pull_request) Has been cancelled
Rust / Collect release artifacts (pull_request) Has been cancelled
Review findings addressed (PR #17 bounce): 1. gate.sh put the provisioned cmake/ninja on PATH but never added their OWN lib root to LD_LIBRARY_PATH, so cmake died with exit 127 (librhash.so.0 / libuv.so.1 / libjsoncpp.so.25 not found) and cmake-rs misreported 'is cmake not installed?'. The LLVM_BIN2 block now exports LD_LIBRARY_PATH=~/local-tools/root/usr/lib/x86_64-linux-gnu (same append pattern as the other two roots; final value carries all three). 2. The gate was compile-only. It now runs three steps: cargo check --all-targets (type-check), cargo test --no-run (LINK every test binary), cargo test --lib (EXECUTE headless lib unit tests). 3. docs/build-gate.md: prerequisites list the provisioned cmake's shared-lib root, the test-execution decision record, and the new troubleshooting entry. Verified on the review box: cold full gate exits 0 (GATE_OK), step 1 check then 11m52s test-link codegen then 'running 0 tests / ok' (main has no #[test] fns yet; the inbound netplay PRs add ~38); warm re-run 5.6s.
82 lines
3.7 KiB
Bash
Executable File
82 lines
3.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# gopher64-netplay review gate (issue #16)
|
|
#
|
|
# Documented gate command (from a clean origin/main checkout):
|
|
# ./scripts/gate.sh
|
|
#
|
|
# What it does:
|
|
# 1. `git submodule update --init --recursive` (parallel-rdp,
|
|
# retroachievements/rcheevos, src/compat/sse2neon) — required by
|
|
# build.rs.
|
|
# 2. Wires the review box's user-local provisioning onto PATH/env (only
|
|
# when present; a no-op on hosts with system toolchains):
|
|
# - clang/clang++ from the local LLVM-18 root (build.rs requires
|
|
# clang for `-flto=thin`)
|
|
# - a real pkgconf + fontconfig/X11 dev pc files (the box has no
|
|
# system pkg-config/fontconfig and no sudo)
|
|
# - the provisioned cmake/ninja's OWN lib root on LD_LIBRARY_PATH
|
|
# (without it cmake dies with exit 127: librhash/libuv/libjsoncpp
|
|
# not found)
|
|
# 3. Runs the gate, as three distinguishable steps:
|
|
# a. `cargo check --all-targets` — TYPE-check everything, tests
|
|
# included (compile-only; the historical main blocker)
|
|
# b. `cargo test --no-run` — LINK every test binary (a test
|
|
# that type-checks but cannot link is still a broken gate)
|
|
# c. `cargo test --lib` — EXECUTE the headless library unit
|
|
# tests (netplay state sync etc.; see docs/build-gate.md)
|
|
#
|
|
# On AVX2-capable hardware, opt into the optimised CPU target:
|
|
# RUSTFLAGS="-C target-cpu=x86-64-v3" ./scripts/gate.sh
|
|
# (RUSTFLAGS REPLACES the config's rustflags for the whole invocation, so
|
|
# carry any other flags you need.)
|
|
set -euo pipefail
|
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$REPO_ROOT"
|
|
|
|
git submodule update --init --recursive
|
|
|
|
# --- Review-box provisioning ----------------------------------------------
|
|
LLVM_BIN="$HOME/local-tools/root/usr/lib/llvm-18/bin"
|
|
LLVM_BIN2="$HOME/local-tools/root/usr/bin"
|
|
FCPC="$HOME/.local/bin-fc/pkg-config"
|
|
FCROOT="$HOME/.local/fcroot/usr"
|
|
PC_DIR="$FCROOT/lib/x86_64-linux-gnu/pkgconfig"
|
|
|
|
if [ -d "$LLVM_BIN" ]; then
|
|
export PATH="$LLVM_BIN:$PATH" # clang / clang++ (build.rs needs clang)
|
|
fi
|
|
if [ -d "$LLVM_BIN2" ]; then
|
|
export PATH="$LLVM_BIN2:$PATH" # cmake, ninja, pkgconf, wayland-scanner
|
|
# cmake/ninja from this root link against librhash/libuv/libjsoncpp that
|
|
# ship in the SAME root (`usr/lib/x86_64-linux-gnu`); without that dir on
|
|
# LD_LIBRARY_PATH they die with exit 127 and cmake-rs reports it as
|
|
# "is `cmake` not installed?" — the issue #16 review bounce.
|
|
export LD_LIBRARY_PATH="$HOME/local-tools/root/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
fi
|
|
if [ -x "$FCPC" ] && [ -d "$PC_DIR" ]; then
|
|
export PATH="$(dirname "$FCPC"):$PATH" # real pkg-config (not the pypi shim)
|
|
export PKG_CONFIG_PATH="$PC_DIR"
|
|
# SDL's cmake resolves X11 via CMake's classic FindX11 module (path
|
|
# scan), not through pkg-config — point those scans at the root too.
|
|
export CMAKE_INCLUDE_PATH="$FCROOT/include${CMAKE_INCLUDE_PATH:+:$CMAKE_INCLUDE_PATH}"
|
|
export CMAKE_LIBRARY_PATH="$FCROOT/lib/x86_64-linux-gnu${CMAKE_LIBRARY_PATH:+:$CMAKE_LIBRARY_PATH}"
|
|
export LD_LIBRARY_PATH="$FCROOT/lib/x86_64-linux-gnu${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
fi
|
|
if [ -d "$HOME/local-tools/root/usr/lib/llvm-18/lib" ]; then
|
|
export LIBCLANG_PATH="$HOME/local-tools/root/usr/lib/llvm-18/lib" # bindgen/clang-sys
|
|
export LD_LIBRARY_PATH="$HOME/local-tools/root/usr/lib/llvm-18/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
|
fi
|
|
|
|
# --- Gate: type-check, then link tests, then run the headless lib tests ----
|
|
echo "GATE step 1/3: cargo check --all-targets"
|
|
cargo check --all-targets
|
|
|
|
echo "GATE step 2/3: cargo test --no-run"
|
|
cargo test --no-run
|
|
|
|
echo "GATE step 3/3: cargo test --lib"
|
|
cargo test --lib
|
|
|
|
echo "GATE_OK"
|
|
|