-
Notifications
You must be signed in to change notification settings - Fork 410
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
Multiple rules generated for "dll from shared foreign_archives" #4883
Comments
Agreed, this seems like a case that should be supported. Looking at the code, it shouldn't be too difficult: in Super_context.add_rule sctx ~loc ~dir:ctx.build_dir
(Action_builder.symlink ~src:(Path.build entry.src) ~dst) You could adapt the code to first construct a list of symlinks to declare and de-duplicate it. |
As a side note of further investigation, In my test for example, when Can someone confirm this? Does somebody already have reported such behavior? Because if it is exact, the shared part loses all its purpose. |
|
Isn't it desirable that |
That would make cmxs files less self-contained |
Ok but, in the toy example above, is it possible to link against |
You cannot indeed. You can do the following: introduce a third library |
Thank you for your answers I will do that but it would be nice if it was automatically handled by dune ( |
You can compress the
Given the problem you pointed out with not being able to link two libraries that would share a common foreign archive and the simple workaround we came up with, supporting sharing a foreign archive between several OCaml libraries doesn't seem worth the trouble, so I'm closing this ticket. |
The fact that we get an internal error is still problematic, but I'm going to open another issue that sums up the different difficult point of |
Actual Behavior
The shared library
dllutil.so
is part of two libraries that are public. The result is thatdune
generate two rules for installing it and thus fail with:Expected Behavior
It should be possible to use foreign library more than once per public library.
Reproduction
Here is a minimal example to reproduce the issue:
dune-project
dune
util.c
a.ml & b.ml
Specifications
dune
(output ofdune --version
): 2.8.2ocaml
(output ofocamlc --version
): 4.08.1The text was updated successfully, but these errors were encountered: