The embed_in_plugin_libraries
stanza fails with libraries requiring link-time code
#6086
Labels
embed_in_plugin_libraries
stanza fails with libraries requiring link-time code
#6086
Expected Behavior
Adding a module that requires link-time generated code to the
embed_in_plugin_libraries
shall not fail and shall include the generated code into the resulting plugin.Actual Behavior
Reproduction
Note: you can put
dune-site
or a library that depends ondune-site
into thelibraries
list.Problem
The problem is here:
We generate link-time code proactively, even if it is a plugin, so once we get to the plugin-specific code generation we already have the code generated and regenerate it again, which results in this obscure error message. The hot-patch is provided below. If you're interested in the fix, I can make a PR.
Patch
I am not PRing it, because it is a hot-fix, just to have a PoC for a self-contained *.cma library that could be loaded into a regular OCaml top-level for #6081. It worked as expected (though the PoC showed that the idea is flawed). Note, the patch will fail if we have several linkages, e.g.,
(exe plugin)
. And I don't know how to handle this case, since we indeed need to generate the some link-time for both targets.cc @nojb as #3141 author
The text was updated successfully, but these errors were encountered: