dune
dune copied to clipboard
pkg: Display error message when no dependencies exist in `dune-project`
As a follow-up/replacement of #11555 this PR displays an warning if the package to be locked is declared in dune-project but has no dependencies.
I could imagine an additional step of reading the OPAM file and actually erroring out if it has dependencies declared there. That sounds like something we don't want to support. WDYT?
Can you add a test of the new behaviour.
There is something really wrong that it displays the warning 4 times (which at least points to the fact that we're doing 4x as much work as we should), I'm investigating this.
@Leonidas-from-XIV Are you planning to rebase this soon?
Fixing the error message being displayed 4x is a bigger endeavor, as the issue is that the build files get loaded multiple times as part of the build. I tried to refactor the loading but it was a massive change. So unless I stick a ref in here (let displayed = ref false) it is too much effort to solve it properly.