commercialhaskell / commercialhaskell/stack

NixOS + freeglut = Strange error

Open
#4,325 2 comments 3 reactions 0 assignees View on GitHub
component: nix further investigation required
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

### General summary

This is basically [this issue](https://github.com/NixOS/nixpkgs/issues/47415), which I believe to be more about stack than about NixOS.

### Steps to reproduce

For a MWE, consider the following:

Make sure you have cabal installed as well. Then follow these commands:

$ mkdir tempgloss
$ cd tempgloss

Create two files with these contents:

$ cat Main.hs
import Graphics.Gloss
main = display (InWindow "Nice Window" (200, 200) (10, 10)) white (Circle 80)

$ cat stack.yaml
resolver: lts-12.10
nix:
enable: true
packages: [libGL libGLU freeglut]

Now execute:

$ cabal init --is-executable -n --main-is=Main.hs -d gloss -d base -l MIT
[...]
$ stack build
[...]
$ stack exec tempgloss
### Expected

Showing a gloss window.

### Actual

```
freeglut (tempgloss): ERROR: Internal error in function fgOpenWindow
```

### Stack version

1.7.1
### Method of installation

* NixOS unstable

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.