dune icon indicating copy to clipboard operation
dune copied to clipboard

Implicit relock if the dependencies have changed

Open gridbugs opened this issue 1 year ago • 1 comments

If lockfiles exist and these are out of date, this PR runs the solver again to re-create the lock directory.

This is a copy of @Leonidas-from-XIV's PR https://github.com/ocaml/dune/pull/10546, but targeting main rather than the toolchains branch. I've changed it to use the same feature flags module introduced in https://github.com/ocaml/dune/pull/10639.

gridbugs avatar Jun 11 '24 12:06 gridbugs

There's some problems with this implementation from what I can tell:

  1. It adds the overhead of reading the lock directory and checking if it's up to date on every single iteration of the watch mode. Has this overhead been measured?

  2. Auto re-locking does not get triggered when local opam repositories are updated.

  3. It does not use a lock so a user manually running dune pkg lock can race against the auto lock.

Apart from that, I have some questions:

  1. How does one force dune to update remote opam repositories before running the auto lock?

  2. What happens when one doing is multiple updates to project files in succession? Does it mean this triggers multiple auto locks that all get staggered?

rgrinberg avatar Jun 15 '24 01:06 rgrinberg

This PR can be closed as it was done in but in a different way in #10851.

maiste avatar Sep 23 '24 13:09 maiste