Expected Behavior
For long-running processes like webservers, I'm normally starting dune exec --watch binary_name. Whenever I change a source code file, dune kills the running process, recompiles it and starts it again. This works with dune 3.19.1.
Actual Behavior
Since upgrading to dune 3.20.1, when changing the source code, the long-running process is not killed anymore. Recompilation only starts when the process exits on its own or I kill it manually.
Reproduction
-
create a dune project with the following code in bin/main.ml:
let () =
for i = 20 downto 0 do
Unix.sleep 1;
print_endline (string_of_int i);
done
and the following bin/dune:
(executable
(public_name countdown)
(name main)
(libraries unix))
-
start dune exec --watch countdown
-
change bin/main.ml
The countdown continues until it reaches 0. Then recompilation starts and the process is started again.
Specifications
- Version of
dune (output of dune --version): 3.20.1
- Version of
ocaml (output of ocamlc --version): 5.3.0
- Operating system (distribution and version): NixOS 25.05
Expected Behavior
For long-running processes like webservers, I'm normally starting
dune exec --watch binary_name. Whenever I change a source code file, dune kills the running process, recompiles it and starts it again. This works with dune3.19.1.Actual Behavior
Since upgrading to dune
3.20.1, when changing the source code, the long-running process is not killed anymore. Recompilation only starts when the process exits on its own or I kill it manually.Reproduction
create a dune project with the following code in
bin/main.ml:and the following
bin/dune:start
dune exec --watch countdownchange
bin/main.mlThe countdown continues until it reaches 0. Then recompilation starts and the process is started again.
Specifications
dune(output ofdune --version): 3.20.1ocaml(output ofocamlc --version): 5.3.0