Hi Joachim,
> But I’m a bit disappointed by shake’s default output.
Fortunately, tweaking up some UI output is much easier than writing a
build system, so hopefully we can get somewhere!
> Depending on the
> target, some of the programs to run are rather boring, other very
> interesting targets have no external command that are being run...
There are two ways to change what gets output:
* Write it yourself with putNormal, e.g. putNormal "This command is important"
* Run a command with quietly to suppress its normal output.
There's a bit more on this topic at
http://stackoverflow.com/questions/31852826/how-to-change-the-information-printed-by-shake-during-a-build
> What I would like to see would be a status like this at the bottom of
> the output:
>
> target4: ✓ done
> target3: ✓ done
> target6: ☠ failed
> target1: … running gccc
> target2: waiting for target3
> target3: … buiding
>
> So, what this means is that shake is runnning with "-j2", currently
> working on the (independent) targets target1 and target2. It already
> has built target4, target3 and target6, where the latter has failed
> (presumably due to shakeStaunch=True). target2 has also been started,
> but is right now waiting for target3. target1 is actually running a
> command, while target3 is doing “something”. Ideally, there would be a
> "Action a -> Action a" combinator that I can use to tell the system
> what I’m doing right now.
This seems to capture a lot of interesting information that I'm not
convinced that build system can figure out. Taking some examples of
programs that produce output similar to what I think Shake could
perhaps produce:
* Stack prints out "configuring foo", "building foo", "installed foo"
as lines that scroll upwards, and a single status line at the bottom
that says how many things it has left to do.
* Ninja prints out a single line of the most recent thing it started.
* Buck prints out N lines, one for each processor (e.g. 2 with -j2)
saying the current command it is working on.
How did you pick the 6 specific targets to be the ones that are displayed?
> It would update the lines for the “active” targets (target1, target2
> and target3) as they change (using curses or whatever is required to do
> that), while finished targets scroll up as usual.
Yes, requiring curses starts to make things a lot harder.
> Ideally, any output from running targetn would also appear above the
> “active” targets, prefixed with "targetn: ". But that’s maybe asking
> too much.
That's possible, if you're willing to take a performance hit as it
can't just connect up stdout with the console stdout as it does now.
> Is it such a view possible, or maybe even implemented somewhere? Can I
> query shake for its current view somehow? And does this even fit
> Shake’s data model, as I maybe naively assume?
There's nothing you can do on the outside to get exactly what you
want, but let's figure out what heuristics you are thinking of
applying, and we can figure out if Shake should provide something.
There's already
https://github.com/ndmitchell/shake/issues/18 which
tracks the desire for something shorter.
Thanks, Neil