Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does cabal select a package from multiple global repositories? #6139

Open
TerrorJack opened this issue Jul 8, 2019 · 4 comments
Open

Comments

@TerrorJack
Copy link
Collaborator

When multiple repositories (e.g. both head.hackage and regular hackage) are present in ~/.cabal/config, a single package might come from different repos, how does cabal decide from which repo is the package picked up? The documentation only says:

If you want, you can configure multiple repositories, and cabal will combine them and be able to download packages from any of them.

The intuition would be selecting from the first repo which contains the package, but it's actually not the case, e.g. when running cabal new-install dlist or cabal new-build for a local package depending on dlist, the dlist package from head.hackage is not picked up, even when head.hackage comes before regular hackage in the global config.

@gbaz
Copy link
Collaborator

gbaz commented Jul 8, 2019

Note that there is a ghc proposal pending review that addresses the lack of control over this: ghc-proposals/ghc-proposals#115

@23Skidoo
Copy link
Member

23Skidoo commented Jul 8, 2019

IIRC it depends on the order the repos are declared in the config file, I think the last one wins.

@phadej
Copy link
Collaborator

phadej commented Jul 8, 2019

Yes, last one wins. I'd already implemented a priority field, but that effort is blocked on e.g. #6101 (I really don't want to touch any of ReadP parsers at this point of time).

@fgaz
Copy link
Member

fgaz commented Feb 26, 2021

i think the recently released active-repositories fixes this

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

No branches or pull requests

5 participants