Nixpkgs: Haskell package doesn't install properly if it has internal libraries

Created on 13 Dec 2017  路  9Comments  路  Source: NixOS/nixpkgs

https://github.com/NixOS/nixpkgs/blob/afe9649210cace6d3ee9046684d4ea27dc4fd15d/pkgs/development/haskell-modules/generic-builder.nix#L320

results in:

/nix/store/j4rqdjgf0im2dv7gycg80hplnjrnawxx-gnused-4.4/bin/sed: read error on /nix/store/wfysws2razwl13n2izzsi28w5qd7n41s-package-with-internal-lib-0.1.0.0/lib/ghc-8.2.1/package.conf.d/package-with-internal-lib-0.1.0.0.conf: Is a directory

Attempting to use the package
https://github.com/NixOS/nixpkgs/blob/afe9649210cace6d3ee9046684d4ea27dc4fd15d/pkgs/development/haskell-modules/generic-builder.nix#L228

results in:

cp: missing destination file operand after '/tmp/nix-build-test-user-0.1.0.0.drv-0/package.conf.d/'
Try 'cp --help' for more information.
haskell

Most helpful comment

@mat8913 @peti I'm actually still getting this as well, using NixOS 18.03 (unstable channel) with Haskell packages from nixpkgs master.

building '/nix/store/i6m65ln59lx4gm20pqcb4gvjx7sq3q37-cabal-helper-0.8.0.2.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2.
cp: missing destination file operand after '/tmp/nix-build-cabal-helper-0.8.0.2.drv-0/setup-package.conf.d/'
Try 'cp --help' for more information.
builder for '/nix/store/i6m65ln59lx4gm20pqcb4gvjx7sq3q37-cabal-helper-0.8.0.2.drv' failed with exit code 1

fwiw this drv contains these cp instances:

cp -f \"$p/lib/ghc-8.2.2/package.conf.d/\"*.conf $setupPackageConfDir
cp -f \"$p/lib/ghc-8.2.2/package.conf.d/\"*.conf $packageConfDir

So it seems like $packageConfDir and/or $setupPackageConfDir are unset?

All 9 comments

@mat8913 how can we reproduce it?

Here are some minimal packages that demonstrate it: https://github.com/mat8913/nix-issue-32631

I added this to my config.nix:

{
  packageOverrides = super0: let self0 = super0.pkgs; in
  {
    haskell = super0.haskell // {
      packages = super0.haskell.packages // {
        ghc821 = super0.haskell.packages.ghc821.override {
          overrides = self: super: {
            package-with-internal-lib = self.callPackage /home/matthew/nix-issue-32631/package-with-internal-lib/default.nix {};
            test-user = self.callPackage /home/matthew/nix-issue-32631/test-user/default.nix {};
          };
        };
      };
    };
  };
}

Then installed with:

nix-env -f "<nixpkgs>" -iA haskell.packages.ghc821.test-user

I believe this has been fixed a while ago.

@mat8913 @peti I'm actually still getting this as well, using NixOS 18.03 (unstable channel) with Haskell packages from nixpkgs master.

building '/nix/store/i6m65ln59lx4gm20pqcb4gvjx7sq3q37-cabal-helper-0.8.0.2.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/i2d6l6w99qlwhz6gbz4hxl4d9238drfj-ghc-8.2.2.
cp: missing destination file operand after '/tmp/nix-build-cabal-helper-0.8.0.2.drv-0/setup-package.conf.d/'
Try 'cp --help' for more information.
builder for '/nix/store/i6m65ln59lx4gm20pqcb4gvjx7sq3q37-cabal-helper-0.8.0.2.drv' failed with exit code 1

fwiw this drv contains these cp instances:

cp -f \"$p/lib/ghc-8.2.2/package.conf.d/\"*.conf $setupPackageConfDir
cp -f \"$p/lib/ghc-8.2.2/package.conf.d/\"*.conf $packageConfDir

So it seems like $packageConfDir and/or $setupPackageConfDir are unset?

Indeed on nixpkgs master (cac85f68122b1ffd77bc15c1b8eef9ec328693bf), nix-build -A haskellPackages.cabal-helper fails with the above.

I'm compiling everything to test my local fix, but I'm pretty confident it will work.

This has been fixed by 6fd5287c36c8ce2fa12efae6cf171c6e46b41e87

Was this page helpful?
0 / 5 - 0 ratings

Related issues

edolstra picture edolstra  路  3Comments

ghost picture ghost  路  3Comments

tomberek picture tomberek  路  3Comments

chris-martin picture chris-martin  路  3Comments

lverns picture lverns  路  3Comments