haskell-stack

How to exclude dependencies when building haddocks?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 08:45:47
问题 Is there any way to build haddock docs for specific packages? I'm trying to build haddocks for my package/app alone, but the following command seems to be doing this for all dependencies, as well: stack haddock webservice (where webservice is the name of my package/app) 回答1: The flag you're looking for is --no-haddock-deps as in stack haddock --no-haddock-deps webservice 来源: https://stackoverflow.com/questions/50175379/how-to-exclude-dependencies-when-building-haddocks

Haskell: Debugging Long Compilation Times on Stack Projects

为君一笑 提交于 2019-12-07 08:00:32
问题 I'm currently using Stack to build a project, which totals about 80 modules and 13,000 lines of code. Currently, compilation takes about 3 minutes for a minor change in my types files, which is unacceptable -- it prevents me from rapidly testing my code via stack ghci. It also significantly slows down a number of things: for instance, pair programming with peers or consulting with experts. I would like to be able to figure out why compilation is taking so long, and what I can do to speed it

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

纵然是瞬间 提交于 2019-12-07 01:09:27
问题 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: /usr/lib/gcc/x86_64-amazon-linux/4.8.3/crtbeginT.o: relocation R_X86_64_32 against `__TMC_END__' can not be used when making a shared object; recompile with -fPIC /usr/lib/gcc/x86_64-amazon-linux/4.8.3/crtbeginT.o: could not read symbols: Bad value collect2: error: ld returned 1 exit status `gcc'

GPG error when using 'stack upload'

百般思念 提交于 2019-12-06 13:16:56
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? 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 package signing built into cabal or hackage), and it can be disabled with --no-signature command line option to

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

北城余情 提交于 2019-12-06 10:47:26
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 #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} import Yesod

Where can I find correct package name and version for Haskell?

痞子三分冷 提交于 2019-12-06 06:37:00
问题 Say, I need System.Eval.Haskell . Or whatever else. How do I know which package I should specify in my package.yaml ? When I go to the https://hackage.haskell.org/package/plugins-1.5.7/docs/System-Eval-Haskell.html, I see no package name. P.S. "plugins" did not work for me. Thus, I assume it's something different. I hope so :) Looks like there is somewhat quite unclear difference between extra-dependencies and "regular" dependencies in the configuration. Mentioning plugins-1.5.7 as extra-dep

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

丶灬走出姿态 提交于 2019-12-06 04:02:41
问题 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, stack stack --system-ghc stack --nix Question : 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

How to add documentation after packages have already been installed?

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:34:46
I have installed a bunch of packages to the snapshot database. I would now like a local copy of their documentation (even better if it's with hyperlinked source ). Is there a way I can tell stack to run haddock on all of them? EDIT (copied from my answer): It seems that the obvious stack haddock package will install haddock for the package, so $ cd ~/.stack/snapshots/x86_64-linux/lts-3.0/7.10.2/doc $ stack haddock * seems to do what I want, with two downsides: I'll still need to remember to pass the --haddock flag to every build (there isn't a ~/.stack/config file, is there?) It seems to

Haskell Stack build specific executable

試著忘記壹切 提交于 2019-12-06 03:22:36
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 Stack uses a component based lookup , e.g. stack build packagename:component-type:component-name So if your package is called "foo", and your executable is called "bar", you can use stack build foo:exe:bar

I cant import System.Directory when using stack

五迷三道 提交于 2019-12-06 03:19:20
I am little confused about why this doesn't work. I have a small program that import System.Directory. When I run it with runhaskell on the command line it compiles and outputs what I expect. When I use the same program with stack I get a message saying Failed to load interface for ‘System.Directory’ It is a member of the hidden package ‘directory-1.3.0.0’. Use -v to see a list of the files searched for. I dont understand why it would work with runhaskell but not when i use stack ghci With the information you give, I can only attempt a guess… I think you have directory (globally) installed