makepad/libs/relax/compiler/tests/vendored/run.sh
Admin b22a714840 makepad run: the Rust JIT (libs/relax) and makepad-remote
The JIT that runs makepad apps from source: lexer, front end, type checker,
lazy borrow checker (Gandalf; `--check-first` opts in), codegen, session and
warm/cold caches keyed by compiler stamp, provided crates bound late,
startup images, live patching. User-facing name is `makepad run` (binary
`makepad`, MAKEPAD_RUN_* env, ~/.makepad-run); libs/relax stays the internal
library name. `makepad check` reports rustc-style diagnostics with rustc
error codes and checks a whole workspace (`--workspace`). Runs on macOS,
Linux, Windows and Android. makepad-remote: one tool schema for apps and the
WM (app/1): grabs, captures, traces, frame profiles and tweaks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-13 12:26:21 +02:00

18 lines
1.3 KiB
Bash
Executable file

#!/bin/bash
# usage: run.sh <makepad binary>: registry dependencies come from the directory `.cargo/config.toml`
# replaces crates-io with (vendor/, transitively, no Cargo.lock), with an empty CARGO_HOME; a
# dependency that is not vendored fails naming the vendored directory (no registry is ever asked); a
# registry package with a C build-dependency (cc) is refused.
# Prints "vendored: ok" or "vendored: FAILED" (exit 1).
H=$(cd "$(dirname "$0")" && pwd)
export MAKEPAD_RUN_CACHE=off
# an empty CARGO_HOME (no registry cache, no config) under the ignored target/
E=$H/target/empty-cargo-home
mkdir -p "$E"
OUT=$(cd "$H/app" && CARGO_HOME=$E MAKEPAD_RUN_STD=$H/../../std "$1" run --quiet vendored-app 2>&1 | grep -v '^relax-\|^makepad \(run\|check\|live\|fix\):')
MISS=$(cd "$H/missing" && CARGO_HOME=$E MAKEPAD_RUN_STD=$H/../../std "$1" run --quiet vendored-missing 2>&1)
WITHC=$(cd "$H/withc" && CARGO_HOME=$E MAKEPAD_RUN_STD=$H/../../std "$1" run --quiet vendored-withc 2>&1)
echo "$OUT"
echo "$MISS" | grep -m1 'not vendored'
echo "$WITHC" | grep -m1 'compiles C'
if [ "$OUT" = "vendored ok 42 7" ] && echo "$MISS" | grep -q "registry package \`notvendored\` is not vendored in $H/vendor" && echo "$WITHC" | grep -q "registry package \`cbuild\` 0.1.0 compiles C or C++ (build-dependency \`cc\`)"; then echo "vendored: ok"; else echo "vendored: FAILED"; exit 1; fi