NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.06k stars 14.05k forks source link

Hydra serves GHC 7.8.x binaries for Darwin that contain a broken Haddock executable #2689

Closed pikajude closed 9 years ago

pikajude commented 10 years ago
$ nix-env -iAP nixpkgs.haskellPackages_ghc782.text
installing `haskell-text-ghc7.8.2-1.1.1.2-shared'
these derivations will be built:
  /nix/store/qnw5fz9al916539yvhlksfsp92ac4maq-haskell-text-ghc7.8.2-1.1.1.2-shared.drv
building path(s) `/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared'
building /nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared
unpacking sources
unpacking source archive /nix/store/2qrjpnpbmyn11prx1phr14csbfcqsfpr-text-1.1.1.2.tar.gz
source root is text-1.1.1.2
patching sources
configuring
[1 of 1] Compiling Main             ( Setup.lhs, Setup.o )
Linking Setup ...
configure flags: --disable-split-objs --disable-library-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --disable-tests 
Configuring text-1.1.1.2...
Flags chosen: integer-simple=False, developer=False
Dependency array >=0.3: using array-0.5.0.0
Dependency base >=4.2 && <5: using base-4.7.0.0
Dependency bytestring >=0.10.4.0: using bytestring-0.10.4.0
Dependency deepseq >=1.1.0.0: using deepseq-1.3.0.2
Dependency ghc-prim >=0.2: using ghc-prim-0.3.1.0
Dependency integer-gmp >=0.2: using integer-gmp-0.5.1.0
/nix/store/cd8apz7gqb4mjl0bwl352wjmqc0r4y6c-ghc-7.8.2-wrapper/bin/ghc --info
Using Cabal-1.18.1.3 compiled by ghc-7.8
Using compiler: ghc-7.8.2
Using install prefix:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared
Binaries installed in:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared/bin
Libraries installed in:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared/lib/ghc-7.8.2/text-1.1.1.2
Private binaries installed in:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared/libexec
Data files installed in:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared/share/x86_64-osx-ghc-7.8.2/text-1.1.1.2
Documentation installed in:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared/share/doc/x86_64-osx-ghc-7.8.2/text-1.1.1.2
Configuration files installed in:
/nix/store/w8da9zn87my1a7j4v4zb7gqq05miwclz-haskell-text-ghc7.8.2-1.1.1.2-shared/etc
No alex found
Using ar found on system at:
/nix/store/v0lrjkxx44x763g4qngdmgrqca6cmzdw-native-darwin-cctools-wrapper/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.8.2 found on system at:
/nix/store/v1mr14i45236202j6kzdwcjdzd7qnpdx-gcc-wrapper-4.8.2/bin/gcc
Using ghc version 7.8.2 found on system at:
/nix/store/cd8apz7gqb4mjl0bwl352wjmqc0r4y6c-ghc-7.8.2-wrapper/bin/ghc
Using ghc-pkg version 7.8.2 found on system at:
/nix/store/cd8apz7gqb4mjl0bwl352wjmqc0r4y6c-ghc-7.8.2-wrapper/bin/ghc-pkg
No greencard found
Using haddock version 0.14.0 found on system at:
/nix/store/1qjf79sk875as5h7l9zhplnvhvpicabj-ghc-7.8.2/bin/haddock
No happy found
No hmake found
Using hpc version 0.67 found on system at:
/nix/store/cd8apz7gqb4mjl0bwl352wjmqc0r4y6c-ghc-7.8.2-wrapper/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/cd8apz7gqb4mjl0bwl352wjmqc0r4y6c-ghc-7.8.2-wrapper/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at:
/nix/store/v1mr14i45236202j6kzdwcjdzd7qnpdx-gcc-wrapper-4.8.2/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
No pkg-config found
Using ranlib found on system at:
/nix/store/v0lrjkxx44x763g4qngdmgrqca6cmzdw-native-darwin-cctools-wrapper/bin/ranlib
Using strip found on system at:
/nix/store/v0lrjkxx44x763g4qngdmgrqca6cmzdw-native-darwin-cctools-wrapper/bin/strip
Using tar found on system at:
/nix/store/1bix04wrkbv5vwgkgwkmdncdcb6wkcdz-gnutar-1.27.1/bin/tar
No uhc found
building
Building text-1.1.1.2...
Preprocessing library text-1.1.1.2...
[ 1 of 43] Compiling Data.Text.Internal.Read ( Data/Text/Internal/Read.hs, dist/build/Data/Text/Internal/Read.o )
[ 2 of 43] Compiling Data.Text.Internal.Encoding.Utf32 ( Data/Text/Internal/Encoding/Utf32.hs, dist/build/Data/Text/Internal/Encoding/Utf32.o )
[ 3 of 43] Compiling Data.Text.Internal.Fusion.Size ( Data/Text/Internal/Fusion/Size.hs, dist/build/Data/Text/Internal/Fusion/Size.o )
[ 4 of 43] Compiling Data.Text.Internal.Builder.RealFloat.Functions ( Data/Text/Internal/Builder/RealFloat/Functions.hs, dist/build/Data/Text/Internal/Builder/RealFloat/Functions.o )
[ 5 of 43] Compiling Data.Text.Internal.Builder.Int.Digits ( Data/Text/Internal/Builder/Int/Digits.hs, dist/build/Data/Text/Internal/Builder/Int/Digits.o )
[ 6 of 43] Compiling Data.Text.Internal.Fusion.Types ( Data/Text/Internal/Fusion/Types.hs, dist/build/Data/Text/Internal/Fusion/Types.o )
[ 7 of 43] Compiling Data.Text.Internal.Fusion.CaseMapping ( Data/Text/Internal/Fusion/CaseMapping.hs, dist/build/Data/Text/Internal/Fusion/CaseMapping.o )
[ 8 of 43] Compiling Data.Text.Encoding.Error ( Data/Text/Encoding/Error.hs, dist/build/Data/Text/Encoding/Error.o )
[ 9 of 43] Compiling Data.Text.Internal.Unsafe.Shift ( Data/Text/Internal/Unsafe/Shift.hs, dist/build/Data/Text/Internal/Unsafe/Shift.o )
[10 of 43] Compiling Data.Text.Internal.Encoding.Utf16 ( Data/Text/Internal/Encoding/Utf16.hs, dist/build/Data/Text/Internal/Encoding/Utf16.o )
[11 of 43] Compiling Data.Text.Internal.Functions ( Data/Text/Internal/Functions.hs, dist/build/Data/Text/Internal/Functions.o )
[12 of 43] Compiling Data.Text.Internal.Unsafe ( Data/Text/Internal/Unsafe.hs, dist/build/Data/Text/Internal/Unsafe.o )
[13 of 43] Compiling Data.Text.Internal.Fusion.Common ( Data/Text/Internal/Fusion/Common.hs, dist/build/Data/Text/Internal/Fusion/Common.o )
[14 of 43] Compiling Data.Text.Array  ( Data/Text/Array.hs, dist/build/Data/Text/Array.o )
[15 of 43] Compiling Data.Text.Internal.Unsafe.Char ( Data/Text/Internal/Unsafe/Char.hs, dist/build/Data/Text/Internal/Unsafe/Char.o )
[16 of 43] Compiling Data.Text.Internal ( Data/Text/Internal.hs, dist/build/Data/Text/Internal.o )
[17 of 43] Compiling Data.Text.Unsafe ( Data/Text/Unsafe.hs, dist/build/Data/Text/Unsafe.o )
[18 of 43] Compiling Data.Text.Internal.Private ( Data/Text/Internal/Private.hs, dist/build/Data/Text/Internal/Private.o )
[19 of 43] Compiling Data.Text.Internal.Fusion ( Data/Text/Internal/Fusion.hs, dist/build/Data/Text/Internal/Fusion.o )
[20 of 43] Compiling Data.Text.Internal.Encoding.Fusion.Common ( Data/Text/Internal/Encoding/Fusion/Common.hs, dist/build/Data/Text/Internal/Encoding/Fusion/Common.o )
[21 of 43] Compiling Data.Text.Internal.Encoding.Utf8 ( Data/Text/Internal/Encoding/Utf8.hs, dist/build/Data/Text/Internal/Encoding/Utf8.o )
[22 of 43] Compiling Data.Text.Internal.Encoding.Fusion ( Data/Text/Internal/Encoding/Fusion.hs, dist/build/Data/Text/Internal/Encoding/Fusion.o )
[23 of 43] Compiling Data.Text.Internal.Lazy.Encoding.Fusion ( Data/Text/Internal/Lazy/Encoding/Fusion.hs, dist/build/Data/Text/Internal/Lazy/Encoding/Fusion.o )
[24 of 43] Compiling Data.Text.Internal.Search ( Data/Text/Internal/Search.hs, dist/build/Data/Text/Internal/Search.o )
[25 of 43] Compiling Data.Text        ( Data/Text.hs, dist/build/Data/Text.o )
[26 of 43] Compiling Data.Text.Encoding ( Data/Text/Encoding.hs, dist/build/Data/Text/Encoding.o )
[27 of 43] Compiling Data.Text.Foreign ( Data/Text/Foreign.hs, dist/build/Data/Text/Foreign.o )
[28 of 43] Compiling Data.Text.Internal.IO ( Data/Text/Internal/IO.hs, dist/build/Data/Text/Internal/IO.o )
[29 of 43] Compiling Data.Text.IO     ( Data/Text/IO.hs, dist/build/Data/Text/IO.o )
[30 of 43] Compiling Data.Text.Internal.Lazy ( Data/Text/Internal/Lazy.hs, dist/build/Data/Text/Internal/Lazy.o )
[31 of 43] Compiling Data.Text.Internal.Lazy.Fusion ( Data/Text/Internal/Lazy/Fusion.hs, dist/build/Data/Text/Internal/Lazy/Fusion.o )
[32 of 43] Compiling Data.Text.Internal.Lazy.Search ( Data/Text/Internal/Lazy/Search.hs, dist/build/Data/Text/Internal/Lazy/Search.o )
[33 of 43] Compiling Data.Text.Lazy.Internal ( Data/Text/Lazy/Internal.hs, dist/build/Data/Text/Lazy/Internal.o )
[34 of 43] Compiling Data.Text.Lazy   ( Data/Text/Lazy.hs, dist/build/Data/Text/Lazy.o )
[35 of 43] Compiling Data.Text.Internal.Builder ( Data/Text/Internal/Builder.hs, dist/build/Data/Text/Internal/Builder.o )
[36 of 43] Compiling Data.Text.Lazy.Builder ( Data/Text/Lazy/Builder.hs, dist/build/Data/Text/Lazy/Builder.o )
[37 of 43] Compiling Data.Text.Internal.Builder.Functions ( Data/Text/Internal/Builder/Functions.hs, dist/build/Data/Text/Internal/Builder/Functions.o )
[38 of 43] Compiling Data.Text.Lazy.Builder.Int ( Data/Text/Lazy/Builder/Int.hs, dist/build/Data/Text/Lazy/Builder/Int.o )
[39 of 43] Compiling Data.Text.Lazy.IO ( Data/Text/Lazy/IO.hs, dist/build/Data/Text/Lazy/IO.o )
[40 of 43] Compiling Data.Text.Lazy.Read ( Data/Text/Lazy/Read.hs, dist/build/Data/Text/Lazy/Read.o )
[41 of 43] Compiling Data.Text.Lazy.Builder.RealFloat ( Data/Text/Lazy/Builder/RealFloat.hs, dist/build/Data/Text/Lazy/Builder/RealFloat.o )
[42 of 43] Compiling Data.Text.Lazy.Encoding ( Data/Text/Lazy/Encoding.hs, dist/build/Data/Text/Lazy/Encoding.o )
[43 of 43] Compiling Data.Text.Read   ( Data/Text/Read.hs, dist/build/Data/Text/Read.o )
In-place registering text-1.1.1.2...
Running Haddock for text-1.1.1.2...
Preprocessing library text-1.1.1.2...
haddock: unrecognized option `--package=text-1.1.1.2'
unrecognized option `--verbose'
Usage: haddock [OPTION...] file...

  -B DIR                                         path to a GHC lib dir, to override the default path
  -o DIR        --odir=DIR                       directory in which to put the output files
  -l DIR        --lib=DIR                        location of Haddock's auxiliary files
  -i FILE       --read-interface=FILE            read an interface from FILE
  -D FILE       --dump-interface=FILE            write the resulting interface to FILE
  -h            --html                           output in HTML (XHTML 1.0)
                --latex                          use experimental LaTeX rendering
                --latex-style=FILE               provide your own LaTeX style in FILE
  -U            --use-unicode                    use Unicode in HTML output
                --hoogle                         output for Hoogle
                --source-base=URL                URL for a source code link on the contents
                                                 and index pages
  -s URL        --source-module=URL              URL for a source code link for each module
                                                 (using the %{FILE} or %{MODULE} vars)
                --source-entity=URL              URL for a source code link for each entity
                                                 (using the %{FILE}, %{MODULE}, %{NAME},
                                                 %{KIND} or %{LINE} vars)
                --source-entity-line=URL         URL for a source code link for each entity.
                                                 Used if name links are unavailable, eg. for TH splices.
                --comments-base=URL              URL for a comments link on the contents
                                                 and index pages
                --comments-module=URL            URL for a comments link for each module
                                                 (using the %{MODULE} var)
                --comments-entity=URL            URL for a comments link for each entity
                                                 (using the %{FILE}, %{MODULE}, %{NAME},
                                                 %{KIND} or %{LINE} vars)
  -c PATH       --css=PATH, --theme=PATH         the CSS file or theme directory to use for HTML output
                --built-in-themes                include all the built-in haddock themes
  -p FILE       --prologue=FILE                  file containing prologue text
  -t TITLE      --title=TITLE                    page heading
  -q QUAL       --qual=QUAL                      qualification of names, one of 
                                                 'none' (default), 'full', 'local'
                                                 'relative' or 'aliased'
  -?            --help                           display this help and exit
  -V            --version                        output version information and exit
                --compatible-interface-versions  output compatible interface file versions and exit
                --interface-version              output interface file version and exit
  -v VERBOSITY  --verbosity=VERBOSITY            set verbosity level
                --use-contents=URL               use a separately-generated HTML contents page
                --gen-contents                   generate an HTML contents from specified
                                                 interfaces
                --use-index=URL                  use a separately-generated HTML index
                --gen-index                      generate an HTML index from specified
                                                 interfaces
                --ignore-all-exports             behave as if all modules have the
                                                 ignore-exports atribute
                --hide=MODULE                    behave as if MODULE has the hide attribute
                --show-extensions=MODULE         behave as if MODULE has the show-extensions attribute
                --optghc=OPTION                  option to be forwarded to GHC
                --ghc-version                    output GHC version in numeric format
                --print-ghc-path                 output path to GHC binary
                --print-ghc-libdir               output GHC lib dir
  -w            --no-warnings                    turn off all warnings
                --no-tmp-comp-dir                do not re-direct compilation output to a temporary directory
                --pretty-html                    generate html with newlines and indenting (for use with --html)
                --print-missing-docs             print information about any undocumented entities

