Avoid head -c GNUism in reftests
head -c is not posix-compliant, use cut -b instead.
There's some problems with this implementation from what I can tell:
-
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?
-
Auto re-locking does not get triggered when local opam repositories are updated.
-
It does not use a lock so a user manually running
dune pkg lockcan race against the auto lock.
Apart from that, I have some questions:
-
How does one force dune to update remote opam repositories before running the auto lock?
-
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?
This PR can be closed as it was done in but in a different way in #10851.