-
Notifications
You must be signed in to change notification settings - Fork 409
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
exposing the mt predicate to dune libraries #1724
Comments
until ocaml/dune#1724 is resolved Signed-off-by: Anil Madhavapeddy <[email protected]>
this lets an example build, but with an extra dependency since dune cannot track the `mt` predicates and hence doesnt know that the `date` example depends on ctypes-foreign-unthreaded see ocaml/dune#1724 for discussion
I've pushed a workaround using META templates to yallop/ocaml-ctypes@a5a9655. The problem I'm finding is when linking an executable there are now missing dependencies, since Dune has no idea about the extra dependencies introduced by the manually written This means that as a hack one of the choices is manually written in each executable at the moment; e.g.:
instead of
|
Currently dune support the |
This is the default as supported by dune, so it's a sensible hard-coded one until the conversation in ocaml/dune#1724 is resolved.
Thanks @bobot -- I've hardcoded the |
One observation from yallop/ocaml-ctypes@25ec72a (which shifts the use of ctypes-foreign.threaded/unthreaded to use virtual modules) is that the If we decide on a namespace for virtual modules that is consistent (e.g. |
@avsm that's the idea of library variants, i.e. the part that comes after virtual library: adding a mechanism to automatically select an implementation when none is specified. |
@diml indeed -- I just want to make sure that selecting a subpackage name in today's virtual libraries is sufficient for future compatibility with library variants. It would be quite a pain to rename releases that use virtual libraries with dune 1.7.0 otherwise |
So would having a I think variants is a good solution for this as well, but it's a bit weird how we want the use of (one of) the |
@emillon Since you're driving the ctypes port, is this still relevant? |
The whole threaded/unthreaded distinction got removed upstream in yallop/ocaml-ctypes#651, so I don't think it's relevant anymore. |
The ctypes port to dune (yallop/ocaml-ctypes#588) is almost working, except for the need to select which subpackage to link based on the
-mt
predicate in ocamlfind. #96 has some discussion of this, but the specific META file in ctypes is:Both the
unthreaded
andthreaded
variants have different c stubs, and cannot be linked simultaneously without a module clash. I'm not sure how to make this work without some support formt
in adune
file, as the right package is selected based on whether the executable uses thethreads
library or not.Suggestions for workarounds welcome to unblock the ctypes port...
The text was updated successfully, but these errors were encountered: