in reply to How to flush output to the console?

Don't know why exactly, if you're doing all this at compilation time there might be some salient differences in the context.
Try warn or otherwise printing to STDERR, which in my experience is always line buffered.

Originally posted as a Categorized Answer.