Skip to content

cabal-version: 3.4 Don't generate Paths_pkgname.hs when it's not in autogen-modules #6452

Open

Description

@phadej

This is following explicit rule of "don't do anything you are not told to do".

  • cabal-version: 3.4. only generate Paths_pkgname.hs if there is autogen-modules: Paths_pkgname (note, other-modules would not be enough!)
  • cabal-version: 3.0 or older: generate Paths_pkgname.hs always.

Along the same vein we could not generate cabal_macros.h (if there's no *-extensions: CPP), but that would be a silent breakage as recent GHCs provide some of definitions. So for cabal_macros.h, the best we can do is to not generate additional TOOL_* macros. #6442 is related

  • cabal-version: 3.4 and recent GHC: generate cabal_macros.h only if there is *-extensions: CPP
  • cabal-versions: 3.4 and old GHC:
    • generate full cabal_macros.h if there's *-extensions: CPP
    • generate only TOOL_ and CURRENT_ definitions if there is not *-extensions: CPP
  • cabal-version: 3.0 or older, and recent GHC: generate only TOOL_ and CURRENT_ definitions
  • cabal-version: 3.0 or older, and old GHC: generate full cabal_macros.h

Note: currently Paths_pkgname.hs uses CPP itself, but it can be changed.
We can generate Paths file suitable for specific compiler/dependencies version.

Discussion time: until 2020-02-01

Activity

  1. self-assigned this
    on Dec 21, 2019
  2. added this to the 3.4 milestone on Dec 21, 2019
  3. removed this from the Considered for 3.4 milestone on Aug 9, 2021
  4. changed the title [-]cabal-version: 3.4 Don't generate `Paths_pkgname.hs` it it's not in `autogen-modules`[/-] [+]cabal-version: 3.4 Don't generate `Paths_pkgname.hs` when it's not in `autogen-modules`[/+] on Sep 7, 2021
  5. removed their assignment
    on Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions