Skip to content

Fix: dune pkg enabled doesn't know about the flag --ignore-lock-dir - #13470

Closed
ElectreAAS wants to merge 2 commits into
ocaml:mainfrom
ElectreAAS:push-ksowmxoqqotm
Closed

ElectreAAS wants to merge 2 commits into
ocaml:mainfrom
ElectreAAS:push-ksowmxoqqotm

Conversation

@ElectreAAS

Copy link
Copy Markdown
Collaborator

Fixes #13469

Commit 1 adds the test reproducing the issue, commit 2 fixes it

$ test -d dune.lock
$ dune pkg enabled

However the --ignore-lock-dir option raises a bug in the detection mechanism

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That line made sense in the bug reproduction, but not so much once the bug is fixed ^^ Can you clarify what the expected behavior is?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oopsie, thanks :)

ElectreAAS pushed a commit to ElectreAAS/dune that referenced this pull request Feb 2, 2026
…d` (ocaml#13498)

The purpose of `--ignore-lock-dir` was to disable package management in
case a package was installed via OPAM as the presence of a lock dir was
the only thing required to trigger package management. Thus it was an
option that was implied in `-p`. But with ocaml#13458 merged, `-p` reasonably
switched to `--pkg=disabled`.

This leaves `--ignore-lock-dir` as a more or less worse version of
`--pkg=disabled`, with unclear semantics if these two options are
combined. This PR removes the option altogether.

As to why it was called `--ignore-lock-dir` and not
`--disable-package-management`: For the longest time an explicitly
created lock dir was the only way to use package management, thus these
two terms are equivalent. Notably, ``-ignore-lock-dir` should never
imply autolocking, because that directly contradicts the "disable in the
OPAM context" usecase.

Closes ocaml#13468
Closes ocaml#13469
Closes ocaml#13470
Closes ocaml#13472

Signed-off-by: Marek Kubica <[email protected]>
@ElectreAAS
ElectreAAS deleted the push-ksowmxoqqotm branch February 2, 2026 14:04
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.

The flag --ignore-lock-dir trips up the dune pkg enabled check

2 participants