From c2c217660b35f0a1e575128cb1f17b86959144c9 Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Tue, 21 Aug 2018 15:37:06 -0400 Subject: [PATCH] Build overriden python packages too --- release.nix | 105 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 43 deletions(-) diff --git a/release.nix b/release.nix index 86a64c1..d944a00 100644 --- a/release.nix +++ b/release.nix @@ -92,54 +92,73 @@ in let # jobs - The jobs hydra is to run. # - jobs = { - # Tweak the nixos make-channel code to include the upstream channel. - # - # 1. Replace the git repo nixpkgs with a copy of the unpacked nixpkgs channel. - # - channel = - ( import (nixpkgsGit + /nixos/lib/make-channel.nix) { - inherit pkgs version versionSuffix; - nixpkgs = ccpkgsGit; - } ).overrideAttrs ( original: { - name = "ccpkgs-channel"; - distPhase = - '' - rm -fr upstream - cp -rd ${nixpkgs}/nixos-${version} upstream - '' + original.distPhase; - } ); + jobs = + let + # Extract the valid derivations from an overlay + # + # nameSet - the attribute set the uncomposed overlay (just the names are required) + # valueSet - the final attribute from the composed overlay (the values are required) + # + extractDerivations = valueSet: nameSet: + builtins.listToAttrs + ( builtins.map + ( name: { inherit name; value = valueSet.${name}; } ) + ( pkgs.lib.filter + ( name: pkgs.lib.isDerivation valueSet.${name} ) + ( pkgs.lib.attrNames nameSet ) ) ); - # tested - Aggregate package set required to built for automatic channel release - # - tested = pkgs.lib.hydraJob (pkgs.releaseTools.aggregate { - name = "ccpkgs-${version}"; + # Provided overlays + pkgsNamesTopLevel = let self = import ./pkgs/all-packages.nix self { } self; in self; + pkgsNamesPython = let self = import ./pkgs/python-packages.nix { } self { } ; in self; - constituents = - builtins.attrValues jobs.pkgs - ++ builtins.attrValues jobs.temporary; + temporaryNamesTopLevel = let self = import ./temporary/all-temporary.nix self { } self; in self; + temporaryNamesPython = let self = import ./temporary/python-packages.nix { } self { } ; in self; - meta = { - description = "Release-critical builds for the ccpkgs channel"; - maintainers = with pkgs.lib.maintainers; [ ]; + in { + # Tweak the nixos make-channel code to include the upstream channel. + # + # 1. Replace the git repo nixpkgs with a copy of the unpacked nixpkgs channel. + # + channel = + ( import (nixpkgsGit + /nixos/lib/make-channel.nix) { + inherit pkgs version versionSuffix; + nixpkgs = ccpkgsGit; + } ).overrideAttrs ( original: { + name = "ccpkgs-channel"; + distPhase = + '' + rm -fr upstream + cp -rd ${nixpkgs}/nixos-${version} upstream + '' + original.distPhase; + } ); + + # tested - Aggregate package set required to built for automatic channel release + # + tested = pkgs.lib.hydraJob (pkgs.releaseTools.aggregate { + name = "ccpkgs-${version}"; + + constituents = builtins.map ( pkgs.lib.collect pkgs.lib.isDerivation ) [ jobs.pkgs jobs.temporary ]; + + meta = { + description = "Release-critical builds for the ccpkgs channel"; + maintainers = with pkgs.lib.maintainers; [ ]; + }; + }); + + # pkgs - Attribute set of overlayed pkgs. + # + pkgs = extractDerivations pkgs pkgsNamesTopLevel // { + python2Packages = extractDerivations pkgs.python2Packages pkgsNamesPython; + python3Packages = extractDerivations pkgs.python3Packages pkgsNamesPython; }; - }); - # pkgs - Attribute set of overlayed pkgs. - # - pkgs = - builtins.listToAttrs - ( builtins.map ( name: { inherit name; value = pkgs.${name}; } ) - ( builtins.filter ( name: builtins.isAttrs pkgs.${name} && pkgs.${name}.type or "" == "derivation" ) - ( builtins.attrNames ( let self = import ./pkgs/all-packages.nix self { } self; in self ) ) ) ); - # temporary - Attribute set of overlayed pkgs. - # - temporary = - builtins.listToAttrs - ( map ( name: { inherit name; value = pkgs.${name}; } ) - ( builtins.filter ( name: builtins.isAttrs pkgs.${name} && pkgs.${name}.type or "" == "derivation" ) - ( builtins.attrNames ( let self = import ./temporary/all-temporary.nix self { } self; in self ) ) ) ); - }; + # temporary - Attribute set of overlayed pkgs. + # + temporary = extractDerivations pkgs temporaryNamesTopLevel // { + python2Packages = extractDerivations pkgs.python2Packages temporaryNamesPython; + python3Packages = extractDerivations pkgs.python3Packages temporaryNamesPython; + }; + }; in jobs