cabal-version check doesn't happen early enough

Created on 16 Apr 2017  路  4Comments  路  Source: haskell/cabal

With https://github.com/danidiaz/wl-pprint-indef/tree/problemo when built you get the error:

Error:
    Mix-in refers to non-existent package 'wl-pprint-indef'
    (did you forget to add the package to build-depends?)
    In the stanza 'executable wl-pprint-string-example'
    In the inplace package 'wl-pprint-indef-1.2'

But everything exists. In fact, the problem is that cabal-version is not set high enough to get the correct semantics in this case.

I'm not sure if the correct fix is to move cabal-version sanity checking earlier, or to add a little extra logic to the cabal-version dependent bits of mixin linking to give a warning when something has gone wrong, but something is worth doing here.

Backpack

Most helpful comment

Thank you @phadej! You rock.

All 4 comments

Is this something that can be handled in cabal check? or can this be even caught by the parser? i.e. can this be detected statically by looking at the .cabal file?

/cc @phadej

New parser framework has since annotations. They just don't do anything right now, I'll check this soln

Fixed in #4971 / #4953. mixins / signature fields are warned about if not cabal-version: 2.0 or later

Thank you @phadej! You rock.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TomMD picture TomMD  路  3Comments

phadej picture phadej  路  4Comments

vmchale picture vmchale  路  3Comments

tsoernes picture tsoernes  路  3Comments

chrissound picture chrissound  路  4Comments