Open and answer this issue on GitHub.
ready · opened 2026-11-15 · updated 2026-11-15 · 0 comments
Found while building #1672 (commit da744277): std::process::run hands back its output as text only and throws IoError::NotText on output that is not UTF-8. nikaia test compares a program’s output byte for byte, so its spawns in crates/nikaia/src/project.rs (ProgramHost::ran, outcome_of) have to stay in Rust (#557, #125). #1672 added about 40 more lines there: a process group and a watchdog for the time limit.
Probe:
use std::process
fn main() throws {
let out = process::run("printf", ["\\377"]) // throws NotText
println(out.stdout)
}
Decision (supervisor, 2026-11-15, obvious extension): There is no ADR that refuses this, and Bytes already exists. Add process::run_bytes(cmd, args), with the same options as run (including within, ADR-243 D9). It returns an output whose stdout and stderr are Bytes, with the same code, ok and timed_out, and it never throws NotText. The text form stays as it is.
To build
process::run_bytes in std, with the same spawn, limit and process-group path as run.tests/compiler/tests/ that runs printf '\377', gets one byte 0xff, and gets a non-zero exit code on failure.ProgramHost::ran and outcome_of from project.rs into project_tests.nika on top of run_bytes, and delete the Rust.Done when nikaia test spawns its programs only from Nikaia, and nikaia_test_time_limit and the nikaia_test* tests stay green.