builder for `/nix/store/qnw5fz9al916539yvhlksfsp92ac4maq-haskell-text-ghc7.8.2-1.1.1.2-shared.drv' failed with exit code 1
error: build of `/nix/store/qnw5fz9al916539yvhlksfsp92ac4maq-haskell-text-ghc7.8.2-1.1.1.2-shared.drv' failed

See Using haddock version 0.14.0 in the output, where 0.14.0 is a bit more than 2 major versions behind the most recent 2.14.2.

pikajude commented 10 years ago

To be more specific: the cached package on Hydra contains a very old haddock.

I built GHC 7.8.2 with --option use-binary-caches false to force a source build. Thankfully, it resulted in haddock 2.14, which means I can build haskell packages with it properly. Interestingly it has the same hash as the GHC installation shown in my paste above (1qjf79...). Anyone have any enlightening ideas as to why the two different builds would produce the same hash with different products?

peti commented 10 years ago

You are building on Darwin, I suppose? The Darwin stdenv is impure, i.e. builds rely on all kinds of tools and libraries that aren't packaged in Nix. As a result, Nix builds on Darwin cannot run in a chroot environment and thus are far less deterministic than builds on Linux.

pikajude commented 10 years ago

Found that out yesterday. I built GHC myself from source and it resulted in the right haddock. Still trying to figure out why. It might be worth removing the success builds on hydra since they contain the wrong contents.

On May 19, 2014, at 4:48 AM, Peter Simons notifications@github.com wrote:

You are building on Darwin, I suppose? The Darwin stdenv is impure, i.e. builds rely on all kinds of tools and libraries that aren't packaged in Nix. As a result, Nix builds on Darwin cannot run in a chroot environment and thus are far less deterministic than builds on Linux.

— Reply to this email directly or view it on GitHub.

vcunat commented 10 years ago

It looks like after 7.8.3, this causes thousands of missing binary packages on Hydra for ghc+darwin.

EDITED: looks independent of x-updates stuff.

peti commented 10 years ago

Yes, this problem is serious. Maybe @edolstra has a chance to trigger a re-build of the GHC 7.8.3 derivation on Darwin? Hopefully, that would give us a working Haddock binary.

benmos commented 10 years ago

Just a "me too" - in that I've been bitten by this (OS X 10.8.5) - and am still trying to work around it...

benmos commented 10 years ago

I ended up needing to do something like this to disable Haddock completely to get it working:

let cfg = (pkgs : {
      packageOverrides = pkgs : {

    localHaskellPackages = pkgs.haskellPackages.override {
          extension = self : super : {

        cabal = super.cabal.override {
          extension = self : super : {
            noHaddock = true;
            hyperlinkSource = false;
          };
        };

          };
        };
      };
  }); in
