{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/6390","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/6390/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/6390/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/6390/events","html_url":"https://github.com/NixOS/nixpkgs/issues/6390","id":57896634,"number":6390,"title":"installed ghc-7.8.4 on MacOSX Yosemite but then cabal install fails with \"fatal error: 'math.h' file not found\"","user":{"login":"NickAger","id":475870,"avatar_url":"https://avatars.githubusercontent.com/u/475870?v=3","gravatar_id":"","url":"https://api.github.com/users/NickAger","html_url":"https://github.com/NickAger","followers_url":"https://api.github.com/users/NickAger/followers","following_url":"https://api.github.com/users/NickAger/following{/other_user}","gists_url":"https://api.github.com/users/NickAger/gists{/gist_id}","starred_url":"https://api.github.com/users/NickAger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickAger/subscriptions","organizations_url":"https://api.github.com/users/NickAger/orgs","repos_url":"https://api.github.com/users/NickAger/repos","events_url":"https://api.github.com/users/NickAger/events{/privacy}","received_events_url":"https://api.github.com/users/NickAger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/darwin","name":"darwin","color":"5319e7"},{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/haskell","name":"haskell","color":"5319e7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-02-17T08:33:10Z","updated_at":"2015-02-19T04:13:47Z","closed_at":null,"body":"I'm trying to install ghc-7.8.4 through NIX and then work with cabal to install Haskell packages. It looks like the installation doesn't leave cabal in a usable state.\r\n\r\n1) followed the instructions at:\r\nhttps://nixos.org/wiki/Nix_on_OS_X#Using_Nix_on_10.9_and_10.10\r\n```\r\n$ nix-env -i hello\r\n...\r\n$ hello\r\nHello, world!\r\n```\r\n-- all good so far!\r\n\r\n2) then install Haskell:\r\n```\r\n$ nix-env -iA nixpkgs.haskellPackages.ghc nixpkgs.haskellPackages.cabalInstall_1_20_0_6\r\n$ nix-env -iA nixpkgs.haskellPackages.haddock \r\n```\r\nagain no problem\r\n\r\n3) Then followed the instructions here:\r\nhttps://nixos.org/wiki/Haskell#Using_cabal_in_the_direct_installation_scenario\r\n>Install the standard environment into the profile that contains cabal. This is probably prefered for a profile whose main purpose is for cabal usage\r\n\r\n```\r\n$  nix-env -f \"<nixpkgs>\" -iA pkgs.stdenv\r\n```\r\nappeared to work OK.\r\n\r\n4) then tried to install some packages using cabal\r\n```\r\n$ cabal install aeson haskell-src-exts\r\nResolving dependencies...\r\nConfiguring dlist-0.7.1...\r\nConfiguring mtl-2.1.3.1...\r\nConfiguring primitive-0.5.4.0...\r\nConfiguring syb-0.4.4...\r\nConfiguring text-1.2.0.4...\r\nFailed to install dlist-0.7.1\r\nBuild log ( /Users/nickager/.cabal/logs/dlist-0.7.1.log ):\r\nFailed to install mtl-2.1.3.1\r\nBuild log ( /Users/nickager/.cabal/logs/mtl-2.1.3.1.log ):\r\nFailed to install primitive-0.5.4.0\r\nBuild log ( /Users/nickager/.cabal/logs/primitive-0.5.4.0.log ):\r\nFailed to install syb-0.4.4\r\nBuild log ( /Users/nickager/.cabal/logs/syb-0.4.4.log ):\r\nFailed to install text-1.2.0.4\r\nBuild log ( /Users/nickager/.cabal/logs/text-1.2.0.4.log ):\r\ncabal: Error: some packages failed to install:\r\naeson-0.8.0.2 depends on text-1.2.0.4 which failed to install.\r\nattoparsec-0.12.1.2 depends on text-1.2.0.4 which failed to install.\r\ncpphs-1.18.8 depends on text-1.2.0.4 which failed to install.\r\ndlist-0.7.1 failed during the configure step. The exception was:\r\nuser error (\r\nIn file included from\r\n/var/folders/lj/13hckkrj5c9bjygql9tcsn940000gn/T/ghc45306_0/ghc45306_4.c:1:0:\r\n\r\n\r\nIn file included from\r\n/nix/store/sg1y8i67c2vrqc2irydi5kyyxsf95wi2-ghc-7.8.4/lib/ghc-7.8.4/include/Rts.h:30:0:\r\n\r\n\r\n/nix/store/sg1y8i67c2vrqc2irydi5kyyxsf95wi2-ghc-7.8.4/lib/ghc-7.8.4/include/Stg.h:65:10:\r\nfatal error: 'math.h' file not found\r\n#include <math.h>\r\n^\r\n1 error generated.\r\n)\r\nhashable-1.2.3.1 depends on text-1.2.0.4 which failed to install.\r\nhaskell-src-exts-1.16.0.1 depends on text-1.2.0.4 which failed to install.\r\nmtl-2.1.3.1 failed during the configure step. The exception was:\r\nuser error (\r\nIn file included from\r\n/var/folders/lj/13hckkrj5c9bjygql9tcsn940000gn/T/ghc45315_0/ghc45315_4.c:1:0:\r\n\r\n\r\nIn file included from\r\n/nix/store/sg1y8i67c2vrqc2irydi5kyyxsf95wi2-ghc-7.8.4/lib/ghc-7.8.4/include/Rts.h:30:0:\r\n\r\n\r\n/nix/store/sg1y8i67c2vrqc2irydi5kyyxsf95wi2-ghc-7.8.4/lib/ghc-7.8.4/include/Stg.h:65:10:\r\nfatal error: 'math.h' file not found\r\n#include <math.h>\r\n^\r\n1 error generated.\r\n)\r\n```"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/74996765","html_url":"https://github.com/NixOS/nixpkgs/issues/6390#issuecomment-74996765","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/6390","id":74996765,"user":{"login":"copumpkin","id":2623,"avatar_url":"https://avatars.githubusercontent.com/u/2623?v=3","gravatar_id":"","url":"https://api.github.com/users/copumpkin","html_url":"https://github.com/copumpkin","followers_url":"https://api.github.com/users/copumpkin/followers","following_url":"https://api.github.com/users/copumpkin/following{/other_user}","gists_url":"https://api.github.com/users/copumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/copumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/copumpkin/subscriptions","organizations_url":"https://api.github.com/users/copumpkin/orgs","repos_url":"https://api.github.com/users/copumpkin/repos","events_url":"https://api.github.com/users/copumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/copumpkin/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T04:13:47Z","updated_at":"2015-02-19T04:13:47Z","body":"But if it's calling clang-wrapper, clang-wrapper should take care of passing in the appropriate libSystem. The issue, I think, is that the (impure) darwin stdenv doesn't use the \"official\" libc-passing mechanism of the `cc-wrapper`, instead going for `NIX_CFLAGS_COMPILE` as a prehook in the stdenv. If someone wants to lift the proper `libc` passing from pure-darwin into master, I'd expect that to fix it."}}