-
Notifications
You must be signed in to change notification settings - Fork 717
Open
Labels
Description
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:
- If I want to change the project name, I also need to change the filename.
- 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. - 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
- Introduce a single uniform file name (like
package.cabal
or just.cabal
). cabal-install
should first look at thepackage.cabal
file to read metadata and if this file is not present, fall back to the current scheme.
Pros
- Simpler integration with tooling.
- More beginner-friendly build tooling.
Cons
- 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
- Do nothing.
Boarders, zimtsui, ulysses4ever and mmhat