commercialhaskell / commercialhaskell/stack

Alpine version works to create sample app with 9.2.1, but fails to build app on Alpine Linux with `Not using compiler at "/.ghcup/ghc/9.2.1/bin/ghc-9.2.1": UnliftIO.Exception.throwString called with:`

Open
#5,655 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary/comments (optional)

The Alpine version of Stack might use `musl` and I'm not sure if we are missing the static links.. We can't build and app created via `stack new XYZ` in Alpine Linux (Docker Image).

The verbose logs show the following message:

```console
Not using compiler at "/.ghcup/ghc/9.2.1/bin/ghc-9.2.1": UnliftIO.Exception.throwString called with:
```

> **NOTE**: The docker image works properly with version `ghc-8.10.7`

### Steps to reproduce

For example:

1. Build the Alpine alpine image from https://github.com/lierdakil/alpine-haskell/blob/master/Dockerfile

```console
docker build -t myhaskell --build-arg GHC_VERSION=9.2.1 .
```

2. Create a container

```console
$ docker run -ti myhaskell bash
[root@bd55b757dcc4]:~ # ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.1
```

3. Create a new app for testing

```console
[root@6634c7cb416e]:~ # stack new super
Downloading template "new-template" to create project "super" in super/ ...

The following parameters were needed by the template but not provided: author-name
You can provide them in /root/.stack/config.yaml, like this:
templates:
params:
author-name: value
Or you can pass each one as parameters like this:
stack new super new-template -p "author-name:value"

The following parameters were needed by the template but not provided: author-email, author-name, category, copyright, github-username
You can provide them in /root/.stack/config.yaml, like this:
templates:
params:
author-email: value
author-name: value
category: value
copyright: value
github-username: value
Or you can pass each one as parameters like this:
stack new super new-template -p "author-email:value" -p "author-name:value" -p "category:value" -p "copyright:value" -p "github-username:value"

Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- super/

Selecting the best among 20 snapshots...

* Matches https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/19.yaml

Selected resolver: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/19.yaml
Initialising configuration using resolver: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/18/19.yaml
Total number of user packages considered: 1
Writing configuration to file: super/stack.yaml
All done.
/root/.stack/templates/new-template.hsfiles: 6.06 KiB downloaded...
```

### Expected

It should build successfully, just like with version `The Glorious Glasgow Haskell Compilation System, version 8.10.7`

### Actual

```console
stack build
No setup information found for ghc-8.10.7 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux64-ncurses6'.
Supported versions: ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2
```

If you suspect that a stack command misbehaved, please include the output of that command in `--verbose` mode.
If the output is larger than a page please paste the output in a [Gist](https://gist.github.com/).

```
[root@bd55b757dcc4]:psps # stack build --verbose
Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4
2021-12-19 23:18:14.696482: [debug] Checking for project config at: /root/psps/stack.yaml
2021-12-19 23:18:14.697109: [debug] Loading project config file stack.yaml
2021-12-19 23:18:14.703460: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2021-12-19 02:18:14.7034023 UTC]
2021-12-19 23:18:14.704512: [debug] Not reading lock file
...
...
...
2021-12-19 23:18:15.141962: [debug] (SQL) SELECT "id" FROM "compiler_cache" WHERE _ROWID_=last_insert_rowid(); []
2021-12-19 23:18:15.147591: [debug] Not using compiler at "/.ghcup/ghc/9.2.1/bin/ghc-9.2.1": UnliftIO.Exception.throwString called with:

Not the compiler version we want
Called from:
throwString (src/Stack/Setup.hs:611:55 in stack-2.7.3-4GulJL1XrOF1o0veXS2dMz:Stack.Setup)

2021-12-19 23:18:15.148571: [debug] Installed tools:
-
2021-12-19 23:18:15.148817: [debug] Run process: /sbin/ldconfig -p
2021-12-19 23:18:15.150055: [debug] Process finished in 1ms: /sbin/ldconfig -p
2021-12-19 23:18:15.150211: [debug] Did not find shared library libtinfo.so.5
2021-12-19 23:18:15.150321: [debug] Did not find shared library libtinfo.so.6
2021-12-19 23:18:15.150507: [debug] Found shared library libncursesw.so.6 in /usr/lib/
2021-12-19 23:18:15.150667: [debug] Found shared library libgmp.so.10 in /usr/lib/
2021-12-19 23:18:15.150759: [debug] Did not find shared library libgmp.so.3
2021-12-19 23:18:15.150825: [debug] Potential GHC builds: ncurses6
2021-12-19 23:18:15.150916: [debug] Found already installed GHC builds:
2021-12-19 23:18:15.473910: [debug] Trying to setup GHC build: ncurses6
2021-12-19 23:18:15.475716: [error] No setup information found for ghc-8.10.7 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux64-ncurses6'.
Supported versions: ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2
```

### Stack version

```
$ stack --version
Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4

[root@bd55b757dcc4]:psps # ghcup list
[ Info ] downloading: https://www.haskell.org/ghcup/data/ghcup-0.0.6.yaml as file /.ghcup/cache/ghcup-0.0.6.yaml
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
[ Warn ] New GHCup version available: 0.1.17.4. To upgrade, run 'ghcup upgrade'
Tool Version Tags Notes
✗ ghc 7.10.3 base-4.8.2.0 no-bindist
✗ ghc 8.0.2 base-4.9.1.0
✗ ghc 8.2.2 base-4.10.1.0
✗ ghc 8.4.1 base-4.11.0.0 no-bindist
✗ ghc 8.4.2 base-4.11.1.0 no-bindist
✗ ghc 8.4.3 base-4.11.1.0 no-bindist
✗ ghc 8.4.4 base-4.11.1.0
✗ ghc 8.6.1 base-4.12.0.0 no-bindist
✗ ghc 8.6.2 base-4.12.0.0 no-bindist
✗ ghc 8.6.3 base-4.12.0.0 no-bindist
✗ ghc 8.6.4 base-4.12.0.0 no-bindist
✗ ghc 8.6.5 base-4.12.0.0
✗ ghc 8.8.1 base-4.13.0.0 no-bindist
✗ ghc 8.8.2 base-4.13.0.0 no-bindist
✗ ghc 8.8.3 base-4.13.0.0 no-bindist
✗ ghc 8.8.4 base-4.13.0.0
✗ ghc 8.10.1 base-4.14.0.0
✗ ghc 8.10.2 base-4.14.1.0
✗ ghc 8.10.3 base-4.14.1.0
✗ ghc 8.10.4 base-4.14.1.0
✗ ghc 8.10.5 base-4.14.2.0
✗ ghc 8.10.6 base-4.14.3.0
✗ ghc 8.10.7 recommended,base-4.14.3.0
✗ ghc 9.0.1 base-4.15.0.0
✔✔ ghc 9.2.1 latest,base-4.16.0.0
✗ cabal 2.4.1.0
✗ cabal 3.0.0.0
✗ cabal 3.2.0.0
✗ cabal 3.4.0.0
✗ cabal 3.4.1.0
✗ cabal 3.6.0.0
✔✔ cabal 3.6.2.0 latest,recommended
✗ hls 1.1.0
✗ hls 1.2.0
✗ hls 1.3.0
✗ hls 1.4.0
✗ hls 1.5.0
✗ hls 1.5.1 latest,recommended
✗ stack 2.5.1
✗ stack 2.7.1
✗ stack 2.7.3 latest,recommended
✔✔ ghcup 0.1.16.2 stray
✗ ghcup 0.1.17.4 latest,recommended
```

### Method of installation

* Unofficial Docker Image from https://github.com/lierdakil/alpine-haskell

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.