Closed thautwarm closed 4 years ago
Hi, that's right, you need to build with Stack's stack-lts-12.yaml
file because ghc822
is no longer in nixpkgs; see how my CI script does it:
Alternatively you can use an older commit of static-haskell-nix.
I've updated the README accordingly in https://github.com/nh2/static-haskell-nix/commit/95fa110091dff2bf6dace3921c18a26c264d776e, sorry that I didn't document it there when I made the CI fix!
Thanks, I'm trying with this configuration.
Besides, I'd ask if I change cabalPackageName
in default.nix
to my project name, and point the path of my local project, will it be a correct way to build my stack project into static executable?
@thautwarm Pretty much yes, but start with the template from static-stack2nix-builder-example
(https://github.com/nh2/static-haskell-nix/tree/master/static-stack2nix-builder-example), which is made for this purpose, not with static-stack
(which is also based on that template but already a bit specialised).
If you encounter any problems with building your project, file me an issue!
@nh2 Thanks! As building once costs quite a long time your convince means a lot to me.
A small question:
Does this exactly mean I can use lts-13.26
? Or should I change it to compiler = "lts-13.26"
?
I'm new to Nix, and it's very kind of you to give helps.
Hey,
no the compiler
is correct. It contains the GHC version matching the one in the Stackage LTS you are using, for example for lts-13.26
visit https://www.stackage.org/lts-13.26 and it shows at the top
LTS Haskell 13.26 (ghc-8.6.5)
so ghc865
is the right one.
building once costs quite a long time
If you use my cachix
(https://github.com/nh2/static-haskell-nix#binary-caches-for-faster-building-optional) then you may save a lot of time because you will not need to build big parts (like GHC) from source.
Thanks, in fact I know that but still not sure... Also I'm using cachix but I'm not sure if it is working because I still need to wait for quite a few minutes before a build exception got raised(my project relies on a big one, which raises errors like incorrect locale)
Environment
Ubuntu 16.04(Virtualbox)
System GHC:
(base) redy@redy-VirtualBox:~/Desktop/static-haskell-nix/static-stack$ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.10.3
(installed directly fromapt
)Reproduction
v2.1.3
to~/Desktop/stack
.~/Desktop/stack-haskell-nix
, get in andgit submodule init && git submodule update --recursive
cd static-stack
,$(nix-build --no-link -A fullBuildScript --argstr stackDir /home/redy/Desktop/stack)
: