[Nix-dev] Re: [Nix-commits] SVN commit: nix - 16844 - raskin - in nixpkgs/trunk/pkgs: applications/misc/gphoto2 top-level

Eelco Dolstra e.dolstra at tudelft.nl
Wed Aug 26 19:30:39 CEST 2009


Hi,

Michael Raskin wrote:

> Eelco Dolstra wrote:
>> It's not a good idea to have "platformPackage" in all-packages.nix.  It's a
>> property of a package, so it should be specified in the Nix expression of the
>> package, not in the composition (all-packages.nix).  Adding this kind of
>> information to all-packages.nix will just make it harder to get rid of (most of)
>>  all-packages.nix in the future.
> 
> In general, I agree. I welcome any solution to the problem. I just do
> not see any simple good solution, so I start with simple and a good one
> will emerge in the discussion.

Another point to consider: the platforms on which we want to build a package in
Hydra is not an inherent property of the package, but a part of the Hydra
configuration.  (You might want to run your own Hydra instance and build some
subset of Nixpkgs on different platforms...) So they should be specified in
release.nix, not in the Nix expression for the package.

>> Also, returning {} will cause unexpected behaviour if the package is used as ara 
>> dependency of another package (the latter will get an unexpected {} argument,
>> which may or may not cause evaluation to fail (I guess it does); "abort" or
>> assertion failures on the other hand are always propagated).
> 
> It does, because package always wants a derivation to either be
> convertible to path or contain an attribute with pre-known name. Both
> assumptions will fail.

This turns out not to be the case.  For instance, if a package has a dependency
"foo" containing an attribute "bar", it might evaluate "foo.bar".  This will
barf if foo is {}.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list