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

Incorrect cabal-version is generated #400

Closed
gromakovsky opened this issue Oct 2, 2020 · 2 comments
Closed

Incorrect cabal-version is generated #400

gromakovsky opened this issue Oct 2, 2020 · 2 comments

Comments

@gromakovsky
Copy link

My package.yaml is very small:

name:                indigo

library:
  source-dirs: src
  generated-other-modules:
    - Paths_indigo

  default-extensions: [ RebindableSyntax, OverloadedStrings]

It produces the following indigo.cabal file:

cabal-version: 2.0

-- This file has been generated from package.yaml by hpack version 0.34.2.
--
-- see: https://github.com/sol/hpack

name:           indigo
version:        0.0.0
build-type:     Simple

library
  exposed-modules:
      Indigo
  other-modules:
      Paths_indigo
  autogen-modules:
      Paths_indigo
  hs-source-dirs:
      src
  default-extensions: RebindableSyntax OverloadedStrings
  default-language: Haskell2010

When I run cabal build I get this:

cabal: The package uses RebindableSyntax with OverloadedStrings or
OverloadedLists in default-extensions, and also Paths_ autogen module. That
configuration is known to cause compile failures with Cabal < 2.2. To use
these default-extensions with Paths_ autogen module specify at least
'cabal-version: 2.2'.

So I suppose hpack should set cabal-version to 2.2 in this case. As a workaround I do

verbatim:
  cabal-version: 2.2

but it would be nicer if it was handled by hpack itself.

@sol sol mentioned this issue Nov 4, 2020
@sol
Copy link
Owner

sol commented Nov 9, 2020

@gromakovsky hey! Thanks for reporting this. #405 addresses this. Please let me know if you have any feedback.

@sol sol closed this as completed Nov 10, 2020
@gromakovsky
Copy link
Author

#405 is closed and doesn't have any commits as of now. AFAIU the fix is in bd27333. I'll test it when a new release reaches me or maybe will test manually with master. This issue is closed anyway, so there should be no rush. Thanks for the fix!

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

2 participants