Phase 15のAOT/ネイティブビルド修正作業を継続中。 ChatGPTによるstd実装とプラグインシステムの改修を含む。 主な変更点: - apps/std/: string.nyashとarray.nyashの標準ライブラリ追加 - apps/smokes/: stdライブラリのスモークテスト追加 - プラグインローダーv2の実装改修 - BoxCallのハンドル管理改善 - JIT hostcall registryの更新 - ビルドスクリプト(build_aot.sh, build_llvm.sh)の調整 まだ修正作業中のため、一部の機能は不完全な状態。 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
67 lines
2.2 KiB
Bash
67 lines
2.2 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
|
BIN="$ROOT_DIR/target/release/nyash"
|
|
|
|
if [[ ! -x "$BIN" ]]; then
|
|
echo "[smoke] building nyash (release, cranelift-jit)..." >&2
|
|
(cd "$ROOT_DIR" && cargo build --release --features cranelift-jit >/dev/null)
|
|
fi
|
|
|
|
# Build required plugins (release)
|
|
build_plugin() {
|
|
local dir=$1
|
|
if [[ -d "$ROOT_DIR/$dir" ]]; then
|
|
echo "[smoke] building $dir ..." >&2
|
|
(cd "$ROOT_DIR/$dir" && cargo build --release >/dev/null)
|
|
fi
|
|
}
|
|
|
|
build_plugin plugins/nyash-python-plugin
|
|
build_plugin plugins/nyash-integer-plugin
|
|
build_plugin plugins/nyash-console-plugin
|
|
build_plugin plugins/nyash-math-plugin
|
|
|
|
export NYASH_CLI_VERBOSE=1
|
|
# Default: keep strict diagnostics off for plugin smoke unless explicitly enabled
|
|
if [[ "${NYASH_PLUGINS_STRICT:-0}" == "1" ]]; then
|
|
echo "[Plugins] Strict: ON" >&2
|
|
else
|
|
echo "[Plugins] Strict: OFF" >&2
|
|
fi
|
|
if [[ "${NYASH_PLUGINS_STRICT:-0}" != "1" ]]; then
|
|
# Override strict legacy MIR diagnostics for plugin smoke by default
|
|
export NYASH_OPT_DIAG_FORBID_LEGACY=0
|
|
fi
|
|
export NYASH_PLUGIN_STRICT=1
|
|
export NYASH_USE_PLUGIN_BUILTINS=1
|
|
export NYASH_PLUGIN_OVERRIDE_TYPES="ArrayBox,MapBox,ConsoleBox"
|
|
export NYASH_MIR_PLUGIN_INVOKE=1
|
|
|
|
run_case() {
|
|
local name=$1
|
|
local file=$2
|
|
echo "[smoke] case=$name file=$file" >&2
|
|
env -u NYASH_OPT_DIAG_FORBID_LEGACY "$BIN" --backend vm "$ROOT_DIR/$file" >/dev/null
|
|
echo "[smoke] ok: $name" >&2
|
|
}
|
|
|
|
# Core plugin demos
|
|
run_case py_math_sqrt_demo examples/py_math_sqrt_demo.nyash
|
|
run_case integer_plugin_demo examples/integer_plugin_demo.nyash
|
|
run_case console_demo examples/console_demo.nyash
|
|
run_case math_time_demo examples/math_time_demo.nyash
|
|
|
|
echo "[smoke] all green" >&2
|
|
|
|
# Second pass: disable builtins and re-run key cases
|
|
if [[ "${NYASH_SMOKE_STRICT_PLUGINS:-}" == "1" ]]; then
|
|
echo "[smoke] second pass with NYASH_DISABLE_BUILTINS=1" >&2
|
|
NYASH_DISABLE_BUILTINS=1 env -u NYASH_OPT_DIAG_FORBID_LEGACY \
|
|
"$BIN" --backend vm "$ROOT_DIR/examples/console_demo.nyash" >/dev/null
|
|
NYASH_DISABLE_BUILTINS=1 env -u NYASH_OPT_DIAG_FORBID_LEGACY \
|
|
"$BIN" --backend vm "$ROOT_DIR/examples/math_time_demo.nyash" >/dev/null
|
|
echo "[smoke] all green (builtins disabled)" >&2
|
|
fi
|