Cabal should immediately fail if active-repositories references a non-existent repository
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
When using `active-repositories` in Cabal’s config file or in a project file and when referencing a non-existent repository, Cabal just prints a warning and continues while considering (I guess) all repositories as active. The warning can easily be overlooked and there is probably no use case for falling back to some other repository set when the user explicitly tried to specify a specific set.
A special example is trying specifying `active-repositories: :none` but forgetting the extra colon: Cabal immediately starts building dependencies and doing (potentially unintended) downloads and the warning scrolls away fast.
**To Reproduce**
For example put `active-repositories: nonexistentRepo` in Cabal’s config or in a project file. Then:
```
$ cabal v2-install
[…]
Warning: no repository provided nonexistentRepo
Resolving dependencies...
[…]
```
**Expected behavior**
Cabal should immediately fail with non-zero exit code after notifying that active-repositories refers to a non-existent repository.
**System information**
- Operating system: Arch Linux
- cabal-install version 3.6.2.0
compiled using version 3.6.2.0 of the Cabal library
- The Glorious Glasgow Haskell Compilation System, version 8.8.4
Contributor guide
Assessment
This issue has not been assessed yet.