Skip to content

Misleading error message when cabal.project does not have packages field #7401

Open
@augustss

Description

@augustss

The error message claims there is no .cabal file nor a cabal.project,
when in fact they both exist.

Verse$ cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library
Verse$ cabal build
Warning: There are no packages or optional-packages in the project
cabal.exe: There is no <pkgname>.cabal package file or cabal.project file. To
build packages locally you need at minimum a <pkgname>.cabal file. You can use
'cabal init' to create one.

For non-trivial projects you will also want a cabal.project file in the root
directory of your project. This file lists the packages in your project and
all other build configuration. See the Cabal user guide for full details.

Verse$ ls -l
total 14
-rw-r--r-- 1 lennart.augustsson Domain Users   14 May 18 17:18 cabal.project
-rw-r--r-- 1 lennart.augustsson Domain Users  113 May 18 16:33 CHANGELOG.md
drwxr-xr-x 1 lennart.augustsson Domain Users    0 May 18 15:39 dist-newstyle
drwxr-xr-x 1 lennart.augustsson Domain Users    0 May 18 17:12 src
-rw-r--r-- 1 lennart.augustsson Domain Users 1305 May 18 17:15 Verse.cabal

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