ocaml / ocaml/dune

program output from `exec -w` and rule actions interspersed with repeated dune status output

Open
#7,664 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

exec-watch
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Expected Behavior

When running an action associated with a rule, or dune execing an executable (both with watch-mode enabled, -w), no (apparent) console printing aside from the action/program being invoked should occur.

Actual Behavior

After upgrading to dune 3.7.1 (from 3.4.1), it now repeatedly prints a penultimate status update, e.g. Done: 99% (1202/1203, 1 left) before every line printed to stdout/err by a long-running process invoked via a rule's action. It appears to only watch-mode invocations, e.g. dune build @rundev -w --no-buffer.

Previously, it only printed that kind of progress message once, right before the action ran.

The same sort of issue appears when running a program via dune exec -w ..., though in that case, the repeated unwanted print is Success, waiting for filesystem changes....

Assuming dune isn't actually writing the same message over and over, I suspect the repeated messages are an artifact of how dune is writing to the connected terminal?

Reproduction

Add a rule to a dune file, with a run action pointing to an executable that emits e.g. log messages periodically, e.g.

(rule
 (alias rundev)
 (action
 (run %{bin:....})))

Specifications

  • Version of dune (output of dune --version): 3.7.1
  • Version of ocaml (output of ocamlc --version): 5.0.0
  • Operating system (distribution and version): Ubuntu 22.04.2, Linux 5.19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with a dune file rule using a long-running executable, dune build @rundev -w --no-buffer, and dune exec -w. Start by tracing watch-mode status and program-output handling; done means long-running actions and executed programs no longer interleave repeated status messages with stdout or stderr.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.