haskell / haskell/cabal

cabal update is stuck on old index-state

Open
#9,796 5 comments 1 reaction 0 assignees View on GitHub
cabal-install: cmd/update needs triage type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

**Describe the bug**

If I run `cabal update` I get the index-state from `2024-02-21T10:56:14Z` which is several days out of date.

**To Reproduce**

```
% cabal update
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-02-21T10:56:14Z.
```

**Expected behavior**

A more recent index-state

**System information**
- Debian 12.5 x86_64 GNU/Linux

```
% cabal --version && ghc --version
cabal-install version 3.10.2.1
compiled using version 3.10.2.1 of the Cabal library
The Glorious Glasgow Haskell Compilation System, version 9.4.8
```

**Additional context**

In theory this could be a hackage-server issue, but I deduced it to be a cabal issue because of the following. If I run with `-v` I get

```
% cabal update -v
Project settings changed, reconfiguring...
Downloading the latest package list from hackage.haskell.org
Selected mirror http://hackage.haskell.org/
Downloading timestamp
Running: /usr/bin/curl 'http://hackage.haskell.org/timestamp.json' --output /tmp/transportAdapterGet369534-1 --location --write-out '%{http_code}' --user-agent 'cabal-install/3.10.2.1 (linux; x86_64)' --silent --show-error --dump-header /tmp/curl-headers369534-2.txt
Waiting to acquire cache lock on
/home/tom/.cabal/packages/hackage.haskell.org/hackage-security-lock
Acquired cache lock on
/home/tom/.cabal/packages/hackage.haskell.org/hackage-security-lock
Released cache lock on
/home/tom/.cabal/packages/hackage.haskell.org/hackage-security-lock
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-02-21T10:56:14Z.
```

and then if I run

```
% /usr/bin/curl 'http://hackage.haskell.org/timestamp.json'
{"signatures":[{"keyid":"aa315286e6ad281ad61182235533c41e806e5a787e0b6d1e7eef3f09d137d2e9","method":"ed25519","sig":"EL6N65OAI4YqyFZFy1B5R2THWyBKsIXvAWV7459VNFay+rffS86gId8xDXDS87cUaVtcMdJgstJrqNk50lxxCw=="}],"signed":{"_type":"Timestamp","expires":"2024-03-14T05:41:27Z","meta":{"/snapshot.json":{"hashes":{"md5":"495be164eb823f873b0f6c42e43ade54","sha256":"31d1d2cf5d557fd8ab7af6c220d04e58bcd667a111ae80fcf7f0a499c1e0db41"},"length":970}},"version":94437}}
```

so at least the `http://hackage.haskell.org/timestamp.json` has the correct timestamp. Then if I move my `.cabal` directory away and try afresh I get the correct index-state

```
% mv .cabal .cabal.away
% cabal update
Config file path source is default config file.
Config file not found: /home/tom/.config/cabal/config
Writing default configuration to /home/tom/.config/cabal/config
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org has been updated.
The index-state is set to 2024-03-11T05:40:28Z.
```

After having done that, if I move `.cabal.away` back to `.cabal` the issue no longer appears:

```
% cabal update
Warning: Both /home/tom/.cabal and /home/tom/.config/cabal/config exist -
ignoring the former.
It is advisable to remove one of them. In that case, we will use the remaining
one by default (unless '$CABAL_DIR' is explicitly set).
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-03-11T05:40:28Z.
```

But then if I

```
% rm /home/tom/.config/cabal/config
```

then the issue comes back

```
% cabal update
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-02-21T10:56:14Z.
```

I have absolutely no idea what's going on here, why `~/.config/cabal/config` is relevant, and why `~/.config/cabal/config` and `~/.cabal` shouldn't both exist. (Maybe it means `~/.cabal/config` rather than `~/.cabal`).

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.