Skip to content

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

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

test: document single-module library recompilation behavior (#4572)#14103
rgrinberg merged 1 commit intoocaml:mainfrom
robinbb:robinbb-issue-4572-singleton

Conversation

@robinbb
Copy link
Copy Markdown
Collaborator

@robinbb robinbb commented Apr 9, 2026

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
Copy link
Copy Markdown
Collaborator Author

robinbb commented Apr 9, 2026

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

Comment thread test/blackbox-tests/test-cases/per-module-lib-deps/single-module-lib.t Outdated
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 <me@robinbb.com>
@robinbb robinbb force-pushed the robinbb-issue-4572-singleton branch from 6b261dc to 4b8e36a Compare April 10, 2026 15:37
@robinbb
Copy link
Copy Markdown
Collaborator Author

robinbb commented Apr 10, 2026

@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
30 checks passed
@robinbb robinbb deleted the robinbb-issue-4572-singleton branch April 10, 2026 19:46
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.

2 participants