8000 Autogenerated module PackageInfo_* requires cabal version 3.12 · Issue #618 · sol/hpack · GitHub
[go: up one dir, main page]

Skip to content

Autogenerated module PackageInfo_* requires cabal version 3.12 #618

Closed

Description

@karamellpelle

My stack project fails to build because it can't find the module PackageInfo_XXX. stack build gives a warning message:

Error: [Cabal-5559] 
[autogen-guard] To use the autogenerated module PackageInfo_* you need to specify `cabal-version: 3.12` or higher.

Looks like the problem is that hpack sets cabal-version: 2.0 even though the cabal-field autogen-modules is generated. Here's a simple hpack example:

---

spec-version: 0.36.0

name: myproj
version: 0.0
language: GHC2024 
dependencies:
    - base
    - relude

default-extensions:
    - NoImplicitPrelude
    - OverloadedStrings

executables:
    myproj:
        main:        Main.hs
        generated-other-modules: 
            - Paths_myproj
            - PackageInfo_myproj

Activity

  1. sol commented on Aug 19, 2025

    @sol
    Owner

    As a workaround add

    verbatim:
      cabal-version: 3.12

    to your package description.

  2. karamellpelle commented on Aug 19, 2025

    @karamellpelle
    Author

    As a workaround add

    verbatim:
    cabal-version: 3.12

    to your package description.

    This gives me

    Error: [S-242]
           Unable to parse Cabal file from package /home/karamellpelle/Source/hsam/hsam.cabal:
           * 0:0: Unsupported cabal-version 3.12. See https://github.com/haskell/cabal/issues/4899.
           
           The Cabal file uses the Cabal specification version 3.12, but we only support up to version 3.8. Recommended action: upgrade your build tool (e.g. stack upgrade)
    

    With newly upgraded stack gives stack --version:

    Version 3.3.1, Git revision 62d1bdf099c8c30634208f76cb4444f9896e4336 x86_64 hpack-0.37.0`
    

    I guess this should be an issue for commercialhaskell/stack now?

  3. mpilgrem commented on Aug 19, 2025

    @mpilgrem
    Collaborator

    @karamellpelle, I've noted the S-242 error. Let me look into it.

  4. mpilgrem commented on Aug 19, 2025

    @mpilgrem
    Collaborator

    @karamellpelle, Stack 3.3.1 was built against Cabal-3.10.3.0, which ships with GHC 9.8.4. That library can't parse versions of the Cabal file specification after 3.8.

    Stack 3.7.1 was built against Cabal-3.12.1.0, which ships with GHC 9.10.2. That library can't parse versions of the Cabal file specification after 3.12.

    Upgrading Stack to Stack 3.7.1 should solve your problem.

  5. mpilgrem commented on Aug 19, 2025

    @mpilgrem
    Collaborator

    As an aside, autogen-modules was introduced in Cabal file specification 2.0:

    Consequently, I do not immediately follow that Cabal error Cabal-5559. I wonder if it is a Cabal bug.

    EDIT: After some help in Cabal's Matrix room:

  6. karamellpelle commented on Aug 19, 2025

    @karamellpelle
    Author

    Thanks for your responses! Here's my current 1 stack version: Version 3.7.1, Git revision cfae313a06ea9f7278e0ac55a58341fa0440f1aa x86_64 hpack-0.38.1

    I may have done something wrong, but I'm pretty sure my stack template worked without errors before:

    stack new myproj karamellpelle/relude-app
    

    Now the stack build says To use the autogenerated module PackageInfo_* you need to specify cabal-version: 3.12 or higher. . And when I manually add verbatim: cabal-version: 3.12 to package.yaml, it says

    Error: [S-242]
           Unable to parse Cabal file from package /home/karamellpelle/Tmp/myproj/myproj.cabal:
           * 0:0: Unsupported cabal-version 3.12. See https://github.com/haskell/cabal/issues/4899.
           
           The Cabal file uses the Cabal specification version 3.12, but we only support up to version 3.8. Recommended action: upgrade your build tool (e.g. stack upgrade).
    
    

    Footnotes

    1. Not sure why it says version 3.3.1 above, maybe I pasted wrong, I did a stack upgrade. ↩

  7. mpilgrem commented on Aug 19, 2025

    @mpilgrem
    Collaborator

    @karamellpelle, sorry - my mistake! Stack 3.7.1 is built against Cabal-3.10.3.0. It is the master branch version of Stack that is built against GHC 9.10.2.

    If you can't wait until September 2025, and you are not using GHCup to manage versions of Stack, then command stack upgrade --git to get the master branch version. Stack will build it from source, but that only takes a few minutes.

  8. added 4 commits that reference this issue on Aug 20, 2025
    59e7e0a
    a43a925
    67e8474
    71d1302
  9. Totto16 commented on Nov 5, 2025

    @Totto16

    @karamellpelle, sorry - my mistake! Stack 3.7.1 is built against Cabal-3.10.3.0. It is the master branch version of Stack that is built against GHC 9.10.2.

    If you can't wait until September 2025, and you are not using GHCup to manage versions of Stack, then command stack upgrade --git to get the master branch version. Stack will build it from source, but that only takes a few minutes.

    Hi, so there is still no new stack release, so I am just asking, where you got the date "September 2025" from? 😄

  10. mpilgrem commented on Nov 5, 2025

    @mpilgrem
    Collaborator

    @Totto16, September 2025 was, originally, the planned date for the release of GHC 9.14.1. It has not yet been released, but the last release candidate has been made available:

    I'm planning to release the next version of Stack soon after GHC 9.14.1 is available.

  11. added a commit that references this issue on Apr 17, 2026
    6322071
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0