deprecations: warn-once for nyash.toml (already wired) + child_env audit (spawns use helper); docs sweep to prefer and hako.toml in README.*; smokes: add Core‑Direct negative rc canaries (array oob set, map bad key) and verified quick/core core_direct suite green
This commit is contained in:
@ -241,7 +241,7 @@ WASM/ブラウザ経路は現在メンテ対象外です(CI未対象)。古
|
||||
|
||||
`hako.toml`(互換: `nyash.toml`)の `[tasks]` と `[env]` で、ビルド/スモークなどのタスクを簡単に実行できます(MVP)。
|
||||
|
||||
例(nyash.toml の末尾に追記):
|
||||
例(`hako.toml` もしくは互換の `nyash.toml` の末尾に追記):
|
||||
|
||||
```
|
||||
[env]
|
||||
@ -299,7 +299,7 @@ $NYASH_BIN --build hako.toml \
|
||||
```
|
||||
|
||||
主なオプション(最小)
|
||||
- `--build <path>`: nyash.toml の場所
|
||||
- `--build <path>`: `hako.toml` の場所(互換: `nyash.toml`)
|
||||
- `--app <file>`: エントリ `.nyash`
|
||||
- `--out <name>`: 出力EXE名(既定: `app`/`app.exe`)
|
||||
- `--build-aot cranelift|llvm`(既定: cranelift)
|
||||
@ -387,7 +387,7 @@ box EnhancedArray from ArrayBox {
|
||||
Nyashは「Everything is Plugin」アーキテクチャを開拓:
|
||||
|
||||
```toml
|
||||
# nyash.toml - プラグイン設定
|
||||
# hako.toml(互換: nyash.toml) - プラグイン設定
|
||||
[libraries."libnyash_python_plugin.so"]
|
||||
boxes = ["PyRuntimeBox", "PyObjectBox"]
|
||||
|
||||
|
||||
@ -290,7 +290,7 @@ The WASM/browser path is currently not maintained and is not part of CI. The old
|
||||
|
||||
## 🧰 One‑Command Build (MVP): `nyash --build`
|
||||
|
||||
Reads `hako.toml` (compat: nyash.toml), builds plugins → core → emits AOT object → links an executable in one shot.
|
||||
Reads `hako.toml` (compat: `nyash.toml`), builds plugins → core → emits AOT object → links an executable in one shot.
|
||||
|
||||
Basic (Cranelift AOT)
|
||||
```bash
|
||||
@ -300,7 +300,7 @@ $NYASH_BIN --build hako.toml \
|
||||
```
|
||||
|
||||
Key options (minimal)
|
||||
- `--build <path>`: path to nyash.toml
|
||||
- `--build <path>`: path to `hako.toml` (compat: `nyash.toml`)
|
||||
- `--app <file>`: entry `.nyash`
|
||||
- `--out <name>`: output executable (default: `app`/`app.exe`)
|
||||
- `--build-aot cranelift|llvm` (default: cranelift)
|
||||
@ -467,7 +467,7 @@ typedef struct {
|
||||
|
||||
### Plugin Configuration
|
||||
```toml
|
||||
# nyash.toml v3.0 - Unified plugin support
|
||||
# hako.toml v3.0 (compat: nyash.toml) - Unified plugin support
|
||||
[plugins.map]
|
||||
path = "plugins/map.so"
|
||||
abi = "c" # Traditional C ABI
|
||||
|
||||
@ -27,6 +27,7 @@ JSON_OUT=""
|
||||
MIR_OUT=""
|
||||
EXE_OUT=""
|
||||
DO_RUN=0
|
||||
KEEP_TMP=0
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
@ -34,6 +35,7 @@ while [ $# -gt 0 ]; do
|
||||
--json) JSON_OUT="$2"; shift 2;;
|
||||
--run) DO_RUN=1; shift;;
|
||||
--mir) MIR_OUT="$2"; shift 2;;
|
||||
--keep-tmp) KEEP_TMP=1; shift;;
|
||||
--exe) EXE_OUT="$2"; shift 2;;
|
||||
*) echo "[selfhost] unknown arg: $1" >&2; exit 2;;
|
||||
esac
|
||||
@ -122,8 +124,10 @@ if [ -n "$EXE_OUT" ]; then
|
||||
"$NYLL" --in "$MIR_TMP" --emit exe --nyrt "$NYRT_DIR" --out "$EXE_OUT"
|
||||
|
||||
# Cleanup
|
||||
if [ "$KEEP_TMP" != "1" ]; then
|
||||
if [ -z "$JSON_OUT" ]; then rm -f "$tmp_json" 2>/dev/null || true; fi
|
||||
if [ -z "$MIR_OUT" ]; then rm -f "$MIR_TMP" 2>/dev/null || true; fi
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@ -135,7 +139,7 @@ if [ "$DO_RUN" = "1" ]; then
|
||||
"$BIN" --json-file "$tmp_json" >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
if [ -z "$JSON_OUT" ]; then rm -f "$tmp_json" 2>/dev/null || true; fi
|
||||
if [ "$KEEP_TMP" != "1" ] && [ -z "$JSON_OUT" ]; then rm -f "$tmp_json" 2>/dev/null || true; fi
|
||||
exit $rc
|
||||
else
|
||||
# Emit-only
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# core_direct_array_oob_set_rc_vm.sh — Core Direct: array out-of-bounds set → non‑zero rc
|
||||
|
||||
set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
if ROOT_GIT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null); then
|
||||
ROOT="$ROOT_GIT"
|
||||
else
|
||||
ROOT="$(cd "$SCRIPT_DIR/../../../../../../../../.." && pwd)"
|
||||
fi
|
||||
source "$ROOT/tools/smokes/v2/lib/test_runner.sh"
|
||||
source "$ROOT/tools/smokes/v2/lib/stageb_helpers.sh"
|
||||
require_env || exit 2
|
||||
|
||||
# Set index=5 on a 3-size array → OOB should trigger rc != 0 under Core‑Direct
|
||||
code='static box Main { method main(args) { local a=ArrayBox(); a.push(1); a.push(2); a.push(3); a.set(5, 9); return 0 } }'
|
||||
json=$(stageb_compile_to_json "$code") || { echo "[FAIL] core_direct_array_oob_set_rc_vm (emit failed)" >&2; exit 1; }
|
||||
|
||||
set +e
|
||||
NYASH_GATE_C_CORE=1 HAKO_GATE_C_CORE=1 HAKO_CORE_DIRECT=1 \
|
||||
NYASH_QUIET=1 HAKO_QUIET=1 NYASH_CLI_VERBOSE=0 NYASH_NYRT_SILENT_RESULT=1 \
|
||||
"$NYASH_BIN" --json-file "$json" >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
rm -f "$json"
|
||||
|
||||
if [ "$rc" -ne 0 ]; then
|
||||
echo "[PASS] core_direct_array_oob_set_rc_vm"
|
||||
else
|
||||
echo "[FAIL] core_direct_array_oob_set_rc_vm (rc=$rc)" >&2; exit 1
|
||||
fi
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
# core_direct_map_bad_key_rc_vm.sh — Core Direct: Map.get with non-string key → non‑zero rc
|
||||
|
||||
set -euo pipefail
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
if ROOT_GIT=$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel 2>/dev/null); then
|
||||
ROOT="$ROOT_GIT"
|
||||
else
|
||||
ROOT="$(cd "$SCRIPT_DIR/../../../../../../../../.." && pwd)"
|
||||
fi
|
||||
source "$ROOT/tools/smokes/v2/lib/test_runner.sh"
|
||||
source "$ROOT/tools/smokes/v2/lib/stageb_helpers.sh"
|
||||
require_env || exit 2
|
||||
|
||||
# Map.get requires string key; using int key should raise [map/bad-key] and map to rc != 0
|
||||
code='static box Main { method main(args) { local m=MapBox(); local x=m.get(123); return 0 } }'
|
||||
json=$(stageb_compile_to_json "$code") || { echo "[FAIL] core_direct_map_bad_key_rc_vm (emit failed)" >&2; exit 1; }
|
||||
|
||||
set +e
|
||||
NYASH_GATE_C_CORE=1 HAKO_GATE_C_CORE=1 HAKO_CORE_DIRECT=1 \
|
||||
NYASH_QUIET=1 HAKO_QUIET=1 NYASH_CLI_VERBOSE=0 NYASH_NYRT_SILENT_RESULT=1 \
|
||||
"$NYASH_BIN" --json-file "$json" >/dev/null 2>&1
|
||||
rc=$?
|
||||
set -e
|
||||
rm -f "$json"
|
||||
|
||||
if [ "$rc" -ne 0 ]; then
|
||||
echo "[PASS] core_direct_map_bad_key_rc_vm"
|
||||
else
|
||||
echo "[FAIL] core_direct_map_bad_key_rc_vm (rc=$rc)" >&2; exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user