Dune: terminal output dilemma

Is there a way to get the command line output from dune build (either literal or condensed) but not the progress counter? It looks like any --display= setting except quiet turns on the progress meter :frowning:

In many tools with similar interface, the answer is to redirect stderr to /dev/null, since the progress meter is usually written to stderr. Unfortunately, dune build seems to send everything to stderr, so such a redirect mutes the command echoing too. I can only wonder what was the reason for this decision.


I don’t think this is possible off the top of my head. Adding a --no-progress flag seems a reasonable idea. Perhaps open an issue over GitHub - ocaml/dune: A composable build system for OCaml.?


I came up with this ugly workaround:

( eval `opam env` && env -u INSIDE_EMACS dune build lib/ --display=short ) 2>&1 | cat

-u INSIDE_EMACS is key: without it, dune will force the progress on even though output goes into a pipe. I feel strongly that this is a bug, will report as such.


It turns out there is a related open issue already:

Redirecting dune output

I just added my comments to it.