Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transitive virtual library implementations #1

Open
tek opened this issue Sep 3, 2021 · 2 comments
Open

Support transitive virtual library implementations #1

tek opened this issue Sep 3, 2021 · 2 comments

Comments

@tek
Copy link
Member

tek commented Sep 3, 2021

Given an executable E that depends on library A which depends on a virtual library implementation B, the modules in E appear to require B in their dependencies, but this doesn't happen with the current resolver.

@mobileink
Copy link
Collaborator

By "virtual library" you mean what dune describes in https://dune.readthedocs.io/en/stable/variants.html ?

And by "current resolver" you mean codept?

Note that this distinction between virtual and non-virtual ("real"?) libraries is not necessary (IMHO). I have not yet worked out the details of how to translate dune's virtual_modules, implements, default_implementation etc. to OBazl, but I know I do not want to introduce the term "virtual". I think it just adds an unnecessary layer of (conceptual) complexity. We already have signatures, structures, and select that should be enough. I think.

@tek
Copy link
Member Author

tek commented Sep 3, 2021

By "virtual library" you mean what dune describes in https://dune.readthedocs.io/en/stable/variants.html ?

yes

And by "current resolver" you mean codept?

no, I mean the dependency resolver of Gazelle, which finds the package a locally depended upon library is defined in

Note that this distinction between virtual and non-virtual ("real"?) libraries is not necessary (IMHO). I have not yet worked out the details of how to translate dune's virtual_modules, implements, default_implementation etc. to OBazl, but I know I do not want to introduce the term "virtual".

I introduced this concept here to mirror the behaviour of dune's virtual modules. The dificulties with this pattern include a hash mismatch for the interface file (which is generated for the implementation when no connection is made to the virtual interface, and can be mitigated with the -intf-suffix .ml option), and that a namespaced library will create the module as Impl__Mod instead of Virt__Mod, where the latter is what consumers of the virtual library depend upon.

If you manage to implement this feature without introducing a new concept, it would surely be preferable.

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

No branches or pull requests

2 participants