Repository navigation
Fix Merlin hidden includes for libraries with private modules - #16629
Merged
Merged
Conversation
DirkEmmett
added a commit
to DirkEmmett/dune
that referenced
this pull request
Oct 17, 2026
Document the editor behavior restored by ocaml#16629. Signed-off-by: Dirk Emmett <[email protected]>
Alizter
self-requested a review
October 26, 2026 13:52
Collaborator
|
@DirkEmmett Could you submit the tests in a separate PR? |
DirkEmmett
force-pushed
the
fix/16531-merlin-hidden-includes
branch
from
October 29, 2026 18:04
fed4a88 to
5d45f95
Compare
Contributor
Author
|
@Alizter Split the tests into #16848. That PR records the current bug without changing production code. This fix builds on the test commit and updates the expectations. Fix-only comparison. The tests PR should land first. Both branches pass |
Alizter
added a commit
that referenced
this pull request
Oct 29, 2026
Split out from #16629 as requested in #16629 (comment). Extends the existing #16531 reproduction to hidden transitive dependencies. The test records the missing hidden CMI path, demonstrates that adding it with `-H` restores alias typing, and checks that direct private-module and hidden-dependency names remain inaccessible. No production code changes. Validation: `dune build @check @fmt @runtest` passed locally with OCaml 5.5.0 and ppxlib 0.39.0. A real Merlin smoke check confirmed that this tests-only branch preserves the reported alias error. Intended to land before the fix in #16629. Tests only; no changelog entry is needed. Please apply the `no changelog` label.
Reuse the local byte directories as hidden Merlin CMI paths on supported OCaml compilers. Preserve annotation paths and direct-name visibility, and require direct and hidden-transitive aliases to type using generated paths only. Fixes ocaml#16531. Signed-off-by: Dirk Emmett <[email protected]>
rgrinberg
force-pushed
the
fix/16531-merlin-hidden-includes
branch
from
November 6, 2026 16:40
f3b881a to
7deeb04
Compare
anmonteiro
self-requested a review
November 6, 2026 17:19
rgrinberg
reviewed
Nov 7, 2026
| and+ indexes, indexes_digest = Ocaml_index.context_indexes context ~for_ | ||
| and+ use_hidden_includes = | ||
| match for_ with | ||
| | Melange -> Action_builder.return false |
This was referenced Nov 7, 2026
anmonteiro
added a commit
that referenced
this pull request
Nov 10, 2026
…#16937) Demonstrate that private wrapper aliases compile without sandboxing but fail in a fresh copy sandbox because the private CMI is unavailable. Found while checking the Melange counterparts of #16629. 01a12d8e-c091-7010-b0cd-3fdc40400e80 --------- Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 10, 2026
…6931) Demonstrate that public aliases of private Melange modules fail to compile, including in a fresh copy sandbox. Related to #16629. 01a12d8e-c091-7010-b0cd-3fdc40400e80 --------- Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 10, 2026
…#16932) Demonstrate missing private CMIs through hidden transitive Melange dependencies, while checking that direct dependency names remain hidden. Related to #16629. 01a12d8e-c091-7010-b0cd-3fdc40400e80 --------- Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 10, 2026
Demonstrate the difference between OCaml and Melange when resolving a private module through its generated wrapper alias. Related to #16629. 01a12d8e-c091-7010-b0cd-3fdc40400e80 --------- Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 10, 2026
…16934) Demonstrate that aliases into installed private libraries work in OCaml but fail in Melange, while direct private references remain unavailable. Related to #16629. 01a12d8e-c091-7010-b0cd-3fdc40400e80 --------- Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 16, 2026
Demonstrate the missing hidden CMI directory in Merlin configurations for direct Melange dependencies with private modules. Related to #16629; regression for #16942. 01a12d8e-c091-7010-b0cd-3fdc40400e80 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 16, 2026
Demonstrate the missing private CMI directory in Merlin configurations for hidden transitive Melange dependencies. Related to #16629; regression for #16942. 01a12d8e-c091-7010-b0cd-3fdc40400e80 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
anmonteiro
added a commit
that referenced
this pull request
Nov 16, 2026
Include private Melange dependency interfaces as hidden Merlin paths, matching the OCaml behavior from #16629. Fixes the merged regression tests from #16935 and #16936. 01a12d8e-c091-7010-b0cd-3fdc40400e80 Signed-off-by: Antonio Nuno Monteiro <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #16848 (tests-only; merge first).
Public aliases backed by private modules can build successfully but fail in Merlin because Dune omits their hidden CMI directory. Add the missing
BHpaths for local direct and hidden transitive dependencies, preserving annotation paths and existing visibility.The test setup is submitted separately in #16848; this branch builds on that commit and changes the expectations to require successful alias typing. Until the tests PR lands, GitHub's main-based diff includes the shared test commit. Fix-only comparison.
Fixes #16531.
Validation:
dune build @check @fmt @runtestpassed locally on both branches with OCaml 5.5.0 and ppxlib 0.39.0. Actual Merlin 5.8.1 queries confirmed that the tests-only branch retains the alias error and this fix restores typing, completion, and navigation while direct private names remain inaccessible.