-
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
Use new hidden deps Merlin support for handling implicit-transitive-deps false #10535
Conversation
Hello @voodoos, thanks for this PR. Note that #9333 is being worked on at the moment (cc @MA0010). Once that is done, you will be able to simplify the patch because the lists of requires given by Accordingly, I suggest to suspend this PR until #9333 is done; does that sound OK? I hope that there will be a PR for #9333 in the next week or so. |
e2531ee
to
bcccf15
Compare
Hi @voodoos could you rebase the PR? We were talking about this in the last dune-dev meeting and it would be nice to have it as part of the 3.17 release. |
bcccf15
to
257a373
Compare
a5b1ea6
to
e26d0ce
Compare
@Leonidas-from-XIV rebased and signed-off |
7465100
to
b3cc73e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a changelog entry? This is one of the highlights of the release, would be good for people to be aware of it :)
3531597
to
b4641d9
Compare
Use new BH / SH directives Make specific tests for OCaml 5.2 Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
b4641d9
to
775915d
Compare
-> required by _build/default/proj2/.merlin-conf/lib-bar | ||
-> required by _build/default/proj2/bar.cma | ||
-> required by %{cma:proj2/bar} at command line:1 | ||
[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting that this triggers the error now, this could be a regression for the release but it seems like the error is what should've happened here anyway.
@@ -96,8 +96,7 @@ that wasn't found: | |||
1 | (executable (name prog) (libraries a)) | |||
^ | |||
Error: Library "a" not found. | |||
-> required by _build/default/c/.prog.eobjs/byte/dune__exe__Prog.cmi | |||
-> required by _build/default/c/.prog.eobjs/native/dune__exe__Prog.cmx | |||
-> required by _build/default/c/.merlin-conf/exe-prog |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main concern is that this changes so many tests, but given the dependency that is getting reported is an internal one and stays an internal one I believe this is not an issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the PR changes some evaluation order that makes Dune errors after following a different branch. Not sure what causes this however...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rgrinberg Can you please weight in whether this is an issue? It doesn't seem to be wrong, but maybe the order is important in some way I am not aware of?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found the difference: before we only "peeked" (with Resolve.peek
) at the dependencies and now we "read" them.
I will revert that change as is seems wrong to introduce dependencies here.
Co-authored-by: Marek Kubica <marek@xivilization.net> Signed-off-by: Ulysse <5031221+voodoos@users.noreply.github.com>
Signed-off-by: Ulysse Gérard <thevoodoos@gmail.com>
@nojb I think you've assigned yourself to this PR. Do you mind taking a final look, and if everything is OK, merging? |
doc/changes/10535.md
Outdated
@@ -0,0 +1,2 @@ | |||
- Use Merlin new configuration directives `BH` and `SH` for hidden dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention that hidden dependencies correspond to the -h
flag instead of internal merlin directives which most people are unaware of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it is always better to write Changes entries from the point of view of the user, not the developer. In this case, something like
- Make Merlin/OCaml-LSP aware of "hidden" dependencies used by
`(implicit_transitive_deps false)` via the `-H` compiler flag.
would be more useful for the occasional reader.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the liberty of tweaking the Changes entry in this manner. Planning to merge once CI passes. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
doc/changes/10535.md
Outdated
@@ -0,0 +1,2 @@ | |||
- Use Merlin new configuration directives `BH` and `SH` for hidden dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, it is always better to write Changes entries from the point of view of the user, not the developer. In this case, something like
- Make Merlin/OCaml-LSP aware of "hidden" dependencies used by
`(implicit_transitive_deps false)` via the `-H` compiler flag.
would be more useful for the occasional reader.
Thank you @nojb ! |
With release
5.2
the compiler introduces a new flag-H
to introduce dependencies that are required for linking but should be hidden from the currently built module. Merlin for 5.2 follows with two new configuration directives:BH
andSH
that allows to provide hidden build and source paths.This PR effectively takes advantage of these new directives to correctly communicate hidden dependencies to Merlin.
All versions of Merlin since 4.6 will accept that flag, but only the preview versions for 5.2 can actually take advantage of this additional information.