Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically lock on build if there is no lock dir #10487

Closed

Conversation

Leonidas-from-XIV
Copy link
Collaborator

This is more of an exploration of the toolchains work as it would automatically lock whenever any user that does not yet have a lock file calls dune build.

For an inclusion in the main dune this would need to be configurable on... something. The right criterion is up for discussion.

This is more of an exploration of the toolchains work as it would
automatically lock whenever any user that does not yet have a lock file
calls `dune build`.

For an inclusion in the main dune this would need to be configurable
on... something. The right criterion is up for discussion.

Signed-off-by: Marek Kubica <marek@tarides.com>
Copy link
Collaborator

@gridbugs gridbugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start but I think we also need to handle the case where the dependencies in dune-project are updated such that they no longer match what's in the lockdir. It should never be necessary to explicitly create a lockdir.

Happy for that to come in a later change though.

@@ -47,7 +47,21 @@ let run_build_system ~common ~request =
Cached_digest.invalidate_cached_timestamps ();
let* setup = Import.Main.setup () in
let request =
Action_builder.bind (Action_builder.of_memo setup) ~f:(fun setup -> request setup)
let open Action_builder.O in
let autolock =
Copy link
Collaborator

@emillon emillon May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to ease merging back into main, what do you think about inserting a seam here?
something like:

let use_autolock = true

...
let request =
  if use_autolock then
    ... this PR ...
  else
   ...original code
...

?

@Leonidas-from-XIV
Copy link
Collaborator Author

Closing in favor of #10546 which takes the suggestion from @emillon and requires an existing lock to trigger re-locking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants