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

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

Closed
chshersh opened this issue Oct 2, 2019 · 4 comments
Closed
Assignees
Milestone

Comments

@chshersh
Copy link
Member

chshersh commented Oct 2, 2019

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
@fgaz
Copy link
Member

fgaz commented Oct 3, 2019

Might be an instance of #5846.

@chshersh
Copy link
Member Author

chshersh commented Oct 3, 2019

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

@fgaz
Copy link
Member

fgaz commented Oct 3, 2019

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

@fgaz fgaz mentioned this issue Apr 27, 2020
31 tasks
@phadej phadej added this to the 3.4.0.0 milestone May 14, 2020
@phadej phadej self-assigned this May 14, 2020
@phadej
Copy link
Collaborator

phadej commented May 14, 2020

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

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

There are no sublibs.

phadej added a commit to phadej/cabal that referenced this issue May 14, 2020
Also add a test for current behaviour
of haskell#6083

And variant with mixin, for haskell#6281

The tests are disable for GHC older than 8.8
Should they work?
phadej added a commit to phadej/cabal that referenced this issue May 15, 2020
Also add a test for current behaviour
of haskell#6083

And variant with mixin, for haskell#6281

The tests are disable for GHC older than 8.8
Should they work?
phadej added a commit to phadej/cabal that referenced this issue May 15, 2020
Also add a test for current behaviour
of haskell#6083

And variant with mixin, for haskell#6281

The tests are disable for GHC older than 8.8
Should they work?
phadej added a commit to phadej/cabal that referenced this issue Jun 17, 2020
phadej added a commit to phadej/cabal that referenced this issue Jun 17, 2020
phadej added a commit to phadej/cabal that referenced this issue Jun 17, 2020
phadej added a commit to phadej/cabal that referenced this issue Jun 17, 2020
phadej added a commit to phadej/cabal that referenced this issue Jun 17, 2020
@phadej phadej closed this as completed in 395fd30 Jun 18, 2020
phadej added a commit that referenced this issue Jun 18, 2020
Resolve #6281: Add foo:bar syntax to mixins
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

3 participants