num icon indicating copy to clipboard operation
num copied to clipboard

Dune files confuse the OPAM linter

Open xavierleroy opened this issue 1 year ago • 3 comments

It says: "The package has a dune-project file but no explicit dependency on dune was found.". This blocks the opam-repository CI.

AFAIK, the OPAM package builds with Makefiles, and therefore doesn't need to depend on dune.

What is better:

  • add a spurious dependency on dune to please the linter
  • remove the dune files from the repo, or move them somewhere the linter doesn't see them
  • add an exception for the linter (how?)

xavierleroy avatar Jan 17 '25 08:01 xavierleroy

I was curious so I had a look: opam lint has a --warnings=... option that lets you disable any specific alarm, but the error you see comes from opam-dune-lint which is a different linter, and has no configuration support. Fun fact, the implementation of this check hard-codes an exception for dune itself:

https://github.com/ocurrent/opam-dune-lint/blob/04aed0bd0e3e766f8e45c4af55a2051afd0b3b36/dune_constraints.ml#L51-L56

Have you maybe tried indicating dune as an optional dependency? (The downside is that num will be rebuilt when dune version changes, which is somewhat frequent. But all the rest gets rebuilt anyway and is much longer to build.)

gasche avatar Jan 17 '25 09:01 gasche

Have you maybe tried indicating dune as an optional dependency?

Nice idea! Let's try...

xavierleroy avatar Jan 17 '25 09:01 xavierleroy

No, an optional dependency doesn't silence the warning from opam-dune-lint.

xavierleroy avatar Jan 17 '25 13:01 xavierleroy