Skip to content

Commit

Permalink
CI the obelisk comamnd and skeleton shells.ghc profiled
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Jan 17, 2020
1 parent 3eefbee commit 8b6488e
Showing 1 changed file with 36 additions and 47 deletions.
83 changes: 36 additions & 47 deletions all-builds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,41 +38,23 @@ let
(name: { inherit name; value = pkgsSet.${name}; })
pnames);

concatDepends = let
extractDeps = x: (x.override {
mkDerivation = drv: {
out = builtins.concatLists [
(drv.buildDepends or [])
(drv.libraryHaskellDepends or [])
(drv.executableHaskellDepends or [])
];
};
}).out;
in pkgAttrs: builtins.concatLists (map extractDeps (builtins.attrValues pkgAttrs));
collect = v:
if lib.isDerivation v then [v]
else if lib.isAttrs v then lib.concatMap collect (builtins.attrValues v)
else if lib.isList v then lib.concatMap collect v
else [];

perPlatform = lib.genAttrs cacheBuildSystems (system: let
reflex-platform = import ./dep/reflex-platform { inherit system; };
perProfiling = profiling: let

mkPerProfiling = profiling: let
obelisk = import ./. (self-args // { inherit system profiling; });
ghc = pnameToAttrs
obelisk.haskellPackageSets.ghc
obeliskPackagesBackend;
ghcjs = pnameToAttrs
obelisk.haskellPackageSets.ghcjs
obeliskPackagesCommon;
cachePackages = builtins.concatLists [
(builtins.attrValues ghc)
(lib.optionals (!profiling) (builtins.attrValues ghcjs))
(concatDepends ghc)
(lib.optionals (!profiling) (concatDepends ghcjs))
(lib.optional reflex-platform.androidSupport androidSkeleton)
(lib.optional reflex-platform.iosSupport iosSkeleton)
(lib.optionals (!profiling) [
command
serverSkeletonExe
serverSkeletonShell
])
];
command = obelisk.command;
skeleton = import ./skeleton { inherit obelisk; };
serverSkeletonExe = skeleton.exe;
Expand All @@ -85,29 +67,36 @@ let
androidSkeleton = (import ./skeleton { inherit obelisk; }).android.frontend;
iosSkeleton = (import ./skeleton { inherit obelisk; }).ios.frontend;
nameSuffix = if profiling then "profiled" else "unprofiled";
in {
inherit
ghc
;
cache = reflex-platform.pinBuildInputs "obelisk-${system}-${nameSuffix}" cachePackages;
} // lib.optionalAttrs (!profiling) {
inherit
command
ghcjs
serverSkeletonExe
serverSkeletonShell
;
} // lib.optionalAttrs reflex-platform.androidSupport {
inherit androidSkeleton;
} // lib.optionalAttrs reflex-platform.iosSupport {
inherit iosSkeleton;
packages = {
inherit
command
serverSkeletonShell
ghc
;
} // lib.optionalAttrs (!profiling) {
inherit
ghcjs
serverSkeletonExe
;
} // lib.optionalAttrs reflex-platform.androidSupport {
inherit androidSkeleton;
} // lib.optionalAttrs reflex-platform.iosSupport {
inherit iosSkeleton;
};
in packages // {
cache = reflex-platform.pinBuildInputs
"obelisk-${system}-${nameSuffix}"
(collect packages);
};

perProfiling = {
profiled = mkPerProfiling true;
unprofiled = mkPerProfiling false;
};
profiled = perProfiling true;
unprofiled = perProfiling false;
cachePackages = map (p: p.cache) [ profiled unprofiled ];
in {
inherit profiled unprofiled;
cache = reflex-platform.pinBuildInputs "obelisk-${system}" cachePackages;
in perProfiling // {
cache = reflex-platform.pinBuildInputs
"obelisk-${system}"
(map (p: p.cache) (builtins.attrValues perProfiling));
});

metaCache = local-self.reflex-platform.pinBuildInputs
Expand Down

0 comments on commit 8b6488e

Please sign in to comment.