-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Add support for user-defined builtins with Dune plugins #214
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
Conversation
In retrospect, I am not 100% sure this is a good idea. I did this initially to have an example of usage of the plugin mechanism, but ended up writing two example plugins ( |
This was causing build failures on the CI so no longer part of the PR. Instead there is support for builtin extensions when loading them at the CLI level. |
|
I did some late cleanup but this should be ready to review @Gbury |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good.
Note: you can rebase on current master to fix the CI bugs.
|
Made the requested changes + some others following (old) offline discussions:
|
|
@Gbury ping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry for dropping the ball on this. What's the status of this one (just waiting for review or do we want to change the architecture of the PR) ?
|
It's been a while, I don't remember the conclusion of our last discussion. I'll go over the code again while applying review changes (probably sometime next week); if you are happy with the current architecture I'd say we keep it the way it is but if there are architectural issues we can fix them. |
9f0c8e0 to
28bc1e2
Compare
|
Rebased, looking at the review now. |
|
Updated code for loading builtin extensions. I'm a bit unhappy about the fact that other modules loaded by the binary could create new extensions that would not get picked up (depending on module load order), but I think that's mostly a theoretical concern --- builtin extensions should be defined in the shared extension module, and plugin extensions should be defined in plugins (which are loaded dynamically and won't be seen when listing extensions at toplevel). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot ! I have a few comments on how warnings and errors are reported around plugin loading, and after that it'll be good to merge.
|
Dropped the lazy and moved to use Dolmen's warning and errors. |
|
There's a CI failure: very likely, we need an additional lower bound on |
|
I have moved the |
|
Ah, this is actually a small issue — we need to decide whether we want plugins to be 100% a dolmen binary thing (and put them in the I think both choices make sense — using the |
|
(Ignore the CI failures, I have botched things with an intermediate state between the two solutions — I should be able to make either of them work) |
|
I have set the code back so that the plugins are registered with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last round of questions !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, this is good to merge ! If you want to write the CHANGES.md entry you can, else I'll do it right after merging.
This patch adds support for model extensions in `Dolmen_loop` using a similar mechanism to typing extensions. Model extensions and typing extensions are now loaded by the binary through Dune's plugin mechanism, and the existing `bvconv` extension is moved to use the plugin mechanism. Fixes Gbury#203
- Move code dealing with extensions out of the Options module and into a new Extensions module - Clean up examples (notably avoid an almost-empty plugin in abs_real_split by defining the builtin in the typing plugin; it does not make sense to use the model plugin without the typing plugin) - Load dune plugins lazily - Use a hash table to find binary extensions (but not typing extensions/model extensions) - Allow override of builtin extensions by dune plugins
Plugins are now necessarily monolithic: the programmatic interface still allows defining typing and model extensions separately, but the Dolmen binary does not handle split plugins anymore. This simplifies parsing and loading logic.
Co-authored-by: Guillaume Bury <[email protected]>
Co-authored-by: Guillaume Bury <[email protected]>
This reverts commit 0c98a4c.
This reverts commit c787384.
14178d1 to
ba42429
Compare
|
Done! |
This patch adds support for model extensions in
Dolmen_loopusing a similar mechanism to typing extensions.Model extensions and typing extensions are now loaded by the binary through Dune's plugin mechanism, and the existing
bvconvextension is moved to use the plugin mechanism.Fixes #203