Skip to content

Confusing error message when project contains duplicates in 'packages' declaration #6197

@dmwit

Description

@dmwit

Describe the bug
I see the following behavior:

% cabal v2-repl
Resolving dependencies...
TODO: add support for multiple packages in a directory
CallStack (from HasCallStack):
  error, called at ./Distribution/Client/ProjectOrchestration.hs:532:9 in main:Distribution.Client.ProjectOrchestration
CallStack (from -prof):
  Distribution.Client.ProjectOrchestration.resolveTargets (Distribution/Client/ProjectOrchestration.hs:(502,1)-(608,34))
  Distribution.Client.ProjectOrchestration.CAF (<entire-module>)
  1.10s user 0.16s system 98% cpu 1.282 total
zsh: exit 1

To Reproduce
Set up a directory that matches mine:

% tree
.
├── a
│   └── a.cabal
└── b
    ├── b.cabal
    └── cabal.project.local

2 directories, 3 files
% cat a/a.cabal
name:                a
version:             0.1.0.0
build-type:          Simple
% cat b/b.cabal
name:                b
version:             0.1.0.0
build-type:          Simple
% cat b/cabal.project.local
packages: ./
          ../a/

Navigate to the b directory, then run cabal v2-repl.

System information

% cabal --version
cabal-install version 2.4.1.0
compiled using version 2.4.1.0 of the Cabal library 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions