Hyperlight: output not flushed before exit is silently lost
Relevant area(s)
Windows
Brief description of your issue
In the Hyperlight backend (Python runtime), output that is still in the stdout buffer when the guest finishes is lost.
The run reports exit code 0 and returns empty stdout, with no error. A tool that ends with print(result, end="")
silently returns nothing to the caller.
Versions: MXC 1.0.0 and 1.0.1 (wxc-exec.exe from npm @microsoft/mxc-sdk), Windows 11 26300.9711,
after wxc-exec --setup-hyperlight=python.
Steps to reproduce
- Create
D.json:{"version": "1.1.0-alpha", "containment": "hyperlight", "hyperlight": {"runtime": "python"}, "process": {"commandLine": "print('hello', end='')", "timeout": 60000}} - Run
wxc-exec --experimental D.json. - Change the command to
print('hello', end='', flush=True)and run again.
Expected behavior
hello is printed in both runs (stdout flushed when the guest exits, as with a normal Python process).
Actual behavior
Run 1: exit code 0, empty stdout. Run 2: hello.
This is fixed upstream in hyperlight-unikraft since v0.19.0–the Python driver now flushes stdout/stderr at the end of every call, so no-newline output like print('hello', end='') isn't lost. MXC is pinned to v0.17.0, which predates it. I will put up a PR bumping the backend's crate pin + rootfs tag to pick it up 👍