[Nix-dev] nix-build failing to run

Marc Weber marco-oweber at gmx.de
Sun Jul 19 20:39:43 CEST 2009


Hi Bill

Excerpts from Bill Trost's message of Sun Jul 19 17:49:11 +0200 2009:
> I discovered that nixpkgs was missing a simple program I wanted,

It's much easier to help you if you paste the whole code.
In this case I assume you've copy pasted an existing derivation so that
it looks like this:

default.nix

{stdenv, ... } : stdenv.mkDerviation {
  ...
}

Now you're trying to run nix-build -A quilt ? Your error message is
  cannot auto-call a function that has an argument without a default value (`stdenv')

I know this error message from calling functions directly. Eg if you
have a test.nix file containing

{arg}: ...

and you try to evaluate it using nix-build test.nix 
you'll get this error. Notet that I passed the filename!

So maybe just try nix-build -A quilt -f $NIXPKGS_ALL
and everything is fine (?)

What is happening here ? If you have a look at the first lines of
$NIXPKGS_ALL (= all-packages.nix within the nixpkgs repo) you'll see
some parameters:

{ # The system (e.g., `i686-linux') for which to build the packages.
  system ? builtins.currentSystem
  [...]

} : {
 The contents
}

That's not very different from {stdenv, .. }: which I think is the head
of your file.

But they all are followed by ? which is used to define default
values. That's why you can run nix-build -A package $NIXPKGS_ALL
without specifying system, stdenvType, bootSdtdenv, noSysDirs, ...
(see man nix-build to read up how to pass them if you really want to)

Probably you asked nix-build to read your file not from the
all-packages.nix context. So stdenv is not passed the way it's passed to
almost all packages there.

By the way: I recommend having a look at top-git. It can even export
quilt patch series. I prefer maintaining patch series in git. That's my
personal preference.

Marc Weber



More information about the nix-dev mailing list