Nixpkgs: stack_1_2_0 fails to build on OSX

Created on 25 Sep 2016  Â·  13Comments  Â·  Source: NixOS/nixpkgs

Issue description

Trying to build stack v1.2.0 from nixpkgs/master results in the following error.

Building stack-1.2.0...
Preprocessing library stack-1.2.0...
[ 1 of 96] Compiling Text.PrettyPrint.Leijen.Extended ( src/Text/PrettyPrint/Leijen/Extended.hs, dist/build/Text/PrettyPrint/Leijen/Extended.o )
[ 2 of 96] Compiling Stack.Ghci.Script ( src/Stack/Ghci/Script.hs, dist/build/Stack/Ghci/Script.o )
[ 3 of 96] Compiling Stack.FileWatch  ( src/Stack/FileWatch.hs, dist/build/Stack/FileWatch.o )
[ 4 of 96] Compiling System.Process.PagerEditor ( src/System/Process/PagerEditor.hs, dist/build/System/Process/PagerEditor.o )
[ 5 of 96] Compiling System.Process.Log ( src/System/Process/Log.hs, dist/build/System/Process/Log.o )
[ 6 of 96] Compiling Paths_stack      ( dist/build/autogen/Paths_stack.hs, dist/build/Paths_stack.o )
[ 7 of 96] Compiling Path.Find        ( src/Path/Find.hs, dist/build/Path/Find.o )
[ 8 of 96] Compiling Path.Extra       ( src/Path/Extra.hs, dist/build/Path/Extra.o )
[ 9 of 96] Compiling System.Process.Read ( src/System/Process/Read.hs, dist/build/System/Process/Read.o )
[10 of 96] Compiling System.Process.Run ( src/System/Process/Run.hs, dist/build/System/Process/Run.o )
[11 of 96] Compiling Options.Applicative.Complicated ( src/Options/Applicative/Complicated.hs, dist/build/Options/Applicative/Complicated.o )

src/Options/Applicative/Complicated.hs:145:31: error:
    • Couldn't match expected type ‘(t, t1, t2)’
                  with actual type ‘([String], String -> Maybe (ParserInfo a))’
    • In the expression: mkCommand m
      In a pattern binding: (groupName, cmds, subs) = mkCommand m
      In an equation for ‘hsubparser'’:
          hsubparser' m
            = mkParser d g rdr
            where
                Mod _ d g = metavar "COMMAND|FILE" `mappend` m
                (groupName, cmds, subs) = mkCommand m
                rdr = CmdReader groupName cmds (fmap add_helper . subs)
                add_helper pinfo
                  = pinfo {infoParser = infoParser pinfo <**> helpOption}
    • Relevant bindings include
        groupName :: t
          (bound at src/Options/Applicative/Complicated.hs:145:6)
        cmds :: t1 (bound at src/Options/Applicative/Complicated.hs:145:17)
        subs :: t2 (bound at src/Options/Applicative/Complicated.hs:145:23)
        m :: Mod CommandFields a
          (bound at src/Options/Applicative/Complicated.hs:142:13)
        hsubparser' :: Mod CommandFields a -> Parser a
          (bound at src/Options/Applicative/Complicated.hs:142:1)

src/Options/Applicative/Complicated.hs:146:11: error:
    • Couldn't match expected type ‘(a1 -> f0 (ParserInfo a2)) -> t’
                  with actual type ‘OptReader a0’
    • The function ‘CmdReader’ is applied to three arguments,
      but its type ‘[String]
                    -> (String -> Maybe (ParserInfo a0)) -> OptReader a0’
      has only two
      In the expression:
        CmdReader groupName cmds (fmap add_helper . subs)
      In an equation for ‘rdr’:
          rdr = CmdReader groupName cmds (fmap add_helper . subs)
    • Relevant bindings include
        rdr :: t (bound at src/Options/Applicative/Complicated.hs:146:5)
builder for ‘/nix/store/vc08sacfgc4nrpcbgdpg5rawdiq28ib6-stack-1.2.0.drv’ failed with exit code 1
error: build of ‘/nix/store/vc08sacfgc4nrpcbgdpg5rawdiq28ib6-stack-1.2.0.drv’ failed

Steps to reproduce

$ git clone https://github.com/nixos/nixpkgs
$ cd nixpkgs
$ nix-env -f . -iA haskellPackages.stack_1_2_0

Technical details

  • System: OS X 10.11.6 (darwin-15.6.0)
  • Nix version: nix-env (Nix) 1.11.3
  • Nixpkgs version: commit: 912e26b
bug darwin haskell

Most helpful comment

Stack 1.2 fixes Nix integration to the point where Intero FINALLY WORKS - so getting this build working will be a huge win!

All 13 comments

