Skip to content

[3.23.1] backport #14434 - #14446

Merged
shonfeder merged 1 commit into
ocaml:3.23.1-rcfrom
Sudha247:backport-14434
May 8, 2026
Merged

shonfeder merged 1 commit into
ocaml:3.23.1-rcfrom
Sudha247:backport-14434

Conversation

@Sudha247

@Sudha247 Sudha247 commented May 7, 2026

Copy link
Copy Markdown
Member

Backport #14434 onto 3.23.1-rc

…caml#14434)

## Summary

Fixes ocaml#14428.

The 3.23 menhir auto-injection (ocaml#14168) was triggered by the
project-wide `(using menhir ...)` extension and added `menhir` as a
*new* dependency to every package's generated opam file, regardless of
whether the package's own `(depends ...)` field declared it. In
multi-package projects where only some packages used menhir, every
package gained a spurious build-time dependency.

The original ask in ocaml#10707 was narrower: when a generated opam file
*already* lists `menhir`, fill in the lower bound `{>= "20180523"}` that
dune's menhir rules require. This PR restricts the behaviour to that.

## Behaviour

- A package that does not declare `(depends menhir)` no longer has
`menhir` added by dune.
- A package that declares bare `(depends menhir)` has the lower bound
filled in.
- A package whose `(depends ...)` already specifies a constraint
(version bound, `{with-test}`, etc.) is preserved verbatim.
- Gated on `(using menhir ...)` being enabled — without the extension,
no upgrade.

The convenience of auto-adding `menhir` for users who use a `(menhir
...)` stanza but forget to declare `(depends menhir)` is deliberately
removed: the dependency-inference logic that supported it was the source
of ocaml#14428 and out of scope for ocaml#10707.

---------

Signed-off-by: Robin Bate Boerop <[email protected]>
(cherry picked from commit b471f2f)
Signed-off-by: Sudha Parimala <[email protected]>

@shonfeder shonfeder 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.

Thanks for the backport!

@shonfeder shonfeder mentioned this pull request May 8, 2026
20 tasks done
@Leonidas-from-XIV
Leonidas-from-XIV requested a review from robinbb May 8, 2026 08:08

@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.

LGTM; added @robinbb as original author of the fix for an additional pair of eyes.

@robinbb

robinbb commented May 8, 2026 •

Copy link
Copy Markdown
Collaborator

I don't have an opinion about whether it is safe to merge my original PR's code into a different context than the one for which it was designed. I would suspect not, but I don't know the gotchas.

@shonfeder has pointed out the the 'context' is empty - it's just the 3.23.1-rc base branch. And, I see that no changes have been made beyond Dune version changes 3.24 -> 3.23 in the test code. So, since 14434 was not substantially modified, this backport seems fine. I know of no reason why not to do it.

@robinbb
robinbb requested review from robinbb and removed request for robinbb May 8, 2026 19:00
@shonfeder
shonfeder merged commit fa4f702 into ocaml:3.23.1-rc May 8, 2026
29 checks passed
@Alizter Alizter added this to the 3.23.1 milestone Jul 8, 2026
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.

5 participants