From 289dd0d5ab8de50e5a38f994e1a5b5b89f68abb6 Mon Sep 17 00:00:00 2001 From: nyash-codex Date: Sun, 2 Nov 2025 07:26:26 +0900 Subject: [PATCH] =?UTF-8?q?runner(selfhost):=20apply=20child=5Fenv::apply?= =?UTF-8?q?=5Fcore=5Fwrapper=5Fenv=20to=20Python=20harness/PyVM=20spawns?= =?UTF-8?q?=20(unify=20child=20env).=20docs:=20CURRENT=5FTASK=20P1(part?= =?UTF-8?q?=E2=80=911)=20progress=20recorded.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CURRENT_TASK.md | 11 +++++++++++ src/runner/selfhost.rs | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CURRENT_TASK.md b/CURRENT_TASK.md index 72450fa9..38651a9b 100644 --- a/CURRENT_TASK.md +++ b/CURRENT_TASK.md @@ -21,6 +21,17 @@ Update — 2025-11-02(Stage‑B opt‑in/Runnerヘルパー適用/quick:co - ルート検出の不安定スクリプトは `git rev-parse` + fallback 形式に統一。 - quick(core フィルタ): 115/115 PASS を確認。既定セットは赤ゼロ。 +Update — 2025-11-02 (P1, part‑1) — Runner子ENV一元化+Stage‑B入口の軽量化の徹底 +- Runner 子経路のENV一元化を追加適用 + - `src/runner/selfhost.rs` の Python harness / PyVM runner の spawn にも + `child_env::apply_core_wrapper_env` を適用(JSON_ONLY/disable plugins/using禁などを統一)。 +- Stage‑B 入口の軽量化(emitの1行保証) + - `compiler_stageb.hako` は Stage‑1 Program(JSON v0) を1行出力(heavyな MIR 直行を回避)。 + - FlowEntry は v1→v0(軽経路)を優先し、using 付き v0 と v1+meta は二段目の候補に降格。 + - `lower_stage1_to_mir_with_usings` のデバッグ出力は既定OFF(prefer==9 の時のみ)。 +- quick: core/stageb canaries は引き続き PASS(opt‑in)。昇格基準(print まで PASS)を達した時点で既定ONへの切替を検討。 + + Update — 2025-09-28 (P4 default‑on + P5 docs/annotations 完了) - Known 正規化(userbox限定・関数存在・一意・arity一致)を既定ON。 diff --git a/src/runner/selfhost.rs b/src/runner/selfhost.rs index c1f89439..bfb79903 100644 --- a/src/runner/selfhost.rs +++ b/src/runner/selfhost.rs @@ -208,6 +208,7 @@ impl NyashRunner { let py = std::path::Path::new("tools/ny_parser_mvp.py"); if py.exists() { let mut cmd = std::process::Command::new(&py3); + crate::runner::child_env::apply_core_wrapper_env(&mut cmd); cmd.arg(py).arg(&tmp_path); let timeout_ms: u64 = std::env::var("NYASH_NY_COMPILER_TIMEOUT_MS") .ok() @@ -313,7 +314,9 @@ impl NyashRunner { else if allow_top && module.functions.contains_key("main") { "main" } else if module.functions.contains_key("main") { eprintln!("[entry] Warning: using top-level 'main' without explicit allow; set NYASH_ENTRY_ALLOW_TOPLEVEL_MAIN=1 to silence."); "main" } else { "Main.main" }; - let status = std::process::Command::new(py3) + let mut cmd = std::process::Command::new(py3); + crate::runner::child_env::apply_core_wrapper_env(&mut cmd); + let status = cmd .args(["tools/pyvm_runner.py", "--in", &mir_json_path.display().to_string(), "--entry", entry]) .status() .map_err(|e| format!("spawn pyvm: {}", e))