commercialhaskell / commercialhaskell/stack
`stack upgrade` tries to download bindist with missing or unknown extension
- Dominant language
- Haskell
- Stars
- 4.1k
- Forks
- 850
- Avg merge
- 10h 37m
- Merged PRs (30d)
- 4
Description
### Steps to reproduce
Note: this example is for macOS, but similar steps can be used by adjusting the filenames for other platforms.
1. Upload a file named `stack-2.1.3-osx-x86_64` or `stack-2.1.3-osx-x86_64.bin` to the [Github release of Stack](https://github.com/commercialhaskell/stack/releases/latest)
2. On a machine with an older version of `stack`, run `stack upgrade`.
### Expected
`stack upgrade` should ignore `stack-2.1.3-osx-x86_64` or `stack-2.1.3-osx-x86_64.bin` since those aren't known extensions. It should only try downloading `.tar.gz` or `.zip` files, since those are the only extensions it supports.
### Actual
`stack upgrade` tries to download the `.bin` (or bare) file, even though a `.tar.gz` file also exists, and then fails (and falls back to source upgrade) because it has an unknown archive format.
```
$ stack upgrade
Current Stack version: 2.1.1, available download version: 2.1.3
Newer version detected, downloading
Querying for archive location for platform: osx-x86_64-static
Querying for archive location for platform: osx-x86_64
Downloading from: https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-osx-x86_64.bin
Warning: Exception occured when trying to perform binary upgrade:
Unknown archive format for Stack archive: https://github.com/commercialhaskell/stack/releases/download/v2.1.3/stack-2.1.3-osx-x86_64.bin
CallStack (from HasCallStack):
error, called at src/Stack/Setup.hs:1958:26 in stack-2.1.1-AFL4re0D1GV4wdhlVT8Mqc:Stack.Setup
```
### Stack version
```
$ stack-2.1.1 --version
Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2
```
Also observed with `stack-1.9.3`.
### Method of installation
* Official binary, downloaded from stackage.org or fpcomplete's package repository
Contributor guide
Assessment
This issue has not been assessed yet.