Just installed a fresh version of stack 0.1.3.1 using the NixOS instructions.
stack new one yesod-postgres-fay
cd one
stack setup
Downloaded ghc-7.10.2.
Configuring GHC ...Running /tmp/stack-setup30688/ghc-7.10.2/configure --prefix=/home/a2/.stack/programs/x86_64-linux/ghc-7.10.2/ exited with ExitFailure 1
checking for path to top of build tree... /tmp/stack-setup30688/ghc-7.10.2/configure: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd-bindist: /bin/bash: bad interpreter: No such file or directory
configure: error: cannot determine current directory
I think that needs to be reported to GHC HQ; we're just taking the unmodified bindists. Can you open a Trac ticket?
Will do, thanks!
I'm guessing most of the people getting this error are using Zsh or some alternative shell.
Because I've been getting emails about this issue, you can just use nix-shell to build a sandbox, automatically chase those dependencies, and run the setup:
nix-shell -p bash --run "stack setup"
@sheganinans, just tried that and it didn't help. The problem isn't not having bash installed. The problem is that something expects it to be located at /bin/bash.
Is there a GHC ticket open for this?
Another thing you should look at is the Nix integration page:
http://docs.haskellstack.org/en/stable/nix_integration.html
Add the appropriate lines to your stack.yml.
Specifically "enable: true", and possibly also "path: [nixpkgs=/path/to/repo]" if you want to use a newer lts version than what is available in the stable channel. Also, "pure: true" is a good default, obviously for isolation and reproducibility sake.
Will that affect teammates who aren't using Nix?
If you are worried about that, you can pass arguments to stack, look at:
stack --nix-help
Something like this should be what you are looking for:
stack --nix --nix-path nixpkgs=/path/to/repo setup
Hmm, I think I'm too far behind (nixos 15.09) to have those flags :(
@sheganinans Did you end up putting in a GHC ticket? Can you provide a link to it?
You cannot install a normal binary distribution of GHC on NixOS because those binaries assume many paths exist that don't exist on NixOS. Instead, install the appropriate compiler through Nix rather than calling "stack setup". Once you have the correct, working compiler in $PATH, stack is going to work fine.
I still run into this regularly. It would be very nice if Stack would refrain from trying to install GHC on its own, and instead just fail quickly with an appropriate error message, if the compiler it wants is unavailable when Nix integration is enabled.
@chris-martin I opened an issue about that - https://github.com/commercialhaskell/stack/issues/2634 - but it seems there is nothing to do. Do you have a suggestion on how it should behave?
Stack only installs ghc if you ask it to.
Do you have a suggestion on how it should behave?
Stack could detect that it's running on NixOS and refuse to do the installation since it knows the attempt is going to fail anyway.
It doesn't even need to detect it, since you can permanently enable Nix integration via ~/stack/config.yaml now.
By the way, the most recent time I ran into this was running stack build, not stack setup.
Note that not everybody who runs stack on NixOS uses Nix integration.
That's interesting, how? By running Stack within nix-shell?
@chris-martin not a shell but a wrapper: https://github.com/puffnfresh/nix-files/blob/master/stack.nix
I'm trying to build a Haskell project ( https://github.com/tip-org/tools ) which is set up in a frustrating way for the normal Nix, cabal, etc. approach; so I thought I'd follow their documentation and use stack, but I hit this missing /bin/bash error when I run stack setup.
Looking through stack --help I see there's a stack build command, so I tried that too:
$ nix-shell -p stack
$ stack build
Compiler version mismatched, found ghc-8.0.0.20160204 (i386), but expected minor version match with ghc-8.0.1 (i386) (based on resolver setting in /home/chris/tip/tools/stack.yaml).
Try running "stack setup" to install the correct GHC into /home/chris/.stack/programs/i386-linux/
This also fails, and suggests I try stack setup just like the project documentation; yet the comments here suggest that stack setup should not be used on NixOS.
Is there some trick to making stack work on NixOS? Surely stack's integration with Nix should make life easier, not harder? I don't even mind building umpteen new GHCs, as long as they're isolated in /nix/store; is there no way to avoid the /bin/bash requirement in GHC's bootstrap? After all doesn't stack works on Windows?
In the 17 months that it's been around, I've never seen stack do more than error out (often after an hour or so of compilation). I was content to ignore it altogether, but it's reached a point where so many projects are using it that I'm becoming locked out of the Haskell ecosystem :(
@Warbo I'm on NixOS, and I just cloned that project and ran stack build and it worked.
Here's my relevant config:
chris@renzo ~> cat .stack/config.yaml
nix:
enable: true
pure: false
shell-file: /home/chris/.stack/shell.nix
chris@renzo ~> cat .stack/shell.nix
{ pkgs ? import <nixpkgs> {}, ghc ? pkgs.ghc }:
with pkgs;
haskell.lib.buildStackProject {
name = "default-stack-shell";
inherit ghc;
buildInputs = [ zlib ];
# https://github.com/commercialhaskell/stack/issues/2358
LANG = "en_US.UTF-8";
# https://github.com/commercialhaskell/stack/commit/568938da
TMPDIR = "/tmp";
}
I think the most important thing you're missing is the nix: {enable: true} bit. This is equivalent to adding the --nix flag to every command (e.g. stack build --nix), which tells Stack to get the appropriate GHC and stuff from Nix.
@chris-martin Thanks, I'll see if that helps. I did already try --nix, which complained that there doesn't seem to be an lts-7_7 package set:
$ stack --nix build
error: attribute ‘lts-7_7’ missing, at (string):1:239
(use ‘--show-trace’ to show detailed location information)
Despite the suggestion (presumably from a nix-* command), stack just gets confused by this suggestion:
[nix-shell:~/tip/tools]$ stack --nix build --show-trace
Invalid option `--show-trace'
I'm in the process of raising this as an issue, but the github template asks me to try the latest version of stack (1.3.0), so that's what I've been trying to install for the past few hours :(
As for this issue, I assume the problematic LTS value comes from the resolver entry in the tip-org/tools stack.yaml file, and that it's failing to find anything in my haskell.packages. I certainly don't have such an entry:
nix-repl> with import <nixpkgs> {}; with builtins; attrNames haskell.packages
[ "ghc6123" "ghc704" "ghc7102" "ghc7103" "ghc722" "ghc742" "ghc763" "ghc783" "ghc784" "ghc801" "ghcHEAD" "ghcNokinds" "ghcjs" "lts" "lts-0" "lts-0_0" "lts-0_1" "lts-0_2" "lts-0_3" "lts-0_4" "lts-0_5" "lts-0_6" "lts-0_7" "lts-1" "lts-1_0" "lts-1_1" "lts-1_10" "lts-1_11" "lts-1_12" "lts-1_13" "lts-1_14" "lts-1_15" "lts-1_2" "lts-1_4" "lts-1_5" "lts-1_7" "lts-1_8" "lts-1_9" "lts-2" "lts-2_0" "lts-2_1" "lts-2_10" "lts-2_11" "lts-2_12" "lts-2_13" "lts-2_14" "lts-2_15" "lts-2_16" "lts-2_17" "lts-2_18" "lts-2_19" "lts-2_2" "lts-2_20" "lts-2_21" "lts-2_22" "lts-2_3" "lts-2_4" "lts-2_5" "lts-2_6" "lts-2_7" "lts-2_8" "lts-2_9" "lts-3" "lts-3_0" "lts-3_1" "lts-3_10" "lts-3_11" "lts-3_12" "lts-3_13" "lts-3_14" "lts-3_15" "lts-3_16" "lts-3_17" "lts-3_18" "lts-3_19" "lts-3_2" "lts-3_20" "lts-3_3" "lts-3_4" "lts-3_5" "lts-3_6" "lts-3_7" "lts-3_8" "lts-3_9" "lts-4" "lts-4_0" "lts-4_1" "lts-4_2" "lts-5" "lts-5_0" "lts-5_1" "lts-5_10" "lts-5_11" "lts-5_12" "lts-5_13" "lts-5_14" "lts-5_15" "lts-5_16" "lts-5_17" "lts-5_18" "lts-5_2" "lts-5_3" "lts-5_4" "lts-5_5" "lts-5_6" "lts-5_7" "lts-5_8" "lts-5_9" "lts-6" "lts-6_0" "lts-6_1" "lts-6_10" "lts-6_11" "lts-6_12" "lts-6_13" "lts-6_14" "lts-6_15" "lts-6_16" "lts-6_17" "lts-6_2" "lts-6_3" "lts-6_4" "lts-6_5" "lts-6_6" "lts-6_7" "lts-6_8" "lts-6_9" "lts-7" "lts-7_0" "stable" "unstable" ]
stable and unstable are just my own additions. It also doesn't look like the latest nixpkgs has such an attribute either: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/haskell-packages.nix
Since they're just set up as aliases to ghc801 I'll try adding one to my overrides, although the ghc801 package set is the one stack complained about in the first place...
@Warbo Oh yes, another tip: The LTS releases make it into nixpkgs master in a fairly timely matter, but they don't get backported into old NixOS releases. I have overrides in my Nix config to merge the haskell packages from unstable and 16.09 together so that it can fall back to using unstable for anything that hasn't been backported.
The LTS releases make it into nixpkgs master in a fairly timely matter, but they don't get backported into old NixOS releases.
Actually, Nixpkgs dropped support for LTS releas package sets several months ago and those "lts-x_y" names are obsolete. You should probably update to a recent version of stack, i.e. by running:
nix-env -f "<nixpkgs>" -iA stack
@Warbo, I can compile https://github.com/tip-org/tools with Nix using the following commands:
~
$ nix-shell -p stack -p haskell.compiler.ghc801
[nix-shell:/tmp/tools]$ stack config --system-ghc set system-ghc --global true
[nix-shell:/tmp/tools]$ stack build
~
@peti thanks, that works for me (using stack 1.0.2; I gave up trying to make 1.0.3 build)!
Two things I noticed:
nix-shell spent a while fetching haskell.compiler.ghc801 from the binary cache, indicating that it's not the same version I was using. Also, this GHC reports its version as 8.0.1, whereas the GHC in haskell.packages.ghc801 reports itself as 8.0.0.20160204. Since Stack was complaining about that version not matching the required 8.0.1, this may have been the root cause; maybe my ~/.nixpkgs/config.nix is overriding the ghc801 package set (I've not noticed this before since I've been sticking with 7.10.3 until some libraries I use become compatible).
In case it helps anyone else, here is the command output I got:
```
$ nix-shell -p stack -p haskell.compiler.ghc801
these paths will be fetched (77.76 MiB download, 952.66 MiB unpacked):
/nix/store/1m6ly5q3zhkvlab24d6yd0djw99jg66d-ghc-8.0.1-doc
/nix/store/388plmhly1p1x1wi9w9g6kr1vjdbm0wv-ghc-8.0.1
/nix/store/f36r2fhf1d0xb1cz4i69s2zcc3l799hn-ncurses-6.0-dev
/nix/store/i41cj362nx4ckhg5ihc1sg3cxavc939w-ncurses-6.0-man
/nix/store/w91l5i2m3ndw7l873ax2zmckb0cw89ws-gmp-6.1.1-dev
fetching path ‘/nix/store/1m6ly5q3zhkvlab24d6yd0djw99jg66d-ghc-8.0.1-doc’...
fetching path ‘/nix/store/i41cj362nx4ckhg5ihc1sg3cxavc939w-ncurses-6.0-man’...
* Downloading ‘https://cache.nixos.org/nar/1lxf7izgffmxz45bpig4lr1rj4hpp4ya6b9h6bzfajx8wqyhchy9.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/i41cj362nx4ckhg5ihc1sg3cxavc939w-ncurses-6.0-man’...
* Downloading ‘https://cache.nixos.org/nar/1qjib4rm3v0ifqx6v41lwi3abva2if0v1l7jdjk0qs4lcq10sjsc.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/1m6ly5q3zhkvlab24d6yd0djw99jg66d-ghc-8.0.1-doc’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 78168 100 78168 0 0 97562 0 --:--:-- --:--:-- --:--:-- 97832
fetching path ‘/nix/store/w91l5i2m3ndw7l873ax2zmckb0cw89ws-gmp-6.1.1-dev’...
* Downloading ‘https://cache.nixos.org/nar/1f2nr0rl6dxcvy57z5m8gynjc92g93jbz2vc8410rb34spm9wmbj.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/w91l5i2m3ndw7l873ax2zmckb0cw89ws-gmp-6.1.1-dev’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 26400 100 26400 0 0 40887 0 --:--:-- --:--:-- --:--:-- 40866
fetching path ‘/nix/store/f36r2fhf1d0xb1cz4i69s2zcc3l799hn-ncurses-6.0-dev’...
* Downloading ‘https://cache.nixos.org/nar/0nwylvn0b722407f7yrsq71y7d8fbcv8wpxl8sw14g023xbfw2ql.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/f36r2fhf1d0xb1cz4i69s2zcc3l799hn-ncurses-6.0-dev’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 99k 100 99k 0 0 103k 0 --:--:-- --:--:-- --:--:-- 103k
100 9908k 100 9908k 0 0 705k 0 0:00:14 0:00:14 --:--:-- 766k
fetching path ‘/nix/store/388plmhly1p1x1wi9w9g6kr1vjdbm0wv-ghc-8.0.1’...
* Downloading ‘https://cache.nixos.org/nar/099h8yw796yx5a60sz07ih2igazbsv590hwzc0srv600qrijiar6.nar.xz’ (signed by ‘cache.nixos.org-1’) to ‘/nix/store/388plmhly1p1x1wi9w9g6kr1vjdbm0wv-ghc-8.0.1’...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 67.8M 100 67.8M 0 0 752k 0 0:01:32 0:01:32 --:--:-- 753k
[nix-shell:~/DELETEME/tip/tools]$ stack --version
Version 1.0.2 i386
[nix-shell:~/DELETEME/tip/tools]$ stack config --system-ghc set system-ghc --global true
stack: parse stack config set field: only set resolver is implemented
[nix-shell:~/DELETEME/tip/tools]$ stack build
[1 of 1] Compiling Main ( /tmp/stack31864/Setup.hs, /tmp/stack31864/Setup.o )
Linking /home/chris/.stack/setup-exe-cache/i386-linux/tmp-setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 ...
dlist-0.8.0.2: download
dlist-0.8.0.2: configure
ansi-terminal-0.6.2.3: download
dlist-0.8.0.2: build
ansi-terminal-0.6.2.3: configure
ansi-terminal-0.6.2.3: build
dlist-0.8.0.2: copy/register
ghc-paths-0.1.0.9: download
ghc-paths-0.1.0.9: configure
ansi-terminal-0.6.2.3: copy/register
ansi-wl-pprint-0.6.7.3: download
ghc-paths-0.1.0.9: build
ansi-wl-pprint-0.6.7.3: configure
ansi-wl-pprint-0.6.7.3: build
ghc-paths-0.1.0.9: copy/register
heaps-0.3.3: download
heaps-0.3.3: configure
ansi-wl-pprint-0.6.7.3: copy/register
heaps-0.3.3: build
mtl-2.2.1: download
mtl-2.2.1: configure
mtl-2.2.1: build
heaps-0.3.3: copy/register
mtl-2.2.1: copy/register
genifunctors-0.3: configure
Fetched package index.
genifunctors-0.3: build
genifunctors-0.3: copy/register
geniplate-mirror-0.7.4: download
geniplate-mirror-0.7.4: configure
geniplate-mirror-0.7.4: build
Populated index cache.
primitive-0.6.1.0: download
primitive-0.6.1.0: configure
primitive-0.6.1.0: build
geniplate-mirror-0.7.4: copy/register
happy-1.19.5: download
happy-1.19.5: configure
primitive-0.6.1.0: copy/register
random-1.1: download
happy-1.19.5: build
random-1.1: configure
random-1.1: build
random-1.1: copy/register
reflection-2.1.2: download
reflection-2.1.2: configure
reflection-2.1.2: build
reflection-2.1.2: copy/register
safe-0.3.9: download
safe-0.3.9: configure
safe-0.3.9: build
happy-1.19.5: copy/register
safe-0.3.9: copy/register
split-0.2.3.1: download
split-0.2.3.1: configure
spoon-0.3.1: download
split-0.2.3.1: build
spoon-0.3.1: configure
spoon-0.3.1: build
split-0.2.3.1: copy/register
spoon-0.3.1: copy/register
stm-2.4.4.1: download
stm-2.4.4.1: configure
structural-induction-0.3: download
stm-2.4.4.1: build
structural-induction-0.3: configure
structural-induction-0.3: build
stm-2.4.4.1: copy/register
async-2.1.0: download
async-2.1.0: configure
structural-induction-0.3: copy/register
async-2.1.0: build
symbol-0.2.4: download
symbol-0.2.4: configure
symbol-0.2.4: build
async-2.1.0: copy/register
symbol-0.2.4: copy/register
minisat-0.1.2: download
minisat-0.1.2: configure
tagshare-0.0: download
minisat-0.1.2: build
tagshare-0.0: configure
tagshare-0.0: build
tagshare-0.0: copy/register
text-1.2.2.1: download
text-1.2.2.1: configure
text-1.2.2.1: build
minisat-0.1.2: copy/register
tf-random-0.5: download
tf-random-0.5: configure
tf-random-0.5: build
tf-random-0.5: copy/register
QuickCheck-2.8.2: download
QuickCheck-2.8.2: configure
QuickCheck-2.8.2: build
QuickCheck-2.8.2: copy/register
alex-3.1.7: download
alex-3.1.7: configure
alex-3.1.7: build
alex-3.1.7: copy/register
testing-feat-0.4.0.3: download
testing-feat-0.4.0.3: configure
testing-feat-0.4.0.3: build
testing-feat-0.4.0.3: copy/register
tip-types-0.2.2: configure
tip-types-0.2.2: build
text-1.2.2.1: copy/register
hashable-1.2.4.0: download
hashable-1.2.4.0: configure
hashable-1.2.4.0: build
hashable-1.2.4.0: copy/register
transformers-compat-0.5.1.4: download
transformers-compat-0.5.1.4: configure
transformers-compat-0.5.1.4: build
transformers-compat-0.5.1.4: copy/register
constraints-0.8: download
constraints-0.8: configure
constraints-0.8: build
constraints-0.8: copy/register
exceptions-0.8.3: download
exceptions-0.8.3: configure
exceptions-0.8.3: build
exceptions-0.8.3: copy/register
hint-0.6.0: download
hint-0.6.0: configure
hint-0.6.0: build
tip-types-0.2.2: copy/register
optparse-applicative-0.12.1.0: download
optparse-applicative-0.12.1.0: configure
optparse-applicative-0.12.1.0: build
optparse-applicative-0.12.1.0: copy/register
hint-0.6.0: copy/register
tip-prelude-0.2: configure
temporary-1.2.0.4: download
tip-prelude-0.2: build
temporary-1.2.0.4: configure
temporary-1.2.0.4: build
tip-prelude-0.2: copy/register
temporary-1.2.0.4: copy/register
uglymemo-0.1.0.1: download
uglymemo-0.1.0.1: configure
uglymemo-0.1.0.1: build
uglymemo-0.1.0.1: copy/register
jukebox-0.2.9: download
jukebox-0.2.9: configure
jukebox-0.2.9: build
jukebox-0.2.9: copy/register
twee-0.1: download
twee-0.1: configure
twee-0.1: build
twee-0.1: copy/register
quickspec-2: configure
quickspec-2: build
tip-lib-0.2.2: configure
tip-lib-0.2.2: build
quickspec-2: copy/register
tip-lib-0.2.2: copy/register
tip-ghc-0.2: configure
tip-ghc-0.2: build
tip-spec-0.1: configure
tip-spec-0.1: build
tip-spec-0.1: copy/register
tip-ghc-0.2: copy/register
Completed 42 action(s).
[nix-shell:~/DELETEME/tip/tools]$ find . -name tip
./tip-lib/.stack-work/dist/i386-linux/Cabal-1.24.0.0/build/tip
./tip-lib/.stack-work/dist/i386-linux/Cabal-1.24.0.0/build/tip/tip
./.stack-work/install/i386-linux/lts-7.7/8.0.1/bin/tip
[nix-shell:~/DELETEME/tip/tools]$ ./.stack-work/install/i386-linux/lts-7.7/8.0.1/bin/tip --help
tip - a tool for processing TIP problems
Usage: tip ([--simplify-gently] | [--simplify-aggressively] | [--remove-newtype]
| [--uncurry-theory] | [--negate-conjecture] |
[--type-skolem-conjecture] | [--int-to-nat] | [--sorts-to-nat] |
[--split-conjecture] | [--skolemise-conjecture] | [--if-to-bool-op] |
[--bool-op-to-if] | [--remove-builtin-bool] | [--bool-op-lift] |
[--add-match] | [--commute-match] | [--remove-match] |
[--collapse-equal] | [--remove-aliases] | [--lambda-lift] |
[--let-lift] | [--axiomatize-lambdas] | [--axiomatize-funcdefs] |
[--axiomatize-funcdefs2] | [--axiomatize-datadecls] |
[--axiomatize-datadecls-ueq] | [--monomorphise] |
[--monomorphise-verbose] | [--csematch] | [--csematch-why3] |
[--eliminate-dead-code] | [--make-conjecture CONJECTURE-NUMBER] |
[--select-conjecture CONJECTURE-NUMBER] |
[--proved-conjecture CONJECTURE-NUMBER] |
[--delete-conjecture CONJECTURE-NUMBER] |
[--drop-suffix SUFFIX-CHARS] | [--uniq-locals] | [--drop-attributes]
| [--induction VAR-COORD] | [--ri COORDS]) [FILENAME] ([--haskell] |
[--haskell-feat] | [--haskell-qc] | [--haskell-lazysc] |
[--haskell-lazysc-simple] | [--haskell-lazysc-depth] |
[--haskell-smten] | [--haskell-spec] | [--why] | [--smtlib] |
[--smtlib-ax-fun] | [--isabelle] | [--isabelle-explicit-forall] |
[--hipster] | [--tff] | [--waldmeister] | [--tip]) [DIRECTORY]
Transform a TIP problem
Available options:
-h,--help Show this help text
--simplify-gently Simplify the problem, trying not to increase its size
--simplify-aggressively Simplify the problem even at the cost of making it
bigger
--remove-newtype Eliminate single-constructor, single-argument
datatypes
--uncurry-theory Eliminate unnecessary use of higher-order functions
--negate-conjecture Transform the goal into a negated conjecture
--type-skolem-conjecture Skolemise the types in the conjecture
--int-to-nat Replace builtin Integer with a a unary nat datatype
nat (if only ordering is used)
--sorts-to-nat Replace abstract sorts with a unary nat datatype.
--split-conjecture Puts goals in separate theories
--skolemise-conjecture Skolemise the conjecture
--if-to-bool-op Replace if-then-else by and/or where appropriate
--bool-op-to-if Replace and/or by if-then-else
--remove-builtin-bool Replace the builtin bool with a datatype
--bool-op-lift Lift boolean operators to the top level
--add-match Transform SMTLIB-style datatype access into pattern
matching
--commute-match Eliminate matches that occur in weird positions (e.g.
as arguments to function calls)
--remove-match Replace pattern matching with SMTLIB-style datatype
access
--collapse-equal Merge functions with equal definitions
--remove-aliases Eliminate any function defined simply as f(x) = g(x)
--lambda-lift Lift lambdas to the top level
--let-lift Lift let-expressions to the top level
--axiomatize-lambdas Eliminate lambdas by axiomatisation (requires
--lambda-lift)
--axiomatize-funcdefs Transform function definitions to axioms in the most
straightforward way
--axiomatize-funcdefs2 Transform function definitions to axioms with left
hand side pattern matching instead of match
--axiomatize-datadecls Transform data declarations to axioms
--axiomatize-datadecls-ueq
Transform data declarations to unit equality axioms
(incomplete)
--monomorphise Try to monomorphise the problem
--monomorphise-verbose Try to monomorphise the problem verbosely
--csematch Perform CSE on match scrutinees
--csematch-why3 Aggressively perform CSE on match scrutinees (helps
Why3's termination checker)
--eliminate-dead-code Dead code elimination (doesn't work on dead recursive
functions)
--make-conjecture CONJECTURE-NUMBER
Make an assert into an assert-not
--select-conjecture CONJECTURE-NUMBER
Choose a particular conjecture from the problem
--proved-conjecture CONJECTURE-NUMBER
Mark a particular conjecture as proved
--delete-conjecture CONJECTURE-NUMBER
Delete a particular conjecture
--drop-suffix SUFFIX-CHARS
Drop the suffix delimited by some character set
--uniq-locals Make all local variables unique
--drop-attributes Remove all attributes (e.g. :original-name) from
declarations
--induction VAR-COORD Perform induction on the variable coordinates
--ri COORDS Perform recursion induction
--haskell Haskell output
--haskell-feat Haskell output with Feat tests
--haskell-qc Haskell output with QuickCheck tests (Feat
generators)
--haskell-lazysc Haskell output with LazySmallCheck tests
--haskell-lazysc-simple Haskell output with LazySmallCheck tests, with
parallel operators only in the property
--haskell-lazysc-depth Haskell output with LazySmallCheck tests up to some
depth (given on command line)
--haskell-smten Haskell output with Smten (depth given on command
line)
--haskell-spec Haskell output with QuickSpec signature (Feat
generators)
--why WhyML output
--smtlib SMTLIB output
--smtlib-ax-fun SMTLIB output (axiomatise function declarations)
--isabelle Isabelle output
--isabelle-explicit-forall
Isabelle output (with variables explicitly forall
quantified)
--hipster Only conjectrures, in Isabelle format. For internal
use in Hipster.
--tff TPTP TFF output
--waldmeister Waldmeister output
--tip TIP output (default)
I gave up trying to make
stack-1.0.3build
Running nix-env -f "<nixpkgs>" -iA stack will give you stack version 1.2.0 on nixos-16.09 and version 1.3.0 on nixos-unstable. I'd be hugely surprised if installing any of those packages would pose problems since we regularly test that they compile successfully and I haven't seen any errors.
The GHC [I was using] reports its version as 8.0.1, whereas the GHC in haskell.packages.ghc801 reports itself as 8.0.0.20160204.
That's not supposed to happen. IMHO, all conceivable names for "ghc8" refer to exactly the same expression on recent versions of Nixpkgs:
nixos-unstable a.k.a. master branch from git:
nix-repl> haskell.packages.ghc801.ghc
«derivation /nix/store/6yygmblpr6r964p5rmljb8n2kmsp54cw-ghc-8.0.1.drv»
nix-repl> haskell.compiler.ghc801
«derivation /nix/store/6yygmblpr6r964p5rmljb8n2kmsp54cw-ghc-8.0.1.drv»
nix-repl> haskellPackages.ghc
«derivation /nix/store/6yygmblpr6r964p5rmljb8n2kmsp54cw-ghc-8.0.1.drv»
nixos-16.09:
nix-repl> haskell.packages.ghc801.ghc
«derivation /nix/store/7xfxkxlbmznv9lbr50ani06mzswx5iqz-ghc-8.0.1.drv»
nix-repl> haskell.compiler.ghc801
«derivation /nix/store/7xfxkxlbmznv9lbr50ani06mzswx5iqz-ghc-8.0.1.drv»
nix-repl> haskellPackages.ghc
«derivation /nix/store/7xfxkxlbmznv9lbr50ani06mzswx5iqz-ghc-8.0.1.drv»
If you get different versions on your machine, then you have probably configure something strange in your ~/.nixpkgs/config.nix file (or elsewhere).
Running nix-env -f "
" -iA stack will give you stack version 1.2.0 on nixos-16.09 and version 1.3.0 on nixos-unstable. I'd be hugely surprised if installing any of those packages would pose problems since we regularly test that they compile successfully and I haven't seen any errors.
@peti Those packages are fine and build painlessly, I've got nothing but praise for nixpkgs. Both seem to give me stack 1.0.2 though; maybe I've not upgraded the unstable channel for a while?
It was stack 1.0.3 that I gave up on, after overriding nixpkg's definition to point to the 1.0.3 git commit. After several rounds of adding dependencies, rebuilding for half an hour and being told to add more dependencies, I gave up :P
IMHO, all conceivable names for "ghc8" refer to exactly the same expression on recent versions of Nixpkgs... If you get different versions on your machine, then you have probably configure something strange in your ~/.nixpkgs/config.nix file (or elsewhere).
My ~/.nixpkgs/config.nix is certainly very strange; I have a whole repo to manage it at https://github.com/Warbo/nix-config ;) As far as Haskell goes, I've got package sets for both 16.09 and unstable, as well as a bunch of package overrides, but nowhere have I overriden GHC.
Maybe there are relics of 16.03 lurking around, since I used to pin everything to that for reproducibility, before switching to 16.09.
I've also run into this issue quite a few times. It's difficult to understand what exactly is going wrong whether it's stack / nix / ghc.
Is this issue being discussed anywhere else?
What worked (at least for stack build) for me was using this answer https://github.com/commercialhaskell/stack/issues/826#issuecomment-267664043 (thank you @chris-martin !) though when I tried to use this 'package' in my nixos configuration I ran into the same issue.
What also worked for me was (within stack.yaml):
nix:
enable: true
packages:
- pkgconfig
- autoconf
- gcc
Most helpful comment
@Warbo, I can compile https://github.com/tip-org/tools with Nix using the following commands:
~$ nix-shell -p stack -p haskell.compiler.ghc801
[nix-shell:/tmp/tools]$ stack config --system-ghc set system-ghc --global true
[nix-shell:/tmp/tools]$ stack build
~