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

nix-build fails due to missing package githash #147

Closed
nikola-da opened this issue Nov 9, 2018 · 6 comments
Closed

nix-build fails due to missing package githash #147

nikola-da opened this issue Nov 9, 2018 · 6 comments
Labels

Comments

@nikola-da
Copy link

When I follow the instructions from the README.md, I get the following:

/tmp/stack2nix master
❯ nix-build .
error: anonymous function at /private/tmp/stack2nix/stack2nix.nix:32633:10 called without required argument 'githash', at /nix/store/pc3wdq5pfp48vr000jnna791g24szfcl-ef802feaceba073e3e5178af1b5d65f27f5cc93b.tar.gz-unpacked/pkgs/development/haskell-modules/make-package-set.nix:88:27
(use '--show-trace' to show detailed location information)

I'm using nix 2.1.3 on macOS High Sierra, with nixpkgs 18.03.

Looking at stack2nix.nix, githash argument to stack is not defined in the file.

@clacke
Copy link

clacke commented Nov 15, 2018

NixOS with sandbox:

$ git bisect start; git bisect bad upstream/master; git bisect good fbb569b7759af7d77a4ac8ec2bd487427f191d53; git bisect run nix-build

[ . . . ]

891c6f939b0c2859a6ba352d20c869bf78d96ff9 is the first bad commit
commit 891c6f939b0c2859a6ba352d20c869bf78d96ff9
Author: Kirill Zaborsky <qrilka@gmail.com>
Date:   Fri Sep 14 09:00:09 2018 +0300

    Updated to stack prerelease 1.9

@clacke
Copy link

clacke commented Nov 15, 2018

This issue describes the special case of a general bug. If I take the last good commit 891c6f93^, and use that build to get a nix expression for Bäckerei, I get a file that complains about not getting the parameter util, even though the cabal2nix call for util is shown while processing. So I just ran that call again and appended the definition to the other attributes, and I got a new error: It turned out that util was in fact already defined.

Is it the callPackage that comes from nixpkgs ghc that is broken?

EDIT: No, it's not a parameter that points to util, it's an inherit (pkgs) util call, see https://github.com/cryptiumlabs/backerei/blob/042f97ec9e9f542421134416f8ee0301c9bb749e/README.md#regenerating-releasenix from cryptiumlabs/backerei#10 .

891c6f93^ does not build if I let it generate its own stack2nix.nix. The checked-in stack2nix.nix was generated with an earlier version. Trying to find a revision of nixpkgs where nixpkgs stack2nix builds, that should be easier than finding a combination of revisions of stack2nix and nixpkgs that interact well.

Hm, actually OP described an attribute not being generated and I'm describing an attribute being ignored, so it sounds like two different issues. Disentangling them when troubleshooting would be hard work though, as the symptom is the same. I'll keep the troubleshooting to this shared issue.

@clacke
Copy link

clacke commented Nov 15, 2018

That stack2nix.nix that worked was generated in 214078d , probably with that same version of stack2nix. Verifying that it can generate its own.

No, it can't. If I generate an s2n.nix and try to build from that I get a missing dependency during the build of stack (but a compile error, no Nix errors). The difference between the original stack2nix.nix and the generated s2n.nix is in some editedCabalFile and revision attributes.

@domenkozar domenkozar added the bug label Nov 15, 2018
@domenkozar
Copy link
Contributor

This is fixed now, can you retry?

@clacke
Copy link

clacke commented Nov 21, 2018

Confirmed. It builds from stack2nix.nix and it can generate a new one that works as well.

@clacke
Copy link

clacke commented Nov 21, 2018

Re: the Bäckerei thing I identified the problem and will open a different issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants