haskell / haskell/cabal

`cabal list` considers packages that should be ignored by active-repositories

Open
#7,278 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

Using cabal config:

```
active-repositories:
, hackage.haskell.org -- contains redesigned-carnival-1.0.0.0
, localhost:override -- contains redesigned-carnival-0.2.0.0
```

`cabal build` correctly uses v0.2.0.0 from the `localhost` repository. But `cabal list` shows `1.0.0.0` as the *Default available version*:
```
sh-5.0$ cabal list redesigned-carnival
* redesigned-carnival
Synopsis: Package for dependency confusion
Default available version: 1.0.0.0
Installed versions: [ Not installed ]
License: PublicDomain
```

**Expected behavior**

`cabal list` should ignore packages according to the `active-repositories` configuration.
Specifically, in the example above should show `0.2.0.0` as the *Default available version*.

**System information**
```
sh-5.0$ cabal v3-list redesigned-carnival
cabal: unrecognised command: v3-list (try --help)
sh-5.0$ cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library
sh-5.0$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.4
sh-5.0$ uname -s -r -v -m -o
Linux 5.9.14-200.fc33.x86_64 #1 SMP Fri Dec 11 14:30:56 UTC 2020 x86_64 GNU/Linux
```

`cabal-install` built from Git commit:
```
commit 97582dd2cbf56bcc19830c4c3a3d98f4af7d1a0e (HEAD, tag: cabal-install-3.4.0.0-rc7, tag: Cabal-3.4.0.0-rc7)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.