diff --git a/tools/selfhost/selfhost_build.sh b/tools/selfhost/selfhost_build.sh index 0ab3e359..e60037f2 100644 --- a/tools/selfhost/selfhost_build.sh +++ b/tools/selfhost/selfhost_build.sh @@ -8,9 +8,20 @@ # # Usage: # tools/selfhost/selfhost_build.sh --in source.hako [--json out.json] [--run] +# Options: +# --in FILE Input .hako source file (required) +# --json FILE Output Program(JSON v0) to FILE +# --run Run via Core-Direct after compilation +# --mir FILE Also emit MIR(JSON) to FILE +# --exe FILE Build native EXE via ny-llvmc +# --keep-tmp Keep temporary files +# --core Phase 80: Enable JoinIR Core ON (mainline path) +# --strict Phase 81: Enable Strict mode (fail-fast, no fallback) # Env: # NYASH_BIN: path to hakorune/nyash binary (auto-detected if omitted) # NYASH_ROOT: repo root (auto-detected) +# NYASH_JOINIR_CORE: Set to 1 for Core ON mode +# NYASH_JOINIR_STRICT: Set to 1 for Strict mode # set -euo pipefail @@ -47,6 +58,14 @@ apply_selfhost_env() { # Ensure core plugins (Console/Array/Map/String/Integer) are discoverable export NYASH_PLUGIN_PATH="${NYASH_PLUGIN_PATH:-$ROOT/target/release}" export NYASH_PLUGIN_PATHS="${NYASH_PLUGIN_PATHS:-$NYASH_PLUGIN_PATH}" + # Phase 80/81: JoinIR Core/Strict mode propagation + # Pass through NYASH_JOINIR_CORE and NYASH_JOINIR_STRICT if set + if [ -n "${NYASH_JOINIR_CORE:-}" ]; then + export NYASH_JOINIR_CORE + fi + if [ -n "${NYASH_JOINIR_STRICT:-}" ]; then + export NYASH_JOINIR_STRICT + fi } while [ $# -gt 0 ]; do @@ -57,6 +76,8 @@ while [ $# -gt 0 ]; do --mir) MIR_OUT="$2"; shift 2;; --keep-tmp) KEEP_TMP=1; shift;; --exe) EXE_OUT="$2"; shift 2;; + --strict) export NYASH_JOINIR_STRICT=1; shift;; # Phase 81: Fail-Fast mode + --core) export NYASH_JOINIR_CORE=1; shift;; # Phase 80: Core ON mode *) echo "[selfhost] unknown arg: $1" >&2; exit 2;; esac done