Skip to content

Unhelpful error when using cabal.project.local without cabal.project #9168

Open
@brandonchinn178

Description

@brandonchinn178

Describe the bug
If cabal.project.local exists without cabal.project, Cabal complains with:

Warning: both implicit and explicit configuration is present.When using configuration(s) from /Users/bchinn/Desktop/foo/cabal.project.local, the following errors occurred:
The package location glob './*.cabal' does not match any files or directories.

This happens even if cabal.project.local contains a packages: line.

Also, it seems like a newline is missing after the warning message?

To Reproduce
Steps to reproduce the behavior: (fails = shows bug, succeeds = expectedly fails because cabal file is empty)

mkdir foo
touch foo/foo.cabal
cat 'packages: foo/' >> cabal.project.local

# fails
cabal build

# succeeds with just an empty cabal.project
touch cabal.project
cabal build

Expected behavior
Renaming cabal.project to cabal.project.local should have the same behavior.

System information

  • Mac
  • cabal: 3.10.1.0

Additional context
Add any other context about the problem here.

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