Possibly related to https://github.com/commercialhaskell/stack/issues/2629 ? (I provide a workaround in this comment)

Stack 1.2 fixes Nix integration to the point where Intero FINALLY WORKS - so getting this build working will be a huge win!

It would be nice to get this fix into the nixos stable channel for 16.09. stack just fails and the user is forced to use the unstable channel.
I guest the issue is known but I don't know if it is just a matter of waiting a few days.

Is the darwin fix already in master?

(closed by accident)

(triage) stack builds fine on NixOS for both master and nixos-16.09. (It didn't previously.)

Can someone re-test this on Darwin? Is there any issue left?

I'm on unstable (I think) & I receive the same error.

Side note: I did get stack-1.2.0 built but I used stack 1.1.2 to build it from source (so it is possible)


$ nix-channel --list
nixpkgs https://nixos.org/channels/nixos-unstable

nixos-unstable is currently 10 days old. (http://howoldis.herokuapp.com/)

I have verified it compiles on master, it will be available once channel updates.

It is already part of 16.09: http://hydra.nixos.org/job/nixos/release-16.09/nixpkgs.stack.x86_64-linux

Oh, ON DARWIN :)

I'm on nixos, and stack also fails to build for me (says there's a patch but doesn't actually give me the option to apply it)

[zach@nixos:~/dotfiles]$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable

[zach@nixos:~/dotfiles]$ nixos-version
16.09.663.3dc0897 (Flounder)

[zach@nixos:~/dotfiles]$ nix-env -i stack
warning: there are multiple derivations named ‘stack-1.2.0’; using the first one
installing ‘stack-1.2.0’
these derivations will be built:
  /nix/store/4wpcdqf6r6ipiapms4n3ci16m0af3w9d-stack-1.2.0.drv
building path(s) ‘/nix/store/l1qhaq97gsz135j4qx600cif4ixk33wq-stack-1.2.0’
setupCompilerEnvironmentPhase
Build with /nix/store/r6n3qv0cyjsz8pcb4xdllssddgbk6s88-ghc-8.0.1.
unpacking sources
unpacking source archive /nix/store/cgzmpfhlh2mrlypzsmzv6ha9xwbmfh59-stack-1.2.0.tar.gz
source root is stack-1.2.0
setting SOURCE_DATE_EPOCH to timestamp 1473985085 of file stack-1.2.0/stack.cabal
patching sources
applying patch /nix/store/23b89m9jr23yk8d30w2n6g5xida7hx39-7f7f1a5f67f4ecdd1f3009495f1ff101dd38047e.patch
patching file src/Stack/Ghci.hs
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/Stack/Ghci.hs.rej
builder for ‘/nix/store/4wpcdqf6r6ipiapms4n3ci16m0af3w9d-stack-1.2.0.drv’ failed with exit code 1
error: build of ‘/nix/store/4wpcdqf6r6ipiapms4n3ci16m0af3w9d-stack-1.2.0.drv’ failed

This was fixed by 56ea4f809829bab879ac6e97fe56d061f21ed195:

latitude:~/.nix-defexpr$ git checkout master 
Already on 'master'
Your branch is up-to-date with 'origin/master'.
latitude:~/.nix-defexpr$ git pull 
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 11 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (11/11), done.
From github.com:NixOS/nixpkgs
   0746040..5c3a6d6  master     -> origin/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to 5c3a6d6802548418539c912a27323d795f33efb0.
latitude:~/.nix-defexpr$ nix-build --no-out-link ~/.nix-defexpr -A stack
these paths will be fetched (0.00 MiB download, 19.65 MiB unpacked):
  /nix/store/jhll8q2fvzannxkxfsw8whgn3mfh1jr5-stack-1.2.0
fetching path ‘/nix/store/jhll8q2fvzannxkxfsw8whgn3mfh1jr5-stack-1.2.0’...

*** Downloading ‘http://hydra.cryp.to/nar/jhll8q2fvzannxkxfsw8whgn3mfh1jr5-stack-1.2.0’ (signed by ‘hydra.cryp.to-1’) to ‘/nix/store/jhll8q2fvzannxkxfsw8whgn3mfh1jr5-stack-1.2.0’...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4187k    0 4187k    0     0   607k      0 --:--:--  0:00:06 --:--:--  770k

/nix/store/jhll8q2fvzannxkxfsw8whgn3mfh1jr5-stack-1.2.0
Was this page helpful?
0 / 5 - 0 ratings

Related issues

vaibhavsagar picture vaibhavsagar  Â·  3Comments

ghost picture ghost  Â·  3Comments

teto picture teto  Â·  3Comments

chris-martin picture chris-martin  Â·  3Comments

yawnt picture yawnt  Â·  3Comments