Conversation
vmthreads are deprecated in 4.08 so eventually this extra complexity will go away. In the meantime, I'm not sure what the best option is :/ We could add a special case for threads though it's not very satisfying. Otherwise we could try to detect by analysing the META file that
Seems good to me.
What about making |
When
Will do that |
I'm not sure yet, but possibly. Note that since we always set the |
What about changing the internal META for threads to alias In any case, since it's an experimental feature we can certainly just stick to documenting this limitation for now. |
|
the internal META is only used when the one installed by findlib is not found, so it's pretty much never used when using opam. Sticking to documenting the limitation seems like the simplest solution to me as well, and it will make users aware of the issue, which might exist for other libraries. |
60b167e to
43d79f4
Compare
|
Apart from the documentation, this is ready for review. |
43d79f4 to
851868e
Compare
|
BTW, if we can indeed simplify |
eeac7e5 to
c09dd2e
Compare
|
Should we make |
|
Good point. Will make it lazy |
|
Btw, should we rename this into something more descriptive? For example, |
|
I suppose, yeah. It's true that from the point of view of a user who doesn't know much about the low-level details of OCaml compilation, "include" might seem a bit abstract. Maybe |
|
@diml I renamed it. I wonder if it would be good to have this toggle instead: Perhaps if we change the default in dune 2.0, it would be nice for users to go back to the old setting. |
|
Good point, I agree with making it toggle. |
emillon
left a comment
There was a problem hiding this comment.
Looks good! I'm surprised that this "so" simple.
What do you think about adding a test case where the code uses a transitive dep but this mode is not active?
|
Test case added and now it's a boolean valued option |
6812e47 to
257745a
Compare
|
Another case where this option is useful: Set it in the workspace file and then try to build a duniverse. This will let you discover places where dependencies are imprecise. |
257745a to
b1e92e9
Compare
Libraries should include references to their transitive dependencies Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Now, transitive dependencies must be listed to be compiled against Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
b1e92e9 to
a6217ab
Compare
This is an attempt to revive #430 in the new code base.
TODO:
Questions/Notes:
I had to change
threadstothreads.posixfor this to compile dune. I think that's fine for dune, since we might rely on posix semantics. But I don't think that users are going to know to do this. How do we handle threads in this case?My idea is to have the compilation context check if the feature is enabled (in the dune project file) before returning
requires_compile. If the feature is disabled, it will simply userequires_linkand generateIncludes.twith this value.It's a bit annoying to calculate the
requires_compileif it isn't going to be used every time. Any ideas on how restructure the code to avoid this? I was thinking perhaps we could make a constructor ofCompilation_context.tthat consumes aLib.Compile.t, and haverequires_compilebe lazy inLib.Compile.t.