Skip to content

Conversation

@Alizter
Copy link
Collaborator

@Alizter Alizter commented Nov 12, 2025

Reproduction and fix for #12717.

This test demonstrates two issues.

  1. We are making some assumptions about which custom lock directories we have in the workspace. This means that a rule wasn't being loaded or was being expected to exist.
  2. When combining the context stanza we get some internal errors. Seems to be fixed by feat(pkg): autolocking #12653.

@Leonidas-from-XIV
Copy link
Collaborator

The issue was originally brought up by @mefyl. We apparently never check a case where there just is no dune.lock at all (we check lock dirs in addition to dune.lock but never lock dirs that are named completely differently).

Very nice repro, should be easy to fix. I think the code that determines the lock dir always unconditionally adds dune.lock to the list, but shouldn't.

@Alizter
Copy link
Collaborator Author

Alizter commented Nov 12, 2025

@Leonidas-from-XIV I want to explore a fix for this before undrafting. If I manage to fix it I will include it in this PR.

@Leonidas-from-XIV
Copy link
Collaborator

It's probably in Pkg_common.lock_dirs_of_workspace where the default_path always gets unconditionally added to the list.

@Alizter Alizter changed the title test: switching to custom lock dir fix: switching to custom lock dir Nov 12, 2025
@Alizter Alizter marked this pull request as ready for review November 12, 2025 14:32
Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

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

Thanks, that is a very fast fix with a good repro case.

| _ :: _ :: _ ->
(* Multiple lock dirs but context doesn't specify which one to use,
fall back to default *)
Some default_source_path)
Copy link
Collaborator

Choose a reason for hiding this comment

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

But what if default_source_path is not in workspace.lock_dirs?

It might be correct; my question is more a behavioral: if the workspace specifies lock dirs, do they exist in addition to the default lock dir or replacing the default lock dir? Personally looking from a user perspective I would assume the latter, but I think it is worth being aware of the choice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants