Use new hidden deps Merlin support for handling implicit-transitive-deps false
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 and SH 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.
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 Compilation_context.requires will be annotated with a flag indicating whether each dependency is direct or transitive (= hidden), and you won't need to do this computation "just" for Merlin. Moreover, I think it would be great if we could merge this PR at the same time that Dune itself is able to support -H.
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.
@voodoos #10644 has been merged; so it should now be possible to finalize this PR by using Compilation_context.requires_hidden. Thanks for waiting!
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.
@Leonidas-from-XIV rebased and signed-off
@nojb I think you've assigned yourself to this PR. Do you mind taking a final look, and if everything is OK, merging?
Thank you @nojb !