feat(scope): add scope stanza for library visibility control#13337
feat(scope): add scope stanza for library visibility control#13337samoht wants to merge 1 commit intoocaml:mainfrom
Conversation
|
For context: this is a trimmed-down version of #13325 with a new name and probably targeting the right part of the codebase. I'm not super happy with the huge |
3be9eac to
95c03b2
Compare
|
Ok I think this starts looking a bit better. Now |
|
Yes, the code looks a lot more sensible now. A few points worth pointing out quickly:
|
|
Thanks for the very useful directions, this is really helpful! I think I have something that starts to look better now. I am still not super confident that the logic in package_scope.ml is the most efficient one, but at least I feel the rest of the code fits a bit better with what I understand Dune is doing (I might be wrong, though). Happy to get another quick review when you have time :-) |
Add a new `(scope ...)` stanza to control which packages are visible from specific directories. This is useful for vendoring multiple versions of the same package in different directories. ``` (scope (dir foo.1.0.0) (packages foo bar)) ``` Duplicate package names are now allowed across directories, with scope stanzas controlling visibility. Duplicate detection happens after scope filtering in `Scope.DB.packages`. Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
The scope stanza controls which libraries from a subdirectory are visible to the current project. This allows for selectively exposing libraries when vendoring external projects.
Syntax:
The (dir ...) field specifies an immediate subdirectory containing libraries. The (packages ...) field lists packages whose libraries should be visible. All public libraries from the specified packages become accessible.