dune icon indicating copy to clipboard operation
dune copied to clipboard

Use new hidden deps Merlin support for handling implicit-transitive-deps false

Open voodoos opened this issue 1 year ago • 2 comments

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.

voodoos avatar May 15 '24 15:05 voodoos

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.

nojb avatar May 17 '24 13:05 nojb

@voodoos #10644 has been merged; so it should now be possible to finalize this PR by using Compilation_context.requires_hidden. Thanks for waiting!

nojb avatar Jun 28 '24 08:06 nojb

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 avatar Oct 04 '24 14:10 Leonidas-from-XIV

@Leonidas-from-XIV rebased and signed-off

voodoos avatar Oct 07 '24 12:10 voodoos

@nojb I think you've assigned yourself to this PR. Do you mind taking a final look, and if everything is OK, merging?

rgrinberg avatar Oct 10 '24 19:10 rgrinberg

Thank you @nojb !

voodoos avatar Oct 11 '24 08:10 voodoos