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

opam lint and filters #1801

Open
Drup opened this issue Oct 17, 2014 · 8 comments
Open

opam lint and filters #1801

Drup opened this issue Oct 17, 2014 · 8 comments

Comments

@Drup
Copy link
Contributor

Drup commented Oct 17, 2014

This piece of opam file is passed by opam lint

messages: [
  "To build and install the graphical front-end glilis, you should install cairo2 lablgtk and cmdliner"
    {!cairo2 | !lablgtk | !cmdliner}
]

but gives the following error on install:

[ERROR] cairo2 is not a valid variable.
[WARNING] Invalid variable cairo2 in filter
[ERROR] 'cairo2' has type string, but a env element of type bool was expected.
Fatal error:
OpamFilter.Filter_type_error
@Drup
Copy link
Contributor Author

Drup commented Oct 17, 2014

Actually, and as we can see in #1802, opam lint could do much more to check filters (and it would be a good thing for people like me).

@AltGr AltGr added this to the 1.3 milestone Jan 29, 2015
@AltGr
Copy link
Member

AltGr commented Mar 26, 2015

Not really lint related but 1.2.1 has a clear definition of the semantics of filters, the conversions that may take place, and how it behaves with undefined values. It's documented here (see also the Variables section)

@Drup
Copy link
Contributor Author

Drup commented May 9, 2015

Kinda bumped on this one again: I tried to write { ocamlgraph >= "1.8.6" } as a filter. Not only opam lint accepted it but opam too, without error. The correct thing is of course to use ocamlgraph:version ...

@AltGr
Copy link
Member

AltGr commented May 11, 2015

The issue is that we don't have a comprehensive list of variables, esp. not at the lint level ; variable resolution is defined at the state level, and, for example, new global variables can be added dynamically in ~/.opam/4.02.1/config/global-config.config (Actually that file currently only contains information that we can already infer, and we could do without it; but that's a different matter)

@Drup
Copy link
Contributor Author

Drup commented May 11, 2015

I understand the need to be extensible and all that, but is anybody actually using this feature of opam ? Can't opam lint warn on variables that have a good chance of being wrong ? There is a set of well known variables and then the packages, but the raw name of the package is rarely the variable you want to use (it's often package:something) and anyway, you can use the current universe + name of the package being defined as a quite good approximation.

@ghost
Copy link

ghost commented Mar 8, 2016

I got hit twice this week by such a mistake. Just bumping this thread, despite not having a solution to the problem.

@AltGr
Copy link
Member

AltGr commented Mar 11, 2016

Related: ocaml-opam/Camelus#8
Time to start writing a module enforcing repository-specific rules...

@AltGr AltGr modified the milestones: Next, 2.0 Aug 30, 2016
@rjbou
Copy link
Collaborator

rjbou commented Jun 13, 2019

Is this issue still current? I don't think with new opam versions...

@rjbou rjbou removed this from the Next milestone May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants