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
8
votes
0 answers

Erratic behaviour of Haskell Language Server in VSCode

I have the Haskell extension installed on Visual Studio Code. This extension downloaded and installed Haskell Language Server and, for no apparent reason, sometimes it works perfectly fine and sometimes it doesn't. When it does work, the extension…
Jivan
  • 21,522
  • 15
  • 80
  • 131
8
votes
1 answer

How do I use the output of a program from an earlier part of a Stack/Cabal build as source in a later part of the same build?

I have a very peculiar dependency situation that I would like to package up in a single Stack/Cabal package: I need to build and run my program to get the input to a code-generator which produces output that needs to be linked in to... my…
Cactus
  • 27,075
  • 9
  • 69
  • 149
8
votes
1 answer

getDirectoryContents:openDirStream: does not exist error when trying to build with stack

I need to import Graphics.UI.Gtk and GHC suggests: Perhaps you need to add ‘text’ to the build-depends in your .cabal file. but I use stack, so I add gtk to extra-deps, execute stack build and get ../gtk/: getDirectoryContents:openDirStream: does…
Slaus
  • 2,086
  • 4
  • 26
  • 41
8
votes
1 answer

stack ghci can't load pthread unless running as Administrator

When I run stack ghci on a brand-new project, it fails to load: $ stack new repro simple Downloading template "simple" to create project "repro" in repro\ ... (Additional output omitted to make the question more readable.) $ cd repro/ $ stack…
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
8
votes
1 answer

How do I supply a C library to stack on NixOS?

I have a stack-based project that depends on a couple C libraries. One of these C libraries, zlib, is available from a native NixOS package and I can put into the nix section of stack.yaml: nix: enable: true packages: - "zlib" The other is…
Jean-Paul Calderone
  • 47,755
  • 6
  • 94
  • 122
8
votes
2 answers

Could not find module ‘Test.HUnit’

I have a fresh installation of stack and ghci: $ stack --version Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0 $ ghci --version The Glorious Glasgow Haskell Compilation System, version…
Reb.Cabin
  • 5,426
  • 3
  • 35
  • 64
8
votes
1 answer

How can I get GHC Core output via stack?

How do I get a stack build command to dump the GHC Core? I've tried this, to no avail: stack build :hello_world --ghc-options '-ddump-simpl'
dbanas
  • 1,707
  • 14
  • 24
8
votes
1 answer

How to serve static content using Spock (Haskell)?

I am running a Spock server and wanting to serve some static content. I am using respondMiddleware function from the "Web.Spock.Action" package. The signature is: respondMiddleware :: Monad m => Middleware -> ActionCtxT ctx m a I am getting…
8
votes
1 answer

Idiomatic way to run test-suites in stack

Haskell beginner here. I am struggling to find a nice way to run my test-suites that I have defined in my .cabal file. Given that you add test-suite sections in the .cabal file I would expect that you can run all of them with a single command like…
StarSheriff
  • 1,477
  • 2
  • 17
  • 23
8
votes
0 answers

Haskell Stack doesnt work correctly on OSX Sierra

I can't get haskell's stack to work on my Mac. I installed haskell by: brew cask install haskell-platform Which is specified here: https://www.haskell.org/platform/mac.html#osx-homebrewcask I've also tried installing via the downloadable package…
PandemoniumSyndicate
  • 2,855
  • 6
  • 29
  • 49
8
votes
1 answer

multicore parallelism with stack runghc

I had been working on a script in which I hoped to take advantage of multiple processors in my machine by swapping out mapM with Async.mapConcurrently. Observing no speed increase in that instance, I wanted to verify that runghc can indeed utilize…
kostmo
  • 6,222
  • 4
  • 40
  • 51
8
votes
1 answer

'cabal copy' failed during `stack build` in cifs directory

I'm following these instructions. I successfully did stack new and stack setup but stack build fails. I found a git issue that this may be due to extra files listed in the cabal file, but removing them didn't fix the issue (and I'm just using the…
Xodarap
  • 11,581
  • 11
  • 56
  • 94
8
votes
1 answer

How to configure stack for most recent ghcjs / lts build

The stack docs gives example configurations for compiling with ghcjs https://docs.haskellstack.org/en/stable/ghcjs/ . But the latest example is with lts-7.19. I'd like to configure stack to use the latest ghcjs possible with the latest lts…
matchwood
  • 257
  • 1
  • 7
8
votes
0 answers

is there a way to use the interactive `cabal init` from stack

Let's say I have a folder with some .hs files and I want to wrap it in a project If I have cabal install and stack it's no big deal: use cabal init (interactive choosing stuff) go on with stack init but when I just go the easy - just install stack…
Random Dev
  • 51,810
  • 9
  • 92
  • 119
8
votes
2 answers

Haskell Stack Static Binary relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object

When using the following in my stack.yaml to (attempt) to compile a static binary through Stack: ghc-options: "*": -static -optc-static -optl-static -optl-pthread -fPIC I get this error: usr/bin/ld:…
Alex
  • 8,093
  • 6
  • 49
  • 79