Skip to content

Conversation

@rgrinberg
Copy link
Member

Add a [deopts] field to allow users to select depopts.

The depopts are selected globally for all packages that list them. This is inline with how opam does things.

Fixes #11643

Signed-off-by: Rudi Grinberg me@rgrinberg.com

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.

Apart from the typo it looks good and the test works really well. Could use a mention of the depopts field in the documentation.

What do you think about allowing something like :all to enable all depopts? I recently was wanting for this in OPAM but it doesn't support it such an option.

Add a [deopts] field to allow users to select depopts.

The depopts are selected globally for all packages that list them. This
is inline with how opam does things.

Fixes #11643

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: 430e82d6-3fe8-4a81-9692-c0d680a58591 -->

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg rgrinberg force-pushed the ps/rr/feature__depopt_selection_in_the_workspace branch from 660b7ee to a8f3d0d Compare May 8, 2025 22:23
@rgrinberg
Copy link
Member Author

What do you think about allowing something like :all to enable all depopts? I recently was wanting for this in OPAM but it doesn't support it such an option.

Turns out that such a thing isn't that simple to implement. The only way to determine all depopts is to first find a solution.

We could perhaps implement something that's close enough semantically by introducing a "depopts_required" mode. This would just merge depopt constraints into depends constraints for every package and solve. I don't know if that's going to work, but you're welcome to experiment if you have a use case for this.

@Leonidas-from-XIV Leonidas-from-XIV merged commit 81fe878 into main May 9, 2025
23 of 24 checks passed
@Leonidas-from-XIV Leonidas-from-XIV deleted the ps/rr/feature__depopt_selection_in_the_workspace branch May 9, 2025 07:55
@bnguyenvanyen
Copy link

Hi, thanks a lot for having implemented this.Is this not missing a mention in CHANGES.md, and a guard on the language version ?

@Alizter
Copy link
Collaborator

Alizter commented May 13, 2025

@bnguyenvanyen Since this is a package management related PR and package management is considered "experimental" until we have a full-release, we generally tend not to include changes in the changelog or add version guards. When package management is officially released, there will be backwards compatible changes but until then it allows us to change the implementation details and design without friction.

@bnguyenvanyen
Copy link

@Alizter Ok, thank you. I ask because we started using the depopts stanza (at Routine) and it broke downstream packages that did not have the correct dune version (because they're still using opam). We'll pin versions downstream for now I guess.

Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this pull request Jul 8, 2025
Has been added in commit 81fe878, from PR ocaml#11773.

Signed-off-by: Marek Kubica <marek@tarides.com>
Leonidas-from-XIV added a commit to Leonidas-from-XIV/dune that referenced this pull request Jul 9, 2025
Has been added in commit 81fe878, from PR ocaml#11773.

Signed-off-by: Marek Kubica <marek@tarides.com>
Leonidas-from-XIV added a commit that referenced this pull request Jul 9, 2025
Has been added in commit 81fe878, from PR #11773.

Signed-off-by: Marek Kubica <marek@tarides.com>
Sudha247 pushed a commit to Sudha247/dune that referenced this pull request Jul 23, 2025
Add a [deopts] field to allow users to select depopts.

The depopts are selected globally for all packages that list them. This
is inline with how opam does things.

Fixes ocaml#11643



<!-- ps-id: 430e82d6-3fe8-4a81-9692-c0d680a58591 -->

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Sudha247 pushed a commit to Sudha247/dune that referenced this pull request Jul 23, 2025
Has been added in commit 81fe878, from PR ocaml#11773.

Signed-off-by: Marek Kubica <marek@tarides.com>
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.

Enable selecting depopts in dune pkg.

5 participants