Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"attribute 'haskell-nix' missing" when building with nix #61

Open
joprice opened this issue Sep 29, 2020 · 3 comments
Open

"attribute 'haskell-nix' missing" when building with nix #61

joprice opened this issue Sep 29, 2020 · 3 comments
Labels
Golang Applies to the Go target help wanted

Comments

@joprice
Copy link

joprice commented Sep 29, 2020

I'm trying build the master branch from source in an existing nix project:

import
        (pkgs.fetchFromGitHub
          {
            owner = "andyarvanitis";
            repo = "purescript-native";
            rev = "7a3f114fb158a250c6130c93752719b6d69c606a";
            sha256 = "1j0d25g5j3givf4shhnvnxqj54jjxzsj2sdm53xcirp7d9w78hmj";
          })
        {}

I get the error attribute 'haskell-nix' missing, at /nix/store/jbhar7ldha5r2dmxqj0j912i2k7zvn9k-source/default.nix:18:1

I tried copying the pkgs.haskell.lib.buildStackProject expression from stack.nix directly into my project, but I got different error from stack

Received ExitFailure 1 when running                                                                                   Raw command: /private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5.temp/ghc-8.6.5/configure --prefix=/private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5/
Run from: /private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5.temp/ghc-8.6.5/


Error: Error encountered while configuring GHC with
         /private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5.temp/ghc-8.6.5/configure --prefix=/private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5/
         run in /private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5.temp/ghc-8.6.5/

       The following directories may now contain files, but won't be used by stack:
         - /private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5.temp/
         - /private/var/folders/8b/yry_95qs2n1f4kpz_r94606w0000gn/T/nix-build-default-stack-shell.drv-0/.stack/programs/x86_64-osx-nix/ghc-8.6.5/

       For more information consider rerunning with --verbose flag

It suggests adding the verbose flag to debug further, but I'm not sure how to pass that down from nix.

Is building the project like this not a normal pattern? I'm not too familiar with nix yet.

@andyarvanitis
Copy link
Owner

Unfortunately I don't really use nix myself, so I can't be of help. The nix support we have is from other contributors like @kayhide. However, I can say that the master branch is no longer active. The default branch is golang, and there is a cpp branch for the C++ backend. As far as nix support goes, I think only the golang branch has been updated for it recently.

@kayhide
Copy link

kayhide commented Sep 30, 2020

Yeah, I setup the nix config to build the golang version.

I just tried it on the current golang branch and found that does not build.
I will take a look.

@joprice
Copy link
Author

joprice commented Sep 30, 2020

My revision is actually from the golang branch. I didn't even notice it wasn't master because it's set as the repo's default branch.

I was able to build the project using stack without hitting the second issue. I now realize that the stack.nix is meant for use by stack, not for direct consumption, so maybe stack is running it differently.

@andyarvanitis andyarvanitis added Golang Applies to the Go target help wanted labels Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Golang Applies to the Go target help wanted
Projects
None yet
Development

No branches or pull requests

3 participants