{"action":"created","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/960","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/960/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/960/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/960/events","html_url":"https://github.com/commercialhaskell/stack/issues/960","id":105558665,"number":960,"title":"ghc fails sanity check on OS X with Nix","user":{"login":"usharf","id":1701421,"avatar_url":"https://avatars.githubusercontent.com/u/1701421?v=3","gravatar_id":"","url":"https://api.github.com/users/usharf","html_url":"https://github.com/usharf","followers_url":"https://api.github.com/users/usharf/followers","following_url":"https://api.github.com/users/usharf/following{/other_user}","gists_url":"https://api.github.com/users/usharf/gists{/gist_id}","starred_url":"https://api.github.com/users/usharf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/usharf/subscriptions","organizations_url":"https://api.github.com/users/usharf/orgs","repos_url":"https://api.github.com/users/usharf/repos","events_url":"https://api.github.com/users/usharf/events{/privacy}","received_events_url":"https://api.github.com/users/usharf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-09T09:28:20Z","updated_at":"2015-09-10T05:11:34Z","closed_at":null,"body":"Similar to  #497, but on OS X with Nix, I'm getting \"The GHC located at /Users/uri/.nix-profile/bin/ghc failed to compile a sanity check.\", though no problem to use cabal or `nix-shell`. Stack won't setup or build.\r\n\r\nMy setup: \r\n\r\n```sh\r\n▶  which stack\r\n/Users/uri/.nix-profile/bin/stack\r\n\r\n▶ stack --version\r\nVersion 0.1.4.1 (UNKNOWN commits) X86_64\r\n```\r\n```sh\r\n▶ env | grep NIX\r\nNIXDIR=/Users/uri/nixpkgs\r\nNIX_PATH=nixpkgs=/Users/uri/nixpkgs\r\nNIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/uri\r\nNIX_GHC=/nix/store/hxmb7pcax73ygw9k58yb4y2zxva57ds6-ghc-7.10.2/bin/ghc\r\nNIX_GHCPKG=/nix/store/hxmb7pcax73ygw9k58yb4y2zxva57ds6-ghc-7.10.2/bin/ghc-pkg\r\nNIX_GHC_DOCDIR=/nix/store/hxmb7pcax73ygw9k58yb4y2zxva57ds6-ghc-7.10.2/share/doc/ghc/html\r\nNIX_GHC_LIBDIR=/nix/store/hxmb7pcax73ygw9k58yb4y2zxva57ds6-ghc-7.10.2/lib/ghc-7.10.2\r\n```\r\n\r\nSame error when I remove the `NIX_GHC*` environment setup above (which is what the  `~/.nix-profile/bin/ghc` wrapper sets up as well.\r\n\r\nWhen I switch into a `nix-shell` though, it seem to work.\r\n```sh\r\n[nix-shell:~/Projects/haskell/bassbull]$ stack setup\r\nstack will use the GHC on your PATH\r\nFor more information on paths, see 'stack path' and 'stack exec env'\r\nTo use this GHC and packages outside of a project, consider using:\r\nstack ghc, stack ghci, stack runghc, or stack exec\r\n```"},"comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments/139119062","html_url":"https://github.com/commercialhaskell/stack/issues/960#issuecomment-139119062","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/960","id":139119062,"user":{"login":"snoyberg","id":49415,"avatar_url":"https://avatars.githubusercontent.com/u/49415?v=3","gravatar_id":"","url":"https://api.github.com/users/snoyberg","html_url":"https://github.com/snoyberg","followers_url":"https://api.github.com/users/snoyberg/followers","following_url":"https://api.github.com/users/snoyberg/following{/other_user}","gists_url":"https://api.github.com/users/snoyberg/gists{/gist_id}","starred_url":"https://api.github.com/users/snoyberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snoyberg/subscriptions","organizations_url":"https://api.github.com/users/snoyberg/orgs","repos_url":"https://api.github.com/users/snoyberg/repos","events_url":"https://api.github.com/users/snoyberg/events{/privacy}","received_events_url":"https://api.github.com/users/snoyberg/received_events","type":"User","site_admin":false},"created_at":"2015-09-10T05:11:34Z","updated_at":"2015-09-10T05:11:34Z","body":"I didn't understand your first paragraph, could you rephrase?\n\nRegarding the difference between stack and nix, the mailing list or stack\noverflow would be a better place for such a question, as there are people\nusing both that can answer that.\n\nOn Wed, Sep 9, 2015, 2:43 PM Uri Sharf <notifications@github.com> wrote:\n\n> IMHO thought the full message when stack setup does indicate it's\n> attempting to use system `ghc, it's easy to miss the point, if you're not\n> sure what you are looking at/for...\n>\n> also what are the advantage of stack on nix compared to nix-shell, or are\n> they mutually exclusive?\n>\n> ▶ stack setup\n> The GHC located at /Users/uri/.nix-profile/bin/ghc failed to compile a sanity check. Please see:\n>\n>     https://github.com/commercialhaskell/stack/wiki/Downloads\n> for more information. Exception was:\n> Running /Users/uri/.nix-profile/bin/ghc /var/folders/c0/4fzwf9wx4qvdj10z6c52_s_m0000gn/T/stack-sanity-check81989/Main.hs -no-user-package-db exited with ExitFailure 1\n> [1 of 1] Compiling Main             ( /var/folders/c0/4fzwf9wx4qvdj10z6c52_s_m0000gn/T/stack-sanity-check81989/Main.hs, /var/folders/c0/4fzwf9wx4qvdj10z6c52_s_m0000gn/T/stack-sanity-check81989/Main.o )\n> Linking /var/folders/c0/4fzwf9wx4qvdj10z6c52_s_m0000gn/T/stack-sanity-check81989/Main ...\n>\n> In file included from /var/folders/c0/4fzwf9wx4qvdj10z6c52_s_m0000gn/T/ghc81993_0/ghc_4.c:1:0:\n>\n>\n> In file included from /nix/store/zpf65w2k132d1x1wi4ynlznj2rljx904-ghc-7.10.2/lib/ghc-7.10.2/include/Rts.h:30:0:\n>\n> —\n>\n>\n> Reply to this email directly or view it on GitHub\n> <https://github.com/commercialhaskell/stack/issues/960#issuecomment-138885020>\n> .\n>\n"}}