Skip to content

Parse error when trying to use multiple public libraries within mixins #6281

Closed

Description

@chshersh

Describe the bug

I have the following lines in my .cabal file:

  build-depends:       containers-backpack:{ int-strict, ordered-strict, unordered-strict, contrib }

  mixins:              containers-backpack:contrib (Map.Contrib.Group as Map.Contrib.Group.Int)
                                          requires (Map as Map.Int)

Here containes-backpack is a package with the public library contrib inside it. However, when trying to build this package with cabal-install I see the following error:

Errors encountered when parsing cabal file ./containers-backpack.cabal:

containers-backpack.cabal:142:43: error:
unexpected ':'
expecting "-", white space, "(", "hiding", "requires", comma or end of input

  140 |   build-depends:       containers-backpack:{ int-strict, ordered-strict, unordered-strict, contrib }
  141 | 
  142 |   mixins:              containers-backpack:contrib (Map.Contrib.Group as Map.Contrib.Group.Int)
      |                                           ^

To Reproduce

You can find full code here:

Steps to reproduce the behavior:

  1. Clone the repo.
  2. Checkout to branch from linked PR.
  3. Do cabal v2-build

Expected behavior

No parse error.

System informataion

  • Ubuntu-18.04
  • cabal-3.0.0.0
  • ghc-8.6.5 or ghc-8.8.1

Activity

  1. fgaz commented on Oct 3, 2019

    @fgaz
    Member

    Might be an instance of #5846.

  2. chshersh commented on Oct 3, 2019

    @chshersh
    MemberAuthor

    @fgaz Thanks for pointing to this issue! #5846 is another problem I have. For some reason the following doesn't parse:

    build-depends: containers-backpack:sig
                 , QuickCheck
    

    But when I write dependencies in a single line, it parses:

    build-depends: containers-backpack:sig, QuickCheck
    

    Adding -any also parses

    Which is for now only a minor UI inconvenience.

  3. fgaz commented on Oct 3, 2019

    @fgaz
    Member

    Weird… I wonder what's wrong with the parsing code. I wasn't able to find the issue last time I tried to debug this. If you want to take a look at it yourself it's in Cabal/Distribution/Types/Dependency.hs

  4. added this to the 3.4.0.0 milestone on May 14, 2020
  5. self-assigned this
    on May 14, 2020
  6. phadej commented on May 14, 2020

    @phadej
    Collaborator

    @fgaz this is missing functionality. Mixin (not Dependency) is atm defined as

    data Mixin = Mixin { mixinPackageName :: PackageName
                       , mixinIncludeRenaming :: IncludeRenaming }
    

    There are no sublibs.

  7. added 3 commits that reference this issue on May 14, 2020
  8. added 6 commits that reference this issue on Jun 17, 2020
    1a5b2c5
    3435704
    4f8eed1
    7d969e5
    77f54d5
    395fd30
  9. added 2 commits that reference this issue on Jun 18, 2020
    a6915fe
    b256029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions