on master help sign in
Merge pull request #622 from obsidiansystems/ci-more-profiled

CI the obelisk comamnd and skeleton shells.ghc profiled

commitdd2fa26157104690ad2085d34bf43cb9dd84ef8b authorElliot Cameron <3noch@users.noreply.github.com> dateFri 17 Jan 2020, 12:54 (7 years ago) parent3eefbee8b6488e
1 file changed+36−47
all-builds.nix+36−47
all-builds.nix+36−47
@@ -38,21 +38,16 @@ let
3838 (name: { inherit name; value = pkgsSet.${name}; })
3939 pnames);
4040
41− concatDepends = let
42− extractDeps = x: (x.override {
43− mkDerivation = drv: {
44− out = builtins.concatLists [
45− (drv.buildDepends or [])
46− (drv.libraryHaskellDepends or [])
47− (drv.executableHaskellDepends or [])
48− ];
49− };
50− }).out;
51− in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
41+ collect = v:
42+ if lib.isDerivation v then [v]
43+ else if lib.isAttrs v then lib.concatMap collect (builtins.attrValues v)
44+ else if lib.isList v then lib.concatMap collect v
45+ else [];
5246
5347 perPlatform = lib.genAttrs cacheBuildSystems (system: let
5448 reflex-platform = import ./dep/reflex-platform { inherit system; };
55− perProfiling = profiling: let
49+
50+ mkPerProfiling = profiling: let
5651 obelisk = import ./. (self-args // { inherit system profiling; });
5752 ghc = pnameToAttrs
5853 obelisk.haskellPackageSets.ghc
@@ -60,19 +55,6 @@ let
6055 ghcjs = pnameToAttrs
6156 obelisk.haskellPackageSets.ghcjs
6257 obeliskPackagesCommon;
63− cachePackages = builtins.concatLists [
64− (builtins.attrValues ghc)
65− (lib.optionals (!profiling) (builtins.attrValues ghcjs))
66− (concatDepends ghc)
67− (lib.optionals (!profiling) (concatDepends ghcjs))
68− (lib.optional reflex-platform.androidSupport androidSkeleton)
69− (lib.optional reflex-platform.iosSupport iosSkeleton)
70− (lib.optionals (!profiling) [
71− command
72− serverSkeletonExe
73− serverSkeletonShell
74− ])
75− ];
7658 command = obelisk.command;
7759 skeleton = import ./skeleton { inherit obelisk; };
7860 serverSkeletonExe = skeleton.exe;
@@ -85,29 +67,36 @@ let
8567 androidSkeleton = (import ./skeleton { inherit obelisk; }).android.frontend;
8668 iosSkeleton = (import ./skeleton { inherit obelisk; }).ios.frontend;
8769 nameSuffix = if profiling then "profiled" else "unprofiled";
88− in {
89− inherit
90− ghc
91− ;
92− cache = reflex-platform.pinBuildInputs "obelisk-${system}-${nameSuffix}" cachePackages;
93− } // lib.optionalAttrs (!profiling) {
94− inherit
95− command
96− ghcjs
97− serverSkeletonExe
98− serverSkeletonShell
99− ;
100− } // lib.optionalAttrs reflex-platform.androidSupport {
101− inherit androidSkeleton;
102− } // lib.optionalAttrs reflex-platform.iosSupport {
103− inherit iosSkeleton;
70+ packages = {
71+ inherit
72+ command
73+ serverSkeletonShell
74+ ghc
75+ ;
76+ } // lib.optionalAttrs (!profiling) {
77+ inherit
78+ ghcjs
79+ serverSkeletonExe
80+ ;
81+ } // lib.optionalAttrs reflex-platform.androidSupport {
82+ inherit androidSkeleton;
83+ } // lib.optionalAttrs reflex-platform.iosSupport {
84+ inherit iosSkeleton;
85+ };
86+ in packages // {
87+ cache = reflex-platform.pinBuildInputs
88+ "obelisk-${system}-${nameSuffix}"
89+ (collect packages);
90+ };
91+
92+ perProfiling = {
93+ profiled = mkPerProfiling true;
94+ unprofiled = mkPerProfiling false;
10495 };
105− profiled = perProfiling true;
106− unprofiled = perProfiling false;
107− cachePackages = map (p: p.cache) [ profiled unprofiled ];
108− in {
109− inherit profiled unprofiled;
110− cache = reflex-platform.pinBuildInputs "obelisk-${system}" cachePackages;
96+ in perProfiling // {
97+ cache = reflex-platform.pinBuildInputs
98+ "obelisk-${system}"
99+ (map (p: p.cache) (builtins.attrValues perProfiling));
111100 });
112101
113102 metaCache = local-self.reflex-platform.pinBuildInputs