stack2nix icon indicating copy to clipboard operation
stack2nix copied to clipboard

Getting "anonymous function called without required argument 'CoreServices'" when following nix installation instructions.

Open fghibellini opened this issue 5 years ago • 6 comments

when I run nix-build in the project root I get:

error: anonymous function at /Users/<user>/code/stack2nix/stack2nix.nix:15630:10 called without required argument 'CoreServices', at /nix/store/ydnxlkpdy47jffbb9sim11hb43xjrnhr-872502aa56bd4d574fcfe9cfef9066c9e8ee2894.tar.gz-unpacked/pkgs/development/haskell-modules/make-package-set.nix:87:27
(use '--show-trace' to show detailed location information)

System:

macOS High Sierra

> nix-build --version
nix-build (Nix) 2.1.3

fghibellini avatar Mar 28 '19 14:03 fghibellini

Seem to run into a similar issue:

1417:10 called without required argument 'Win32', at /nix/store/64ifnp2lmldnvc1wvxyav8r5lh55nzgk-nixos-18.09.2474.222950952f1/nixos/pkgs/development/haskell-modules/make-package-set.nix:87:27

Where the relevant line refers to:

"Win32-notify" = callPackage
  ({ mkDerivation, base, containers, directory, stdenv, Win32 }:
   mkDerivation {
     pname = "Win32-notify";
     version = "0.3.0.3";
     sha256 = "0c21dbe06cb1ce3b3e5f1aace0b7ee359b36e7cb057f8fe2c28c943150044116";
     isLibrary = true;
     isExecutable = true;
     libraryHaskellDepends = [ base containers directory Win32 ];
     doHaddock = false;
     doCheck = false;
     description = "A binding to part of the Win32 library for file notification";
     license = stdenv.lib.licenses.bsd3;
   }) {};

chrissound avatar Apr 08 '19 10:04 chrissound

These are all overrides that need to be specified manually. Should add a doc section how it's done.

domenkozar avatar Apr 09 '19 02:04 domenkozar

I think it is going to be similar to what is described here: https://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages (which is how cabal2nix is used)?

chrissound avatar Jun 29 '19 16:06 chrissound

I've seen the following which looks like a stack2nix bug to me?

      "hfsevents" = callPackage
        ({ mkDerivation, base, bytestring, cereal, Cocoa, CoreServices, mtl
         , stdenv, text, unix
         }:
         mkDerivation {
           pname = "hfsevents";
           version = "0.1.6";
           sha256 = "74c3f3f3a5e55fff320c352a2d481069ff915860a0ab970864c6a0e6b65d3f05";
           libraryHaskellDepends = [ base bytestring cereal mtl text unix ];
           librarySystemDepends = [ Cocoa ];
           libraryToolDepends = [ CoreServices ];
           doHaddock = false;
           doCheck = false;
           homepage = "http://github.com/luite/hfsevents";
           description = "File/folder watching for OS X";
           license = stdenv.lib.licenses.bsd3;
           platforms = [ "x86_64-darwin" ];
         }) {inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;};

If I add CoreServices to the last line inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa CoreServices; it builds correctly, it seems that stack2nix is ignoring the requirement of libraryToolDepends?

shmish111 avatar Jul 11 '19 15:07 shmish111

+1, doesn't build on OS X :/.

mavenraven avatar Aug 18 '19 23:08 mavenraven

+1 @shmish111's fix works for me.

nuttycom avatar Jan 15 '20 01:01 nuttycom