How do I make stack not pass "-fdiagnostics-color=always" to GHC

I am a Windows user that recently moved to the latest stack (1.6.3), and the latest GHC (8.2.2). It seems that in the latest GHC there's color output possible with error messages. Color happens via ANSI escape sequences that windows doesn't understand, so it just shows a bunch of garbage text between the real text.[1 of 2] Compiling IOSystem.Haskeline ( app\IOSystem\Haskeline.hs, .stack-work\dist\5c8418a7\build\galbreak\galbreak-tmp\IOSystem\Haskeline.o )←[;1mapp\IOSystem\Haskeline.hs:28:13: ←[;1m←[31merror:←[0m←[0m←[;1m←[0m←[0m←[;1m * Could...Read more

stack is not working after upgrading platform to 8.0.2 from 8.0.1

After upgrading haskell platform package, stack command does not work.$ stack pathNo compiler found, expected minor version match with ghc-8.0.1 (x86_64) (based on resolver setting in /home/eii/exercism/haskell/linked-list/stack.yaml).To install the correct GHC into /home/eii/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag.$I tried stack setup but it is trying to download an old GHC (ghc-8.0.1). I just installed Haskell platform 8.0.2 (haskell-platform-8.0.2-unknown-posix--full-x86_64.tar.gz). I am using...Read more

stack ghci does not load local module but ghci does

This is similar to the question at stack ghci not loading up local modules?but not exactly the same.I have a directory with the files Main.hs and Shapes.hs where Main.hs has a reference to the module Shapes.If I run ghci Main.hseverything works fine. This is version 7.10.But if I run, in version 8, stack ghci :load Main.hsI get the error [1 of 1] Compiling Main ( Main.hs, interpreted ) Main.hs:3:1: error: Failed to load interface for ‘Shapes’ It is not a module in the current program, or in any known package. Fai...Read more

What is reason not to use stack --nix when I using nix?

I am on NixOS but I think this question should apply to any platform that use nix.I found by trial that stack can be used with couple options to build a project but I don't fully understand difference among them,stackstack --system-ghcstack --nixQuestion : If I am using nix (NixOS in my case), is there any reason I will want to not use --nix argument?What is the nix way to deal with haskell project, should cabal (cabal2nix) be used in stead of stack? I found that stack is rebuilding lots of libraries that already installed by nix, what is the r...Read more

nix - Upgrading Stack in NixOS to Bleeding Edge Git Build

I run NixOS, and so am having trouble updating stack as nixpkgs always lags behind on my stable branch. From the official docs we can build the following function to upgrade stack:upgradeLocalStackInNixOS() { git clone stack cd stack cabal2nix --shell ./. --no-check --no-haddock > shell.nix nix-env -i -f shell.nix}Problem: This generates the following error:Cloning into 'stack'...remote: Enumerating objects: 44411, done.remote: Total 44411 (delta 0), reused 0 (delta 0), pack-reused 44411Rece...Read more

`nix-env -i stack` failed on Mac OS X

Because of this problem, and some one told me that I should install stack and cabal-install using nix, so I am now trying to install haskell-stack using nix-env -i.Whole error messages are here.$ nix-env -i stack...lib/machserver.cpp:180:27: note: put the semicolon on a separate line to silence this warningIn file included from lib/alloc.cpp:32:In file included from ./security_utilities/globalizer.h:31:In file included from ./security_utilities/threading.h:40:./security_utilities/threading_internal.h:67:5: warning: macro expansion producing 'de...Read more

Why is stack rewriting my .cabal file and throwing away my edits to add a new dependency?

Stack is suddenly misbehaving. I created a new project, wrote some code, needed a new dependency (containers, to get Data.Map.Strict), so I edited my project .cabal file to add the dependency and now stack is rewriting my .cabal file to throw away my edits (which makes the build fail).What stupid simple thing have I missed?(I committed what I had to git and started over.)rm -fr Problem032stack new Problem032cd Problem032stack setupstack buildstack exec Problem032-exeall works fine. But Problem032.cabal to add ",containers" to the lib...Read more

haskell stack - Does ghc-mod support ghcjs?

As of May 2016, does ghc-mod support projects compiled with ghcjs?I realise that in a lot of cases, the source is the same, but this is not the case when working with ghcjs-dom library.I currently have 2 project folders, configured with stack. From outside these folders:ghc-mod check folder1/executable/Main.hsworks perfectly. The stack.yaml file here specifies ghc-7.10.2ghc-mod check folder2/executable/Main.hsfails. The stack.yaml file here specifies ghcjs- this expected behaviour? I can't tell frrm the feature requests and ...Read more

compiler flags - How do the various ways of setting GHC options in haskell-stack work together

While setting up a deploy pipeline for optimised builds of a server application, I ran into some trouble getting the GHC options right with stack-1.6.5.In particular, from the docs it doesn't get clear to me how the various ways to specify GHC options work together and when and how they are applied.As far as I can tell, there are X ways of specifying GHC options:globally as ghc-options: in ~/.stack/config.yaml and/or /etc/stack/config.yaml, per package or with "$locals", "$targets" or "$everything"in the project stack.yaml file, per package or ...Read more

Why is stack not using the defined extra dependency?

I committed a change to Haskell's opaleye project that I need for a project I am working on. The change is in version 0.6.7003.1, which has not propagated to the nixos repository yet ( shows its current version to be 0.6.7001.0).Since this needed dependency differs from the the resolver's LTS version, I have marked the extra dependency in stack.yaml:packages:- commit: cf3296c5ffef58d36dd6b386ae53dff519ee47e9I have also marked this version in the build-depends of my project.cabal file:bui...Read more

nixos - 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 builderror: attribute ‘ghc822’ missing, at (string):1:53(use ‘--show-trace’ to show detailed location information)What does this error mean and how could I proceed? When I run $ stack build --show-trace as suggested, I get the following output, which I do not understand either.$ stack build --show-traceInvalid option `--show-trace'Usage: stack build [TARGET] [--dry-run] [--pedantic] [--fast] [--ghc-options OPTIONS] [--f...Read more

What does `stack haddock --skip <pkgname>` do?

After being unable to run stack haddock on my project because one package causes it to hang (see How to show progress of `stack haddock`? ) I tried to skip that package withstack haddock --skip haskell-src-extsBut it still tries to haddock haskell-src-exts anyway (and hangs). What is --skip supposed to do?...Read more

haskell stack - Compilation error building intero

I cannot use emacs on a new stack project because intero fails to build.I've just installed stack 1.6.3 on ubuntu 16.04I created a new (lts-10.2) stack project ('play') using: stack new play When I try to open the source files in emacs it fails to build interoIntero is not installed in the Stack environment.Installing intero-0.1.24 automatically ...intero-0.1.24: configureintero-0.1.24: build-- While building custom Setup.hs for package intero-0.1.24 using:/home/wmorgan/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2....Read more