Questions tagged [haskell-stack]

Questions about the Stack, a build tool for the Haskell language. Do not use this tag for general Haskell questions that do not involve Stack.

stack is a modern, cross-platform build tool for Haskell code. It covers management of Haskell environment and project dependencies, building, testing and benchmarking.

1268 questions
14
votes
2 answers

Why is `stack build` altering my .cabal file?

I am attempting to build a project which uses Euterpea. Running stack build I get the following error, suggesting that I need to add Euterpea to the build-depends section of my .cabal file. $ sb composition-0.1.0.0: build (lib + exe) Preprocessing…
mherzl
  • 5,624
  • 6
  • 34
  • 75
14
votes
1 answer

What is the difference between `stack clean` and removing the `.stack-work` directory?

1 Context I am involved in a Haskell project that involves lots of C-bits and FFI. So I find myself frequently running and re-running commands like $ stack build $ stack build --force-dirty $ stack clean $ rm ./.stack-work over and over in order…
George
  • 6,927
  • 4
  • 34
  • 67
14
votes
2 answers

Stack (Haskell) throws TlsException in Windows

Stack (under Windows) sometimes throws the following exception when trying to download files (e.g., during stack setup or while downloading a build plan): TlsException (HandshakeFailed (Error_Protocol ("certificate has unknown…
Dominique Unruh
  • 1,248
  • 8
  • 23
14
votes
4 answers

How can packages be unhidden when using only stack?

I'd like to try out the Writer monad in ghci. As advised here, I tried to use only stack to manage GHC and packages, and avoid a global installation. From a fresh Ubuntu 15.04 install, after installing stack: stack setup mkdir lyah && cd lyah stack…
jazmit
  • 5,170
  • 1
  • 29
  • 36
13
votes
1 answer

Could not find module System.Console.MinTTY.Win32 when compiling test-framework with Stack on Windows

I'm getting an error when attempting to compile Haskell tests using test-framework on Windows. Steps to reproduce Create a new library using Stack: $ stack new repro simple-library Then navigate into the repro directory and edit the repro.cabal…
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
13
votes
1 answer

haskell `stack` commands for uninstall/clean up?

stack setup download and installs GHC for project, ~/.stack/programs, ~/.stack/snapshots and somewhere else which I don't know yet) stack build downloads dependencies and build them. ~/.stack/setup-exe-cache and somewhere else. I want to…
13
votes
2 answers

While constructing the build plan, the following exceptions were encountered

I am trying to install stack install ghc-mod and I've got the following error: In the dependencies for ghc-mod-5.8.0.0: Cabal-2.0.1.1 from stack configuration does not match >=1.18 && <1.25 (latest matching version is 1.24.2.0) …
softshipper
  • 32,463
  • 51
  • 192
  • 400
13
votes
5 answers

stack build error: attribute ‘ghc822’ missing, at (string):1:53

I am attempting to build my haskell project on NixOS. Running $ stack build gives the following error. $ stack build error: attribute ‘ghc822’ missing, at (string):1:53 (use ‘--show-trace’ to show detailed location information) What does this error…
mherzl
  • 5,624
  • 6
  • 34
  • 75
13
votes
1 answer

Haskell Stack doesn't use system Ghc

I'm trying to use Haskell Stack to setup a project but using the stack provided ghc I am having a -fPIC error GitHub issue To bypass the fPIC problem I'm trying to use a package manager provided GHC using the 7.10.3 version (stack currently is using…
Stefano Cerruti
  • 163
  • 2
  • 7
13
votes
1 answer

Force `stack` to rebuild an installed package

I often install a package which depends on external libraries and manage to move those external libraries to other locations afterwards, so that compiled programs exit with a loader error. In those cases I just want stack to rebuild an already…
Sebastian Graf
  • 3,602
  • 3
  • 27
  • 38
13
votes
2 answers

Is the stack.yaml file supposed to be checked into version control?

I'm quite new to stack and wondering whether to git commit or .gitignore that file. What are the implications of either of these choices?
Wizek
  • 4,854
  • 2
  • 25
  • 52
13
votes
2 answers

Where does `stack build` store generated executables?

I'm using multiple stack.yaml files to build against GHC 7.8 and 7.10. How do I set up my PATH to include the binaries for a specific stack.yaml file, e.g. stack-7.8.yaml?
ntc2
  • 11,203
  • 7
  • 53
  • 70
12
votes
2 answers

What is the suggested way of setting up Haskell on Archlinux?

I'd like some guidance on what's the (best) way to have Haskell work on Archlinux. By work I mean all, in terms of the ghci command line tool, installing packages I don't have - such as vector-space, which this answer to a question of mine refers to…
Enlico
  • 23,259
  • 6
  • 48
  • 102
12
votes
2 answers

Should stack.yaml.lock be checked into source control?

Since stack v2, stack produces a stack.yaml.lock file. Should this file be committed to source control, like stack.yaml? Or should it be .gitignored? On the one hand it's generated content and isn't source, on the other hand it contains hashes of…
yairchu
  • 23,680
  • 7
  • 69
  • 109
12
votes
2 answers

How to prevent stack from downloading GHC for every new project?

How to prevent stack from downloading GHC for every new project? Every time I create a new project using stack and then build or exec the codes, stack will install a new GHC for me. This is not only boring for waiting such a long time for a huge…
cmal
  • 2,062
  • 1
  • 18
  • 35
1 2
3
84 85