Commit graph

22 commits

Author SHA1 Message Date
catbot
0ff9050eb3 fix: line-buffer stdout when redirected so progress/readiness lines flush
All checks were successful
CI / build-test-release (pull_request) Successful in 6m13s
When crafter-build's stdout is not a TTY (redirected to a file or pipe) the
C runtime defaults to full (block) buffering. The progress path is TTY-aware
and the in-place redraw flushes explicitly, but the non-TTY append path
(`[N/M]` lines), Finalize()'s `Built N steps` line and the `-r` server's
`listening on port :N` line all go through block-buffered stdout with no
flush. They accumulate in the buffer and only spill at ~4KB boundaries.

On a normal build this is hidden because the C runtime flushes stdout at
exit. Under `-r` the process never exits — it blocks in its serve loop — so
the trailing buffer is never flushed: a redirected log freezes mid-build (or
sits at 0 bytes) even though the build finished and the server is already
answering. Any tooling that polls the log for `Built …` / `listening …` /
`[N/N]` hangs forever. This is the real cause of the frozen log misdiagnosed
as a build deadlock in #16.

Fix: switch stdout to line buffering at the very top of main(), before any
output, only when stdout is not a terminal. Every `\n` then flushes, so the
markers reach a redirected log immediately. No behaviour change on a TTY.

Kept self-contained in main.cpp using system headers (isatty + setvbuf)
rather than a new Crafter::Progress export: the self-hosting exe build
compiles main.cpp against the installed/cached Crafter.Build module BMIs,
which shadow the freshly built local ones, so a new interface symbol would
not be visible without reinstalling crafter-build first.

Resolves #18

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 14:42:33 +00:00
f13671b2be v2 nearly done 2026-04-27 07:04:42 +02:00
5e1fcd8590 V2 progress 2026-04-23 01:57:25 +02:00
2d89528bdf fixed mingw
Some checks failed
demo.yaml / fixed mingw (push) Failing after 0s
2026-04-02 16:53:07 +02:00
8d521340d4 windows exception handler
Some checks failed
demo.yaml / windows exception handler (push) Failing after 0s
2026-03-09 20:22:01 +01:00
64945d95ef windows exception handler
Some checks failed
demo.yaml / windows exception handler (push) Failing after 0s
2026-03-09 20:20:17 +01:00
7a64859d24 windows exception handler
Some checks failed
demo.yaml / windows exception handler (push) Failing after 0s
2026-03-09 20:14:44 +01:00
04533b5778 windows build fix
Some checks failed
demo.yaml / windows build fix (push) Failing after 0s
2026-03-02 22:14:56 +01:00
2c6a7cb857 windows build fix
Some checks failed
demo.yaml / windows build fix (push) Failing after 0s
2026-03-01 20:24:35 +01:00
aac3785738 windows build fixes
Some checks failed
demo.yaml / windows build fixes (push) Failing after 0s
2026-03-01 15:58:08 +01:00
0efce16d3c windows build fixes
Some checks failed
demo.yaml / windows build fixes (push) Failing after 0s
2026-03-01 15:55:02 +01:00
d866d67a97 windows build fixes
Some checks failed
demo.yaml / windows build fixes (push) Failing after 0s
2026-03-01 15:52:13 +01:00
48417a4c7c added wine execute
Some checks failed
demo.yaml / added wine execute (push) Failing after 0s
2026-02-24 02:47:46 +01:00
0819baf6d3 fixed recursive libs
Some checks failed
demo.yaml / fixed recursive libs (push) Failing after 0s
2025-11-16 18:44:41 +01:00
c2bb9023d4 threaded exception handling
Some checks failed
demo.yaml / threaded exception handling (push) Failing after 0s
2025-11-15 19:20:33 +01:00
698665215b additional file fix 2025-11-09 20:08:23 +01:00
0179e102f5 changed help 2025-11-03 16:29:18 +01:00
ec64b17b27 update 2025-11-03 15:52:04 +01:00
ca25c838f5 deadlock fix 2025-11-01 11:53:09 +01:00
72effdee9b fix 2025-11-01 11:02:52 +01:00
c63f3430a5 test fixes 2025-11-01 06:50:41 +01:00
0eed272765 rewrite 2025-10-31 16:50:47 +01:00