Skip to content

Instantly share code, notes, and snippets.

@mpickering mpickering/
Last active Aug 11, 2018

What would you like to do?
Using head.hackage

How to test your package with ghc-8.6.1

  1. Setup the binary cache -
cachix use mpickering

For only GHC

nix build -f haskellPackages.ghc

or for a shell with GHC in

nix run -f haskellPackages.ghc

For a package on Hackage

nix build -I nixpkgs= '(with import <nixpkgs> {}; haskellPackages.callHackage "haskell-src-exts" "1.20.2" {})'

For a local package

nix build -I nixpkgs= '(with import <nixpkgs> {}; haskellPackages.callCabal2nix "groups" ./groups- {})'

What do I do if my package doesn't build?

Either fix the dependencies like you would normally for a Haskell project on nix or you can contribute patches upstream to the head.hackage repo. For example:

nix build -f test.nix -I nixpkgs= 
# test.nix
with import <nixpkgs> {};                                                          
  # Disable testing of comonad                                                     
  hp = haskellPackages.extend(sel: sup: { comonad = haskell.lib.dontCheck sup.comonad; } );

This comment has been minimized.

Copy link

DanBurton commented Jul 3, 2018

I tried the "For only GHC" instructions on OSX. It failed like so:

$ cachix use mpickering
$ nix build -f haskellPackages.ghc
builder for '/nix/store/yysg9zjizqg3wd17lp1l69xx9sc9ckqh-hs-generate-overrides-0.1.drv' failed with exit code 1; last 10 log lines:
        _hs_iconv_open in libHSbase-
       (maybe you meant: _hs_iconv_open)
    "_iconv_close", referenced from:
        _hs_iconv_close in libHSbase-
       (maybe you meant: _hs_iconv_close)
    "_locale_charset", referenced from:
        _localeEncoding in libHSbase-
  ld: symbol(s) not found for architecture x86_64
  clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
  `cc' failed in phase `Linker'. (Exit code: 1)
[1 built (1 failed), 270 copied (3002.8 MiB), 357.7 MiB DL]
error: build of '/nix/store/yysg9zjizqg3wd17lp1l69xx9sc9ckqh-hs-generate-overrides-0.1.drv' failed

I'm assuming the important bit is

  ld: symbol(s) not found for architecture x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.