Skip to content

[RFC] Introduce name-agnostic package filename #6299

@chshersh

Description

@chshersh

If I have a package called foo the .cabal file for this package must be called foo.cabal. For the package bar it must be named bar.cabal. So the name of the file that describes package metadata should be the same as the package name. This is a minor inconvenience that makes it harder to write tooling and interact with packages:

  1. If I want to change the project name, I also need to change the filename.
  2. Tools that work with Haskell source code and want to read fields like default-extension can't just read a single file, and they need to filter files with the .cabal extension and do extra work.
  3. GitHub analysing tools like issue-wanted can't just construct the path to the predefined file because the name of the repository and name of the package inside repository can be different.

So It feels that introducing a single name for all packages can make the ecosystem healthier. I'm not sure what are the benefits of forcing the .cabal file to have the same name as a package. But I see the benefits of having a single file name without apparent drawbacks.

Proposed change

  1. Introduce a single uniform file name (like package.cabal or just .cabal).
  2. cabal-install should first look at the package.cabal file to read metadata and if this file is not present, fall back to the current scheme.

Pros

  1. Simpler integration with tooling.
  2. More beginner-friendly build tooling.

Cons

  1. Slightly complicates the logic of the cabal-install permanently or temporary (if this change is going to be accepted and all packages will migrate to this scheme after 10 years).

Alternatives

  1. Do nothing.

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