Skip to content

Remove --ignore-lock-dir as it has been obsoleted by --pkg=disabled - #13498

Merged
Leonidas-from-XIV merged 1 commit into
ocaml:mainfrom
Leonidas-from-XIV:remove-ignore-lock-dir
Feb 2, 2026
Merged

Leonidas-from-XIV merged 1 commit into
ocaml:mainfrom
Leonidas-from-XIV:remove-ignore-lock-dir

Conversation

@Leonidas-from-XIV

@Leonidas-from-XIV Leonidas-from-XIV commented Jan 30, 2026 •

Copy link
Copy Markdown
Member

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 #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 #13468
Closes #13469
Closes #13470
Closes #13472

@Leonidas-from-XIV Leonidas-from-XIV added the package management Dune's package management — `(pkg)` stanza, lockdirs, `dune pkg` commands label Jan 30, 2026
@ElectreAAS

Copy link
Copy Markdown
Collaborator

While I agree that originally the purpose of --ignore-lock-dir was just for opam builds and nothing else, a different usage has emerged since: enable pkg mgt without a lockdir, aka autolocking.
This PR removes that behaviour entirely. How are users to proceed?

@Leonidas-from-XIV

Copy link
Copy Markdown
Member Author

What is the usecase of such a configuration and why can't it be achieved using other means?

I think keeping the flag around makes the situation worse because you have to explain people how it all fits together. Whereas it's actually pretty easy:

  1. If package management is disabled, dune operates as before
  2. If it is enabled, and a lockfile in the source is configured, it will use that. If there isn't it will autolock.

Autolocking should not be an operation users need to be aware of, the same as users don't need to know that dune calls ocamldep internally. It just does its thing.

Adding more --do-this-if-that and --but-not-in-this-case options makes the user experience worse and people are confused by the amount of configuration options for something that's fundamentally very simple.

@ElectreAAS ElectreAAS left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You're right, this is better like this

@Leonidas-from-XIV
Leonidas-from-XIV merged commit a1106c6 into ocaml:main Feb 2, 2026
26 checks passed
@Leonidas-from-XIV
Leonidas-from-XIV deleted the remove-ignore-lock-dir branch February 2, 2026 13:15
@Alizter Alizter added this to the 3.22.0 milestone Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package management Dune's package management — `(pkg)` stanza, lockdirs, `dune pkg` commands

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 refactor(pkg): unify --ignore-lock-dir with --pkg flag

4 participants