fix: deduplicate entry modules in root_module stanza#14135
Open
robinbb wants to merge 2 commits intoocaml:mainfrom
Open
fix: deduplicate entry modules in root_module stanza#14135robinbb wants to merge 2 commits intoocaml:mainfrom
robinbb wants to merge 2 commits intoocaml:mainfrom
Conversation
When findlib sub-packages share a directory with their parent package (e.g., logs.lwt installed alongside logs), dune guesses entry modules by scanning the directory. Both packages report the same modules, causing duplicate `module X = X` lines in root.ml-gen and a compilation error. Fix by deduplicating module names via Module_name.Set before generating the root module source. Signed-off-by: Robin Bate Boerop <me@robinbb.com>
70706ff to
2c55423
Compare
Signed-off-by: Robin Bate Boerop <me@robinbb.com>
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.
Summary
Fixes #6148.
When findlib sub-packages share a directory with their parent package (e.g.,
logs.lwtinstalled alongsidelogs), dune guesses entry modules by scanning the directory. Both packages report the same modules, causing duplicatemodule X = Xlines inroot.ml-genand a compilation error:The fix deduplicates module names via
Module_name.SetinRoot_module.entriesbefore they are written toroot.ml-gen.src/dune_rules/root_module.ml— deduplicate the concatenated entry module listtest/blackbox-tests/test-cases/root-module/root-module-duplicate.t— update test to expect successboot/libs.ml— re-sorted entries from bootstrap picking up the new Set-based orderingTest plan
root-module-duplicate.tnow passes (was documenting the bug)root-module/*.ttests still passdune build @checkpasses