Skip to content

Log if there are multiple local packages with the same ID in a project#11487

Open
edmundnoble wants to merge 4 commits intohaskell:masterfrom
edmundnoble:push-yuuxpzvskwon
Open

Log if there are multiple local packages with the same ID in a project#11487
edmundnoble wants to merge 4 commits intohaskell:masterfrom
edmundnoble:push-yuuxpzvskwon

Conversation

@edmundnoble
Copy link
Contributor

@edmundnoble edmundnoble commented Feb 13, 2026

Fixes #11140 by logging a message of the form:

  unlines
        [ "cabal project has multiple sources for pkg-one-0.1:"
        , "  <some path>/pkg-one"
        , "  <some path>/pkg-two"
        , "the choice of source that will be used is undefined."
        ]

It works for remote source repos + other remote repos as well, though it doesn't try to be too smart about printing remote source repo information to avoid verbosity.

Note: this message is only ever printed if the entire package identifier is duplicated between local packages, which includes both name and version.

One thing I'm not sure about here is how many packages already do this. Unfortunately clc-stackage is seemingly irrelevant as a test case here because cabal.project is the real issue. I'm also not sure if cabal2nix or haskell.nix generates project environments where this sort of message would be triggered a lot.


This PR modifies behaviour or interface**

Include the following checklist in your PR:

edmundnoble and others added 2 commits February 15, 2026 15:39
Strictly speaking it could return `(a, a, [a])` or `(a, NonEmpty a)` or
something, but this at least makes `head` safe.

Co-authored-by: Hécate Kleidukos <Kleidukos@users.noreply.github.com>
Co-authored-by: Hécate Kleidukos <Kleidukos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project silently picks one twin package

3 participants