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

cabal-version check doesn't happen early enough #4448

Closed
ezyang opened this Issue Apr 16, 2017 · 4 comments

Comments

Projects
None yet
4 participants
@ezyang
Contributor

ezyang commented Apr 16, 2017

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.

@hvr

This comment has been minimized.

Show comment
Hide comment
@hvr

hvr Dec 9, 2017

Member

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

Member

hvr commented Dec 9, 2017

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

@phadej

This comment has been minimized.

Show comment
Hide comment
@phadej

phadej Dec 9, 2017

Collaborator

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

Collaborator

phadej commented Dec 9, 2017

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

@phadej phadej self-assigned this Dec 9, 2017

phadej added a commit to phadej/cabal that referenced this issue Dec 13, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25)

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.

phadej added a commit to phadej/cabal that referenced this issue Dec 14, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25). For example, a file with

    cabal-version: >=1.10
    library:
      mixins: foo-indef requires (Foo42 as FooImpl)

will be accepted, yet warned, and parsed `mixins` in `BuildInfo` will be
an empty list.

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.

phadej added a commit to phadej/cabal that referenced this issue Dec 19, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25). For example, a file with

    cabal-version: >=1.10
    library:
      mixins: foo-indef requires (Foo42 as FooImpl)

will be accepted, yet warned, and parsed `mixins` in `BuildInfo` will be
an empty list.

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.

phadej added a commit to phadej/cabal that referenced this issue Dec 20, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25). For example, a file with

    cabal-version: >=1.10
    library:
      mixins: foo-indef requires (Foo42 as FooImpl)

will be accepted, yet warned, and parsed `mixins` in `BuildInfo` will be
an empty list.

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.

phadej added a commit to phadej/cabal that referenced this issue Dec 21, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25). For example, a file with

    cabal-version: >=1.10
    library:
      mixins: foo-indef requires (Foo42 as FooImpl)

will be accepted, yet warned, and parsed `mixins` in `BuildInfo` will be
an empty list.

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.

phadej added a commit to phadej/cabal that referenced this issue Dec 21, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25). For example, a file with

    cabal-version: >=1.10
    library:
      mixins: foo-indef requires (Foo42 as FooImpl)

will be accepted, yet warned, and parsed `mixins` in `BuildInfo` will be
an empty list.

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.

phadej added a commit to phadej/cabal that referenced this issue Dec 24, 2017

Implement availableSince.
Tag Backpack fields (mixins, signatures) to `availableSince [2,0]`.
This "fixes" haskell#4448, as fields
are recognised, warned, but parsed as empty if cabal-version < 2.0
(actual cut-off is ! (>= 1.25). For example, a file with

    cabal-version: >=1.10
    library:
      mixins: foo-indef requires (Foo42 as FooImpl)

will be accepted, yet warned, and parsed `mixins` in `BuildInfo` will be
an empty list.

Also availableSince is removed from `build-tool-depends`,
as we **want** to parse (and not warn) it in old Cabal files.
It can be thought as added retrospectively to old specs, but old `Cabal`
s don't know how to use it.
@phadej

This comment has been minimized.

Show comment
Hide comment
@phadej

phadej Dec 25, 2017

Collaborator

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

Collaborator

phadej commented Dec 25, 2017

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

@ezyang

This comment has been minimized.

Show comment
Hide comment
@ezyang

ezyang Dec 25, 2017

Contributor

Thank you @phadej! You rock.

Contributor

ezyang commented Dec 25, 2017

Thank you @phadej! You rock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment