dune icon indicating copy to clipboard operation
dune copied to clipboard

pkg: Display error message when no dependencies exist in `dune-project`

Open Leonidas-from-XIV opened this issue 8 months ago • 2 comments

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?

Leonidas-from-XIV avatar Mar 26 '25 15:03 Leonidas-from-XIV

Can you add a test of the new behaviour.

gridbugs avatar Mar 27 '25 03:03 gridbugs

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 avatar Apr 04 '25 13:04 Leonidas-from-XIV

@Leonidas-from-XIV Are you planning to rebase this soon?

Alizter avatar Oct 03 '25 12:10 Alizter

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.

Leonidas-from-XIV avatar Oct 03 '25 13:10 Leonidas-from-XIV