The compiler carries its runtime and std inside itself; host module for the system it runs on

src/embedded.fch (made by tools/pack.fch, checked by tests/run.sh) holds runtime/finch_rt.c and std/; when they aren't
beside the binary they're written to the cache folder once. All the sh/cmd specifics of the driver (quoting, temp dir,
mkdir, rm, mv, null device, path separator, cache dir, binary stdio) moved into host.fch / host_windows.fch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015f73FesGZGYPkmDvUcj6QX
This commit is contained in:
Nexoniarz 2026-10-25 22:32:02 +01:00
commit 837ad45177
12 changed files with 354 additions and 59 deletions

View file

@ -10,6 +10,7 @@ set -u
cd "$(dirname "$0")"
FINCH=${FINCH:-../build/finch}
FINCH="$(cd "$(dirname "$FINCH")" && pwd)/$(basename "$FINCH")" # tests/shared.sh runs from another folder
FINCH_ROOT="$(cd .. && pwd)"
export FINCH_RT=${FINCH_RT:-$PWD/../runtime/finch_rt.c}
pass=0; failed=0
tmp=$(mktemp -d)
@ -78,6 +79,15 @@ else
head -5 "$tmp/shared.out"
fi
# the runtime and std carried inside the compiler are the files as they are now
"$FINCH_ROOT/bootstrap/pack.sh" "$FINCH" "$tmp/embedded.fch" 2>/dev/null
if cmp -s "$tmp/embedded.fch" "$FINCH_ROOT/src/embedded.fch"; then
pass=$((pass + 1))
else
failed=$((failed + 1))
echo "FAIL src/embedded.fch is out of date (run bootstrap/build.sh)"
fi
# the language server, talked to the way an editor does
if command -v python3 > /dev/null 2>&1; then
if FINCH="$FINCH" python3 lsp_test.py > "$tmp/lsp.out" 2>&1; then