commercialhaskell / commercialhaskell/stack

stack install PKG-VERSION may quietly install some other version

Open
#5,112 11 comments 0 reactions 0 assignees View on GitHub
component: init / new type: bug
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### Steps to reproduce

Outside a project, ask stack install to install a package version that it doesn't know about yet (because stack update wasn't run recently):
```
~$ cd
~$ stack install --resolver=lts-14.16 hledger-lib-1.16.1 --dry-run
No packages would be unregistered.

Would build:
hledger-lib-1.14.1: database=snapshot, source=hledger-lib (from Hackage)
```

### Expected

I expected it to find the requested version (1.16.1) from hackage, perhaps automatically updating its package db first; or to complain that it didn't know about this version, and fail with an error, and suggest running stack update.

### Actual

It installed an older version (1.14.1) (the latest known at time of last stack update, presumably), and reported no error.

### Stack version

```
~$ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
```

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.