-
Notifications
You must be signed in to change notification settings - Fork 429
Use custom build mode for mdx to work with cstubs. #8704
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
Change the hardcoded link flags to use custom mode.
This is one possible fix, with potentially slower link/build time. But this way, ctypes and mdx can be used together. Note that given PR #8631, this may be the wrong approach. But the final exe there also looks to be in done in custom mode. Best |
Yeah, I think this will make the mdx tests needlessly slow for everyone. Could you copy @nojb's approach instead? |
I set up a test case but noticed dune utop now fails after #8631 is merged. Pushed the testcase to this branch/pr Differences from existing test cases for utop.
The failure is:
Possible cases
|
cc @nojb |
Sorry for the naïve question, but where is |
@nojb test/blackbox-tests/test-cases/ctypes/libexample/example.{h,c}. |
Thanks. I am not familiar with the ctypes build rules so it is a bit hard to know what is going on off the top of my head, but at least in |
I investigated a little more: the problem seems to be the linking command for the library
I think this linking command is missing a |
For future reference, my understanding is as follows: Given a stanza of the form:
Dune will query Note that this is only a heuristic, and it is not guaranteed to work in general, but should work for the most common cases. |
Oops. Only read the latest comment not the first. I found the same. The command args create examplelib.cma uses Reference build command.
|
So this is one working reference example. There might be other ways to achieve the same. There is a difference when handling paths between dll_<>.so made by ocamlmklib which ocamlrun can lookup up, and paths for finding regular shared libraries that dllexample_stubs.so links to, in the working case below
Note from
For me it looks like that path is for finding dllstubs_example.so, when
|
Change the hardcoded link flags to use custom mode.