haskell / haskell/cabal

Immutable remote-repos get unnecessary "too old" warning

Open
#2,256 0 comments 0 reactions 0 assignees View on GitHub
cabal-install: cmd/update cabal-install: other old-milestone: cabal-install 2.0 type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Actions: set a remote repo to something like:

```
remote-repo: stackage-2014-11-27-ghc78-exc-1:http://www.stackage.org/snapshot/2014-11-27-ghc78-exc-1
```

Run `cabal update`. A few days later (in my case, 16, I don't know the exact cutoff in the cabal-install codebase) run `cabal update` again. You'll see something like:

```
$ cabal update
Downloading the latest package list from
stackage-35ecbe20461b5fe50bad1e5653f6660132861fe9
Skipping download: Local and remote files match.
Warning: The package list for
'stackage-35ecbe20461b5fe50bad1e5653f6660132861fe9' is 16 days old.
Run 'cabal update' to get the latest list of available packages.
```

The issue is that Stackage server uses cache headers to indicate that the package index hasn't changed. But cabal-install continues to believe that the package index is 16 days old. Ideally, cabal-install would:
1. Update the last modified time each time it does an update, even if there is no new index file.
2. Perhaps inspect cache headers to note how long to cache the package index, and not warn the user during that time.

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.