Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dune files confuse the OPAM linter #44

Open
xavierleroy opened this issue Jan 17, 2025 · 3 comments
Open

Dune files confuse the OPAM linter #44

xavierleroy opened this issue Jan 17, 2025 · 3 comments

Comments

@xavierleroy
Copy link
Contributor

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?)
@gasche
Copy link
Member

gasche commented Jan 17, 2025

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.)

xavierleroy added a commit to xavierleroy/opam-repository that referenced this issue Jan 17, 2025
@xavierleroy
Copy link
Contributor Author

Have you maybe tried indicating dune as an optional dependency?

Nice idea! Let's try...

@xavierleroy
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants