Skip to content

cabal install prints unhelpful error when .cabal filename does not match the package name #7322

Open
@falsifian

Description

@falsifian

Describe the bug

In a project where the .cabal file has underscores in the name, cabal install fails with an unhelpful error message:

dieVerbatim: user error (cabal: Package .cabal file not found in the tarball:
/tmp/cabal-install.-42328/dist-newstyle/tmp/src-42328/note-graph-0.0.0.0/note-graph.cabal
)

After much head-scratching, I realized the problem was I needed to rename note_graph.cabal to note-graph.cabal.

To Reproduce
Steps to reproduce the behavior:

  • Put the following in a file called a_b.cabal.
cabal-version: 2.2
name: a-b
version: 0.0.0.0
build-type: Simple

executable x
  default-language: Haskell2010
  build-depends: base
  main-is: Main.hs
  • Put something in Main.hs.
  • cabal v2-install .:x

Expected behavior

One of the following would be preferrable:

  • The installation works.
  • Cabal prints an error like Your .cabal file should not have underscores in the name.

System information
OpenBSD current

I've got custom-built ghc and cabal-install ports; let me know if you'd like me to retry with an unmodified install.

The Glorious Glasgow Haskell Compilation System, version 8.6.4
falsifian moth d $ cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library```


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