haskell-stack

Get Stack to pass test suite name as part of --test-arguments

送分小仙女□ 提交于 2019-12-10 13:47:49
问题 It's possible, with cabal, to set up a continuous build that records test successes/failures in a format many CI systems will accept with a command like: cabal test '--test-option=--jxml=test-results/$test-suite.xml' The important part here is that $test-suite is replaced with the name of the test, so that different tests put their results into different files. When I use stack, all tests get literally the option --jxml=test-results/$test-suite.xml passed to them, so the end result is that

Cannot build a hello world program with Stack because of flag bytestring--lt-0_10_4

一曲冷凌霜 提交于 2019-12-10 13:34:10
问题 With a bare "hello world" project generated by stack new myproject simple whenever I run stack setup , stack init or stack build I have the following error all the time: Downloading lts-10.0 build plan Downloaded lts-10.0 build plan. AesonException "Error in $.packages.cassava.constraints.flags['bytestring--lt-0_10_4']: Invalid flag name: \"bytestring--lt-0_10_4\"" I saw some guys talk about the issue, and argue about whether it is accepted or not to have two sequential - in a flag name like

Haskell Stack and C Libraries

旧街凉风 提交于 2019-12-10 12:38:50
问题 This is possibly a duplicate of this post. But the only answer it got does not seem to work for me, so I post my own case here hoping to find a specific solution. I am on Linux Ubuntu Trusty. I have a proprietary C library, libMyLib.so, located in /usr/local/lib (which is included in LD_LIBRARY_PATH). I wrote the haskell bindings to this C library the ususal way. Main.hs : {-# LANGUAGE ForeignFunctionInterface #-} module Main where import Foreign import Foreign.C.Types foreign import ccall

Getting “Could not find module `Yesod'” when I try to run first example from Yesod book

隐身守侯 提交于 2019-12-10 10:46:40
问题 I know this seems a duplicate to Could not find module `Yesod', but unlike that user, ghc-pkg list does not show Yesod in its output on my computer, they didn't seem to be using stack (I am, and I'm not sure if that means I don't need to worry about ghc-pkg list ), and additionally, the answer (code) to that question did not help my situation. The Yesod Book has an example that I've been trying to get to work for several hours now. I'll reprint it here {-# LANGUAGE OverloadedStrings #-} {-#

Haskell Stack build specific executable

痞子三分冷 提交于 2019-12-10 10:24:43
问题 How to build an specific stack executable file, ie. those specified in projectname.cabal , like: executable executable-name hs-source-dirs: tools main-is: ExecutableModule.hs ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: base , hsass , hlibsass I would need to compile executable-name and no other. It would be something like: stack build --executable executable-name 回答1: Stack uses a component based lookup, e.g. stack build packagename:component-type:component-name So

Haskell-Stack: Access violation error during build

送分小仙女□ 提交于 2019-12-10 04:01:51
问题 I've been trying to build my Haskell project for the last couple days using stack and I'm getting an access violation error. From what I understand I have the latest stack version and GHC. This was all originally working until I added a library to my cabal file. I've now removed it but the error still occurs. I've also reverted back to when my code was definitely working so I'm sure this is something caused by stack. I've tried uninstalling stack, deleting .stack-work and reinstalling. Then

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

邮差的信 提交于 2019-12-09 16:32:36
问题 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 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-trace Invalid option `--show-trace' Usage: stack build [TARGET] [--dry-run] [-

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

陌路散爱 提交于 2019-12-08 15:33:49
问题 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? 回答1: I'd say you should commit stack.yaml , as that makes it much easier to build your package in a reproducible way. That is particularly relevant if your repository is public, and if you use the more exotic kinds of extra-deps in stack.yaml (pointers to Git repositories, secondary cabal packages within your source tree, etc.). A complementary observation

GPG error when using 'stack upload'

社会主义新天地 提交于 2019-12-07 20:19:21
问题 When I run stack upload I get an error: Environment variable GPG_TTY is not set (see man gpg-agent) Unable to find gpg2 or gpg executable The upload appears to succeed, but the error concerns me. What are the consequences of this error? Is there a way to avoid to suppress it? 回答1: As per discussion in the comments the errors are due to stack trying to automatically GPG sign packages that are being uploaded as of version 1.1.0. To my understanding this is a stack-specific feature (with no

Why does stack not pass my ghc-options to the compiler?

空扰寡人 提交于 2019-12-07 17:54:05
问题 In the cabal file I specify the GHC options -Wall and -O2 : name: Test version: 0.1.0.0 build-type: Simple cabal-version: >=1.8 executable Test hs-source-dirs: src main-is: Test.hs build-depends: base >=4.8 && <4.10 ghc-options: -Wall -O2 When I compile the program Test.hs: data Color = Red | Green | Blue foo :: Color -> Int foo Red = 0 foo Green = 1 -- foo Blue is intentionally missing!! I get the error: Preprocessing executable 'Test' for Test-0.1.0.0... [1 of 1] Compiling Main ( src/Test