Skip to content

Raise a user error when dune install is run with package management enabled. - #14427

Merged
Alizter merged 6 commits into
ocaml:mainfrom
Sudha247:dune-pkg-disable-dune-install
May 7, 2026
Merged

Raise a user error when dune install is run with package management enabled.#14427
Alizter merged 6 commits into
ocaml:mainfrom
Sudha247:dune-pkg-disable-dune-install

Conversation

@Sudha247

@Sudha247 Sudha247 commented May 5, 2026

Copy link
Copy Markdown
Member

Follow-up to #14289. Discussion on the previous PR concluded that this combination isn't supported, so this PR makes dune install raise a clean user error instead of crashing when package management is enabled.

Addresses the internal error from #14272

Comment thread bin/install_uninstall.ml Outdated
Comment thread bin/pkg/pkg_common.mli Outdated
@Sudha247
Sudha247 force-pushed the dune-pkg-disable-dune-install branch from 373b03b to f662cc8 Compare May 6, 2026 13:39

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only two changes to update the test, otherwise LGTM.

Comment thread test/blackbox-tests/test-cases/pkg/install-crash-lock-context.t Outdated
Comment thread test/blackbox-tests/test-cases/pkg/install-crash-lock-context.t Outdated
@Sudha247
Sudha247 requested review from Leonidas-from-XIV and removed request for Leonidas-from-XIV May 7, 2026 12:29
@Sudha247
Sudha247 force-pushed the dune-pkg-disable-dune-install branch from f662cc8 to ca5b6cb Compare May 7, 2026 12:34
Comment thread bin/pkg/pkg_common.mli Outdated
Comment thread bin/install_uninstall.ml Outdated
Sudha247 added 5 commits May 7, 2026 17:20
This is due to the fact that the `dune install` command is incompatible Dune pkg
and is susceptible to crashes.

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Re-use the function in pkg_enabled, and move it to pkg_common to avoid
repitition. There is already a similar function `check_pkg_management_enabled`
in pkg_common, but we're not using it here because its purpose is to just see if
dune-workspace has (pkg enabled), and it doesn't cover all the cases we want to
check, to know whether package management is enabled.

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
move the docstrings to the correct place, and add doc for pkg_enabled

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
@Sudha247
Sudha247 force-pushed the dune-pkg-disable-dune-install branch from ca5b6cb to 6ce66d4 Compare May 7, 2026 15:20
@Alizter

Alizter commented May 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks, I'll merge later when the CI is green. Just needs a dune fmt.

@Alizter Alizter self-assigned this May 7, 2026
elaborate on the new pkg_enabled function, and remove opam hint from the user error

Signed-off-by: Sudha Parimala <sudharg247@gmail.com>
@Sudha247
Sudha247 force-pushed the dune-pkg-disable-dune-install branch from 6ce66d4 to 836149c Compare May 7, 2026 16:07
@Sudha247

Sudha247 commented May 7, 2026

Copy link
Copy Markdown
Member Author

Thanks! Fixed the formatting issue.

@Alizter
Alizter merged commit 76deb06 into ocaml:main May 7, 2026
30 checks passed
@Alizter Alizter added the package management Dune's package management — `(pkg)` stanza, lockdirs, `dune pkg` commands label May 7, 2026
@Alizter Alizter added this to the 3.24.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.

4 participants