From 7b94b9003daa1126ce78df37481fc52774c2f0b4 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Wed, 21 Oct 2026 11:08:50 +0000 Subject: feat(bundle): run the bundled compiler with input and streaming output Save before running, close prefilled stdin at EOF, and stream output bytes through Tauri channels. Stop and reap the child before exit or another run. Disable embedded stdout buffering and exercise the runner with real programs. Co-Authored-By: Claude Opus 5.5 --- tools/driver/EmbeddedRunner.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tools/driver') diff --git a/tools/driver/EmbeddedRunner.cc b/tools/driver/EmbeddedRunner.cc index 587d664..2833cfd 100644 --- a/tools/driver/EmbeddedRunner.cc +++ b/tools/driver/EmbeddedRunner.cc @@ -191,6 +191,12 @@ static llvm::Error loadCxxRuntime(llvm::orc::LLJIT &J) { } int runEmbedded(const cps::CodeGen &CG, const std::vector &Objects) { + // Pipes are fully buffered by default. Use the host CRT's stdout, also + // preferred by the JIT on Windows, so OUTPUT reaches desktop clients now. + if (std::setvbuf(stdout, nullptr, _IONBF, 0) != 0) { + llvm::errs() << "error: cannot configure embedded stdout\n"; + return 1; + } if (llvm::InitializeNativeTarget() || llvm::InitializeNativeTargetAsmPrinter()) { llvm::errs() << "error: cannot initialize the embedded LLVM target\n"; return 1; -- cgit v1.3.1-4-g156e