-
Notifications
You must be signed in to change notification settings - Fork 456
Description
Problem description
There seems to be an issue with dune build -w. It can be observably slow due to a restriction of jobs. This can be seen as slow, since stopping watch mode and doing a fresh dune build will be much faster. The issue seems to be during the rule finding phase.
Here is a demonstration GIF of this behaviour. Details of what is happening are below:
dune build -wis run, and it works as expected. Most of the time is spent rule finding, but due to cache and everything already being built, it finishes quickly.- Next whilst watch mode is still running, an .ml file early in the dependency tree is changed, triggering a rebuild. Immediately you can observe the number of jobs drop to a low count. What is dune doing here?
- To demonstrate that this is an issue with watch mode, a fresh
dune buildis triggered, and as expected everything builds normally and quickly.
There are some key details with this setup. This is the main Coq repo being changed, and importantly there is ml code being edited which are later being depended on by dune Coq stanzas. Retrying the same test, but this time with the @check target (building only ml code) results in no observable slow down, leading me to believe that this is an issue with the interaction of rule finding and the Coq rules.
Reproduction
- Clone the https://github.com/coq/coq repo.
- Do
dune build -w. This will take a while but once it starts building .v files (see from--display=shortor--verbose) you can do the next step. - Edit an ml file, for example
kernel/declareops.ml, you can even droplet _hello = "world"inside. - Observe that the rebuild will now restrict itself to a low job count.
- Stopping watch mode and rebuilding will speed up the build again.
Specifications
- Version of
dune(output ofdune --version): 3.0.3 - Version of
ocaml(output ofocamlc --version) 4.12.1 - Operating system (distribution and version): Ubuntu
cc @rgrinberg
