Skip to content

test: document single-module library recompilation behavior (#4572) - #14103

Merged
rgrinberg merged 1 commit into
ocaml:mainfrom
robinbb:robinbb-issue-4572-singleton
Apr 10, 2026
Merged

rgrinberg merged 1 commit into
ocaml:mainfrom
robinbb:robinbb-issue-4572-singleton

Conversation

@robinbb

@robinbb robinbb commented Apr 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Add baseline test documenting that single-module library consumers are
unnecessarily recompiled when an unused dependency module changes. This
happens because dune skips ocamldep for singleton stanzas, so per-module
filtering cannot determine which libraries the module actually references.

The code change to remove the singleton skip is deferred to the per-module
filtering PR (#14021) where it is actually needed and can be tested
end-to-end.

Ref: #4572

Test plan

  • dune runtest test/blackbox-tests/test-cases/per-module-lib-deps/single-module-lib.t passes

@robinbb
robinbb force-pushed the robinbb-issue-4572-singleton branch from 6d8e65b to 76ace5e Compare April 9, 2026 14:00
@robinbb robinbb changed the title fix: run ocamldep for single-module stanzas (#4572) refactor: remove singleton ocamldep skip from internal dep_rules functions (#4572) Apr 9, 2026
@robinbb
robinbb force-pushed the robinbb-issue-4572-singleton branch from 76ace5e to c66f5d2 Compare April 9, 2026 14:11
@robinbb robinbb changed the title refactor: remove singleton ocamldep skip from internal dep_rules functions (#4572) test: document single-module library recompilation behavior (#4572) Apr 9, 2026
@robinbb

robinbb commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator Author

@rgrinberg Thanks for your comments on #14079. In the end, I think that only this test can merge in isolation, so I closed that PR and made this one.

Add baseline test showing that single-module library consumers are
recompiled when an unused module in a dependency changes. This happens
because dune skips ocamldep for singleton stanzas, preventing future
per-module filtering from determining which libraries the module
actually references.

Signed-off-by: Robin Bate Boerop <[email protected]>
@robinbb
robinbb force-pushed the robinbb-issue-4572-singleton branch from 6b261dc to 4b8e36a Compare April 10, 2026 15:37
@robinbb

robinbb commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator Author

@rgrinberg I've made your suggested improvements. Back to you to decide if the changes are sufficient.

@rgrinberg
rgrinberg merged commit bdef216 into ocaml:main Apr 10, 2026
28 checks passed
@robinbb
robinbb deleted the robinbb-issue-4572-singleton branch April 10, 2026 19:46
@Alizter Alizter added this to the 3.23.0 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.

3 participants