feat: HTTP registry, app/bench harnesses, and DWARF #line maps
Ship QUALITY_PLAN sessions 31–33: fetchable package index URLs, showcase app and micro/nexus benchmarks, and debugger-friendly C codegen. - Registry: BUX_REGISTRY accepts http(s) URLs (curl/wget → ~/.bux/cache) - E.2: make test-apps smoke for nexus/boko/simpledb/jwt-pitbul - E.5: benches/micro + C/Nim/Zig twins; make bench-nexus (wrk) - E.4: HIR locs → #line .bux; default -O0 -g; --release -O2; make test-dwarf
This commit is contained in:
+48
-3
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Smoke: registry search + add + install + build with greet package (E.1)
|
||||
# Also verifies HTTP-fetchable registry index (E.1b).
|
||||
set -euo pipefail
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
BUXC="$ROOT/buxc"
|
||||
@@ -10,9 +11,17 @@ if [[ ! -x "$BUXC" ]]; then
|
||||
fi
|
||||
|
||||
TMP=$(mktemp -d)
|
||||
trap 'rm -rf "$TMP"' EXIT
|
||||
HTTP_PID=""
|
||||
cleanup() {
|
||||
if [[ -n "$HTTP_PID" ]]; then
|
||||
kill "$HTTP_PID" 2>/dev/null || true
|
||||
wait "$HTTP_PID" 2>/dev/null || true
|
||||
fi
|
||||
rm -rf "$TMP"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
|
||||
echo "=== bux search greet ==="
|
||||
echo "=== bux search greet (local file) ==="
|
||||
"$BUXC" search greet | tee "$TMP/search.out"
|
||||
grep -q greet "$TMP/search.out"
|
||||
|
||||
@@ -61,4 +70,40 @@ echo "=== bux run ==="
|
||||
"$BUXC" run . | tee "$TMP/run.out"
|
||||
grep -q "Hello, Bux!" "$TMP/run.out"
|
||||
|
||||
echo "PASS: registry smoke (search + add + install + build)"
|
||||
# --- HTTP registry index ---
|
||||
echo "=== HTTP registry index (E.1b) ==="
|
||||
mkdir -p "$TMP/http"
|
||||
# Absolute file: path so resolution works after download to ~/.bux/cache
|
||||
cat > "$TMP/http/registry.toml" <<EOF
|
||||
[[package]]
|
||||
name = "greet"
|
||||
version = "0.1.1"
|
||||
source = "file:$ROOT/registry/packages/greet"
|
||||
description = "HTTP-served greet package"
|
||||
EOF
|
||||
|
||||
# Free port via python
|
||||
PORT=$(python3 -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1",0)); print(s.getsockname()[1]); s.close()')
|
||||
(
|
||||
cd "$TMP/http"
|
||||
python3 -m http.server "$PORT" --bind 127.0.0.1 >/dev/null 2>&1
|
||||
) &
|
||||
HTTP_PID=$!
|
||||
# Wait until server responds
|
||||
for _ in 1 2 3 4 5 6 7 8 9 10; do
|
||||
if curl -fsS "http://127.0.0.1:${PORT}/registry.toml" >/dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
export BUX_REGISTRY="http://127.0.0.1:${PORT}/registry.toml"
|
||||
export BUX_REGISTRY_REFRESH=1
|
||||
"$BUXC" search greet | tee "$TMP/http_search.out"
|
||||
grep -q greet "$TMP/http_search.out"
|
||||
grep -q "http://127.0.0.1" "$TMP/http_search.out" || grep -q "cached" "$TMP/http_search.out"
|
||||
unset BUX_REGISTRY_REFRESH
|
||||
# Second search should hit cache without refresh
|
||||
"$BUXC" search greet | grep -q greet
|
||||
|
||||
echo "PASS: registry smoke (local + HTTP search + add + install + build)"
|
||||
|
||||
Reference in New Issue
Block a user