Replace auto-installation of dev tools with autolocking
We have a feature in dune at the moment which is guarded behind --lock-dev-tool in our configure. When running commands like dune fmt it creates a lock directory for ocamlformat, reads it, builds ocmalformat and then uses it in the build.
I propose that we instead forgo the locking part of this process and instead leave it to dune tool install. This feature should really be about being able to get ocamlformat on-the-fly. For this we can use autolocking. This will avoid the race conditions we currently have where source directories are scanned before the lock directories are created.
What does "This feature" refer to in the following?
This feature should really be about being able to get ocamlformat on-the-fly
Is it the "auto-installation" functionality?
Could we just omit the magic here? I am not convinced there is much value in inferring the need to install stuff. Here's an alternative UI:
$ dune fmt
error: ocamlformat is not installed.
hint: run 'dune tools install ocamlformat'
Printing the hint can be conditional on (pkg enagled). This side steps the whole question of implicit installation by any means, without any significant downside for users, afaict.
I (weakly) hold the opinion that tho whole auto installation thing is a bit of an antifeature, as it leads to a tool doing things I have asked to to do.
The feature I am referencing here is the feature flag DUNE_CONFIG__PKG_DEV_TOOL=enabled. This allows things like dune fmt to lock the dev tool as it's running.