Only show/build a package on the platforms listed in meta.platforms

The function ‘mkDerivation’ now checks whether the current platform
type is included in a package's meta.platform field.  If not, it
throws an exception:

  $ nix-build -A linux --argstr system x86_64-darwin
  error: user-thrown exception: the package ‘linux-3.10.15’ is not supported on ‘x86_64-darwin’

These packages also no longer show up in ‘nix-env -qa’ output.  This
means, for instance, that the number of packages shown on
x86_64-freebsd has dropped from 9268 to 4764.

Since meta.platforms was also used to prevent Hydra from building some
packages, there now is a new attribute meta.hydraPlatforms listing the
platforms on which Hydra should build the package (which defaults to
meta.platforms).
This commit is contained in:
Eelco Dolstra
2013-11-05 00:06:10 +01:00
parent 8867304b5e
commit a2cbc77e4f
6 changed files with 55 additions and 13 deletions
+3 -5
View File
@@ -119,14 +119,12 @@ rec {
# May fail as much as it wishes, we will catch the error.
processPackage = attrSet:
if attrSet ? recurseForDerivations && attrSet.recurseForDerivations then
if attrSet.recurseForDerivations or false then
packagesWithMetaPlatform attrSet
else if attrSet ? recurseForRelease && attrSet.recurseForRelease then
else if attrSet.recurseForRelease or false then
packagesWithMetaPlatform attrSet
else
if attrSet ? meta && attrSet.meta ? platforms
then attrSet.meta.platforms
else [];
attrSet.meta.hydraPlatforms or (attrSet.meta.platforms or []);
/* Common platform groups on which to test packages. */