Files
hakorune/tools
nyash-codex 804ccff23f feat(phase73): Selfhost Stage-B I/O 簡素化 - HAKO_SRC 環境変数統一化
Unified selfhost Stage-B I/O path from argv to environment variables:
- Remove --source "$SRC_CONTENT" from compiler.hako invocation (argv limit)
- Export HAKO_SRC="$SRC_CONTENT" instead (env-based I/O)
- Update compiler_stageb.hako to check HAKO_SRC fallback

Changes:
1. lang/src/compiler/entry/compiler_stageb.hako:
   - Added HAKO_SRC env check in StageBArgsBox.resolve_src()
   - Fallback order: --source arg → HAKO_SOURCE_FILE_CONTENT → HAKO_SRC → default

2. tools/selfhost/selfhost_build.sh:
   - Removed --source "$SRC_CONTENT" from compiler.hako invocation
   - Export HAKO_SRC="$SRC_CONTENT" before Stage-B execution
   - Unified with wrapper pathway (HAKO_USE_BUILDBOX=1)

Benefits:
- Eliminates "Argument list too long" (os error 7) for large .hako files
- Single unified I/O pattern (env variables) for all Stage-B paths
- Consistent with hako_check.sh and wrapper pattern
- Ready for future HAKO_SRC_FILE optimization

Verification:
 NYASH_FEATURES=stage3 NYASH_USE_NY_COMPILER=1 \
  ./tools/selfhost/selfhost_build.sh --in apps/tests/stage1_run_min.hako --run
  Output: abc (correct)

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 13:09:10 +09:00
..