let pkgs = import <nixpkgs> {config = cfg;}; in
let localHaskellPackages = pkgs.localHaskellPackages; in
  cabal.mkDerivation ...
CRogers commented 10 years ago

This is still a problem with GHC 7.8.3.

alpmestan commented 10 years ago

I've just been bitten by this too. On OS X 10.9.2, just running:

$ nix-env -i cabal-install

triggers this. Got myself a 7.8.3 through nix right before running this command.

peti commented 10 years ago

@jwiegley suggested the following work-around: wipe your ghc installation and reinstall using --option build-use-substitutes false.

alpmestan commented 10 years ago

Doesn't seem to be working for me unfortunately. What do you mean by "wipe out", just nix-env -e ghc ... or also ditching ~/.ghc ?

peti commented 10 years ago

You have to remove the broken GHC package from the Nix store, i.e. by running:

nix-store --delete /nix/store/*-ghc-7.8.*

If this command refuses to do anything, you may have to add the --ignore-liveness parameter. Be sure that your system and/or user environment doesn't contain anything that depends on GHC before running with --ignore-liveness, though, because that option may break existing profiles that do depend on GHC.

alpmestan commented 10 years ago

@peti Thanks, I confirm the workaround works on my machine too.

jwiegley commented 10 years ago

After wiping out, such as by rm -fr /nix/store/*ghc*, make sure to re-install using --repair.

CRogers commented 10 years ago

Does this mean the hydra problem is fixed and we just need to redownload the new fixed package or is the build-use-substitutes just a workaround to get it working on our local machines?

vcunat commented 10 years ago

@CRogers: it's just a workaround, and Hydra binaries remain broken (I believe).

marcmo commented 10 years ago

@peti thnks! solved the issue for me too! ...it really takes ages even on a fast machine :) Quite a stumbling point for new nixpkgs users like me. would be even more satisfying to know what went wrong!

alpmestan commented 10 years ago

Well, you've built your own GHC instead of using the binary from Hydra (which has an issue), that's why it took so long :)

rrnewton commented 10 years ago

Ran into this problem as well. But I was a little bit lazier so I just rebuilt a correct haddock and spliced it into:

/nix/store/5ck4382ba8dwrbpkh8g2bqq45vd3jsrw-ghc-7.8.3/lib/ghc-7.8.3/bin

That's very un-nix like, I know... but is it worse than the above work-around?

ruedigerha commented 10 years ago

I just copied the correct binary into the store, too. I didn't have any problems so far and didn't have to wait for ages building from source.

Any hopes that this issue will be resolved soon? It's pretty serious for Haskell on Darwin with Nix.

yogsototh commented 10 years ago

Just a +1. (I also copied the binary into the store).

Debilski commented 10 years ago

How would I build a correct haddock binary, if I have a completely empty nix-pkgs environment? Or is there some correct binary available for download anywhere?

ruedigerha commented 10 years ago

I downloaded the binary distribution from haskell.org. I did a configure/make as in the INSTALL instructions, but I'm not sure if that is necessary. It won't build everything from source, so it's a lot faster than asking Nix to build from source. Then I copied that Haddock binary into the Nix store.

Debilski commented 10 years ago

Seems to work for me too. Thanks.

copumpkin commented 10 years ago

:+1: from me too

joefiorini commented 10 years ago

:+1: working for me on 10.10 DP8. The only way I could get it to work, though, was to extract the archive I downloaded from the above link, then ran ./configure --prefix=$(pwd)/built and make install. This will install to a folder called "built" in the current directory. Once that's done you'll have a haddock binary you can copy into nix.

m-a-t commented 10 years ago

I encountered the issue with the broken haddock when trying to install git-annex on Mac OS X 10.7.5. Then I tried:

nix-store --delete /nix/store/*-ghc-7.8.*
nix-env --option use-binary-caches false -i git-annex

This compiled fine for several hours, but then failed with

Preprocessing library hinotify-0.3.7...
INotify.hsc:35:25: fatal error: sys/inotify.h: No such file or directory

This is frustrating for me as a regular user. nix seemed so perfect at first, promising reproducible builds. Somehow there is a dependency which is not fulfilled, but nix never told me it wouldn't run on my system. This mess with undeclared dependencies is exactly what I hoped nix would solve!

vcunat commented 10 years ago

Reproducibility works well on pure platforms, which are currently only linux ones.

zimbatm commented 10 years ago

On 5 October 2014 12:38, m-a-t notifications@github.com wrote:

sys/inotify.h

In that case it would fail reproducibly. nix doesn't solve dependency issues automatically and inotify is a linux-only feature.

m-a-t commented 10 years ago

Sorry, the picture is not clear to me yet. If inotify is a linux-only feature, why is the package available for darwin? As the error comes up only with deactivated binary caches, there must be a binary that was successfully built. Therefore, the build-function is not pure (successful at binary cache producer, failure for me). For the moment I give up. I guess it is not easy to make a pure nix platform on darwin. But it should be easy to give more help to to end-user if an error occurs. For example: "Create a ticket at xyz." Or: "Sorry, it turned out this package doesn't work on your platform."

peti commented 10 years ago

@m-a-t, I've marked hinotify Linux-only in 972808f, so now it's no longer possible to build it on Darwin.

The Darwin build of git-annex was recently broken in Nixpkgs. I've guessed a fix in 06a62d4, but I don't have access to a Mac, so I cannot test whether it actually did the trick. If you still see build errors, please let me know.

Please note that the binary channel lags behind the master branch, so it's not uncommon for builds to succeed (or fail) in the current version of Nixpkgs even though they fail (or succeed) in the version that's distributed in binary form. If you build the package from source using the exact same version of Nixpkgs that the channel is built from, you should have the exact same binary output.

jwiegley commented 10 years ago

I have a fix for git-annex on darwin that needs to be folded into cabal2nix. Here it is:

diff --git a/pkgs/development/libraries/haskell/fsnotify/default.nix b/pkgs/development/libraries/haskell/fsnotify/default.nix
index 4db72b3..f9fef85 100644
--- a/pkgs/development/libraries/haskell/fsnotify/default.nix
+++ b/pkgs/development/libraries/haskell/fsnotify/default.nix
@@ -1,6 +1,6 @@
 # This file was auto-generated by cabal2nix. Please do NOT edit manually!

-{ cabal, async, hinotify, systemFileio, systemFilepath, tasty
+{ cabal, async, hinotify, hfsevents, systemFileio, systemFilepath, tasty
 , tastyHunit, temporaryRc, text, time
 }:

@@ -9,8 +9,8 @@ cabal.mkDerivation (self: {
   version = "0.1.0.3";
   sha256 = "0m6jyg45azk377jklgwyqrx95q174cxd5znpyh9azznkh09wq58z";
   buildDepends = [
-    async hinotify systemFileio systemFilepath text time
-  ];
+    async systemFileio systemFilepath text time
+  ] ++ (if self.stdenv.isDarwin then [ hfsevents ] else [ hinotify ]);
   testDepends = [
     async systemFileio systemFilepath tasty tastyHunit temporaryRc
   ];
    Modified   pkgs/development/libraries/haskell/hakyll/default.nix
    Modified   pkgs/stdenv/nix/default.nix
    Modified   pkgs/top-level/haskell-packages.nix
diff --git a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
index d69e84d..cf5087c 100644
--- a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
@@ -3,7 +3,7 @@
 { cabal, aeson, async, blazeBuilder, bloomfilter, bup, byteable
 , caseInsensitive, clientsession, cryptoApi, cryptohash, curl
 , dataDefault, dataenc, DAV, dbus, dlist, dns, editDistance
-, exceptions, fdoNotify, feed, filepath, git, gnupg1, gnutls
+, exceptions, fdoNotify, feed, filepath, fsnotify, git, gnupg1, gnutls
 , hamlet, hinotify, hS3, hslogger, httpClient, httpConduit
 , httpTypes, IfElse, json, lsof, MissingH, monadControl, mtl
 , network, networkInfo, networkMulticast, networkProtocolXmpp
@@ -23,16 +23,20 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [
     aeson async blazeBuilder bloomfilter byteable caseInsensitive
-    clientsession cryptoApi cryptohash dataDefault dataenc DAV dbus
-    dlist dns editDistance exceptions fdoNotify feed filepath gnutls
-    hamlet hinotify hS3 hslogger httpClient httpConduit httpTypes
+    clientsession cryptoApi cryptohash dataDefault dataenc DAV
+    dlist dns editDistance exceptions feed filepath gnutls
+    hamlet hS3 hslogger httpClient httpConduit httpTypes
     IfElse json MissingH monadControl mtl network networkInfo
     networkMulticast networkProtocolXmpp networkUri optparseApplicative
     pathPieces QuickCheck random regexTdfa SafeSemaphore securemem SHA
     shakespeare stm tasty tastyHunit tastyQuickcheck tastyRerun text
     time transformers unixCompat utf8String uuid wai waiExtra warp
     warpTls xmlTypes yesod yesodCore yesodDefault yesodForm yesodStatic
-  ];
+  ] ++ (if self.stdenv.isDarwin then [
+    fsnotify
+  ] else [
+    dbus fdoNotify hinotify
+  ]);
   buildTools = [ bup curl git gnupg1 lsof openssh perl rsync which ];
   configureFlags = "-fAssistant -fProduction";
   preConfigure = "export HOME=$TEMPDIR";
    Modified   pkgs/build-support/cabal/default.nix
    Modified   pkgs/development/libraries/haskell/conduit-extra/default.nix
    Modified   pkgs/development/libraries/haskell/fsnotify/default.nix
    Modified   pkgs/development/libraries/haskell/hakyll/default.nix
    Modified   pkgs/stdenv/nix/default.nix
    Modified   pkgs/top-level/haskell-packages.nix
jwiegley commented 10 years ago

I use to keep applying this to the git-annex and fsnotify expressions, but @peti asked me to stop doing that, and I simply haven't spent the time to learn cabal2nix well enough to maintain the changes there. This is one reason why I don't like having expression details split between nixpkgs and other projects, although I recognize that it makes maintaining zillions of Haskell packages much easier.

peti commented 10 years ago

@jwiegley, if you have the chance, could you please test whether the fix from 06a62d44fb81d61a37f5189f0274cb7a87a1bbb1 works correctly, i.e. does git-annex compile in the current master branch?

jwiegley commented 10 years ago

I've been using it against the current master branch regularly, but I will try it again tonight.

jwiegley commented 10 years ago

@peti Seems to be working fine for me.

jwiegley commented 10 years ago

@peti git-annex now breaks today with:

[310 of 470] Compiling Assistant.WebApp.Types ( Assistant/WebApp/Types.hs, dist/build/git-annex/git-annex-tmp/Assistant/WebApp/Types.o )

Assistant/WebApp/Types.hs:40:1:
    Illegal view pattern:  fromPathPiece -> Just dyn_aca4N
    Use ViewPatterns to enable view patterns

Assistant/WebApp/Types.hs:40:1:
    Illegal view pattern:  fromPathPiece -> Just dyn_aca4W
    Use ViewPatterns to enable view patterns

Assistant/WebApp/Types.hs:40:1:
    Illegal view pattern:  fromPathPiece -> Just dyn_aca52
    Use ViewPatterns to enable view patterns

Assistant/WebApp/Types.hs:40:1:
    Illegal view pattern:  fromPathPiece -> Just dyn_aca5j
    Use ViewPatterns to enable view patterns

Assistant/WebApp/Types.hs:40:1:
    Illegal view pattern:  fromPathPiece -> Just dyn_aca5l
    Use ViewPatterns to enable view patterns

Assistant/WebApp/Types.hs:40:1:
    Illegal view pattern:  fromPathPiece -> Just dyn_aca5m
    Use ViewPatterns to enable view patterns

This is brand new, even though it seems to be the same version of git-annex.

jwiegley commented 10 years ago

@peti Also, git-annex still does not refer to fsnotify, which means that the assistant will not notice changes on the filesystem.

peti commented 10 years ago

@jwiegley, git-annex refers to fsnotify at https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/haskell-packages.nix#L3181. These build errors come from the Yesod 1.4 update. Upstream is aware of them and has a fix in https://github.com/joeyh/git-annex/. The next release is going to remedy that issue.

jwiegley commented 10 years ago

Ah, ok. In the meanwhile, this patch fixes it:

--- a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
@@ -35,7 +35,12 @@ cabal.mkDerivation (self: {
   ];
   buildTools = [ bup curl git gnupg1 lsof openssh perl rsync which ];
   configureFlags = "-fAssistant -fProduction";
-  preConfigure = "export HOME=$TEMPDIR";
+  preConfigure = ''
+    sed -i 's/Extensions: PackageImports/Extensions: PackageImports, ViewPatterns/' git-annex.cabal
+    sed -i 's/{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses #-}/{-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, OverloadedStrings #-}/' Assistant/Threads/WebApp.hs
+
+    export HOME=$TEMPDIR
+  '';
   installPhase = "./Setup install";
   checkPhase = ''
jwiegley commented 10 years ago

@peti Since we're expecting a fix with the next release of git-annex, is it ok to patch the default.nix expression for git-annex directly for a fix like this?

peti commented 10 years ago

Sure, if the changes don't have to persists into the next update, it's fine to edit the expression manually.

purefn commented 10 years ago

Is this issue fixed? I was told this issue should be getting resolved soon since there is a new OS X build box and that I just needed to wait a few days, but am still having an issue. Right now I'm trying to setup a cache for my team to use, because having them all build ghc from source isn't a great option, but am not having luck getting nix to use ghc from my cache over the one on cache.nixos.org. Any idea when a fixed ghc for OS X package will appear on cache.nixos.org?

puffnfresh commented 10 years ago

@purefn I had this issue a couple of days ago, Hydra is still serving GHC with a bad Haddock.

copumpkin commented 10 years ago

Perhaps it thinks it's already done the work, so doesn't bother rebuilding it?

alpmestan commented 10 years ago

Would be nice to trigger a rebuild then?

CRogers commented 10 years ago

It's still broken for me. This issue is literally driving people away from using nix for OS X haskell development. I keep suggesting that people use nix then they run into this problem and have to spend ages rebuilding or copying over files. Eventually they just give up and do what they were doing before.

This issue also seems to be causing a number of haskell packages to fail for darwin on hydra:

http://hydra.nixos.org/build/15877320/ http://hydra.nixos.org/build/15877320/nixlog/1

Fuuzetsu commented 10 years ago

I was under the impression that the update would be enough to fix it, at least that's what joelteon said.

Couldn't we at least set doHaddock to false based on platform until this is fixed?

peti commented 10 years ago

I am not aware of any indication that the broken GHC binary for Darwin might be fixed any time soon.

jb55 commented 10 years ago

It's still broken for me. This issue is literally driving people away from using nix for OS X haskell development. I keep suggesting that people use nix then they run into this problem and have to spend ages rebuilding or copying over files. Eventually they just give up and do what they were doing before.

Yeah I decided to give Nix a go yesterday and I this was the first thing I ran into, couldn't get it working. Think I'll stick with cabal sandboxes for now.