nh2 / static-haskell-nix

easily build most Haskell programs into fully static Linux executables
388 stars 36 forks source link

cabal2nix regression-tests fail for empty cabal project on macOS #18

Closed clojurians-org closed 5 years ago

clojurians-org commented 5 years ago

i use [nix-shell -p cabal-install --run 'cabal new-repl'] create a empty project on MacOS. when i run nix-build, the cabal2nix regression-tests failed! i have no idea how to skip it.

{ pkgs ? import (builtins.fetchTarball {url="https://github.com/NixOS/nixpkgs/archive/2c07921cff84dfb0b9e0f6c2d10ee2bfee6a85ac.tar.gz";}) {}} :

with pkgs;
let
  haskellPackages = pkgs.haskellPackages.override {
    overrides = self: super: {
      # clntsh = oracle-instantclient ;
      cabal2nix = dontCheck super.cabal2nix ;
    } ;
  } ;
  pkg = haskellPackages.developPackage {
    root = ./.;

    modifier = drv: haskell.lib.overrideCabal drv (attrs: {
      buildTools = (attrs.buildTools or []) ++ [haskellPackages.cabal-install haskellPackages.c2hs] ;
      # librarySystemDepends = [ odpic ] ;
    }) ;

  } ;
  # buildInputs = [ oracle-instantclient ] ;
  buildInputs = [ ] ;
in pkg.overrideAttrs(attrs: {
  buildInputs = attrs.buildInputs ++ buildInputs ;
})
Preprocessing test suite 'regression-test' for cabal2nix-2.9.3..
Building test suite 'regression-test' for cabal2nix-2.9.3..
[1 of 1] Compiling Main             ( test/Main.hs, dist/build/regression-test/regression-test-tmp/Main.o )
Linking dist/build/regression-test/regression-test ...
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
clang-5.0: warning: argument unused during compilation: '-nopie' [-Wunused-command-line-argument]
running tests
Running 1 test suites...
Test suite regression-test: RUNNING...
regression-tests
  cabal2nix library

    test/golden-test-cases/crypt-sha512.nix:                        FAIL (0.04s)
      --- test/golden-test-cases/crypt-sha512.nix.golden        2018-07-10 13:29:51.000000000 +0000
      +++ test/golden-test-cases/crypt-sha512.nix       2019-05-07 15:13:18.000000000 +0000
      @@ -1,6 +1,5 @@
       { mkDerivation, attoparsec, base, bytestring, cryptohash-sha512
      -, quickcheck-instances, stdenv, tasty, tasty-hunit
      -, tasty-quickcheck
      +, stdenv
       }:
       mkDerivation {
         pname = "crypt-sha512";
      @@ -9,10 +8,6 @@
         libraryHaskellDepends = [
           attoparsec base bytestring cryptohash-sha512
         ];
      -  testHaskellDepends = [
      -    base bytestring quickcheck-instances tasty tasty-hunit
      -    tasty-quickcheck
      -  ];
         homepage = "https://github.com/phadej/crypt-sha512";
         description = "Pure Haskell implelementation for GNU SHA512 crypt algorithm";
         license = stdenv.lib.licenses.bsd3;

    test/golden-test-cases/gl.nix:                                  FAIL (0.06s)
      --- test/golden-test-cases/gl.nix.golden  2018-07-10 13:29:51.000000000 +0000
      +++ test/golden-test-cases/gl.nix 2019-05-07 15:13:20.000000000 +0000
      @@ -1,5 +1,5 @@
       { mkDerivation, base, Cabal, containers, directory, filepath, fixed
      -, half, hxt, libGL, stdenv, transformers
      +, half, hxt, stdenv, transformers
       }:
       mkDerivation {
         pname = "gl";
      @@ -11,7 +11,6 @@
         libraryHaskellDepends = [
           base containers fixed half transformers
         ];
      -  librarySystemDepends = [ libGL ];
         description = "Complete OpenGL raw bindings";
         license = stdenv.lib.licenses.bsd3;
       }

    test/golden-test-cases/iconv.nix:                               FAIL (0.03s)
      --- test/golden-test-cases/iconv.nix.golden       2018-07-10 13:29:51.000000000 +0000
      +++ test/golden-test-cases/iconv.nix      2019-05-07 15:13:21.000000000 +0000
      @@ -1,9 +1,10 @@
      -{ mkDerivation, base, bytestring, stdenv }:
      +{ mkDerivation, base, bytestring, iconv, stdenv }:
       mkDerivation {
         pname = "iconv";
         version = "0.4.1.3";
         sha256 = "deadbeef";
         libraryHaskellDepends = [ base bytestring ];
      +  librarySystemDepends = [ iconv ];
         description = "String encoding conversion";
         license = stdenv.lib.licenses.bsd3;
       }

3 out of 702 tests failed (14.52s)
Test suite regression-test: FAIL
Test suite logged to: dist/test/cabal2nix-2.9.3-regression-test.log
0 of 1 test suites (0 of 1 test cases) passed.
builder for '/nix/store/7d6n51wpnhfrzplrwvf5j6idpy4fwcrf-cabal2nix-2.9.3.drv' failed with exit code 1
cannot build derivation '/nix/store/53rcfnw0llxqnbf4avhqr352ymwn66n3-cabal2nix-static-build.drv': 1 dependencies couldn't be built
error: build of '/nix/store/53rcfnw0llxqnbf4avhqr352ymwn66n3-cabal2nix-static-build.drv' failed
nh2 commented 5 years ago

@clojurians-org I am a bit confused.

What project are you trying to build statically, cabal2nix itself?

clojurians-org commented 5 years ago

i just build a cabal init project to try the static-haskll-nix nixpkgs, but it seems build cabal2nix automatically on MAC.

clojurians-org commented 5 years ago
unpacking 'https://github.com/NixOS/nixpkgs/archive/88ae8f7d.tar.gz'...
error: Musl libc only supports Linux systems.
(use '--show-trace' to show detailed location information)