Skip to content

Commit

Permalink
Disable windows and macos builds in nix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimbo4350 committed May 19, 2021
1 parent 41c4a2e commit 3fc290c
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 56 deletions.
44 changes: 23 additions & 21 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,27 @@
crossSystem = systems.examples.musl64;
}).cardanoNodeProject.flake {};

windowsFlake = (import nixpkgs { inherit system overlays config;
crossSystem = systems.examples.mingwW64;
}).cardanoNodeProject.flake {};
# Temporarily disabled until Plutus can be cross compiled
# windowsFlake = (import nixpkgs { inherit system overlays config;
# crossSystem = systems.examples.mingwW64;
# }).cardanoNodeProject.flake {};

scripts = flattenTree pkgs.scripts;

checkNames = attrNames flake.checks;

checks =
# Linux only checks:
optionalAttrs (system == "x86_64-linux") (
prefixNamesWith "windows/" (removeAttrs
(getAttrs checkNames windowsFlake.checks)
["cardano-node-chairman:test:chairman-tests"]
)
// (prefixNamesWith "nixosTests/" (mapAttrs (_: v: v.${system} or v) pkgs.nixosTests))
)
# checks run on default system only;
// optionalAttrs (system == defaultSystem) {
# Linux only checks: Temporarily disabled until Plutus can be cross compiled
# optionalAttrs (system == "x86_64-linux") (
# prefixNamesWith "windows/" (removeAttrs
# (getAttrs checkNames windowsFlake.checks)
# ["cardano-node-chairman:test:chairman-tests"]
# )
# // (prefixNamesWith "nixosTests/" (mapAttrs (_: v: v.${system} or v) pkgs.nixosTests))
# )
# # checks run on default system only;
# //
optionalAttrs (system == defaultSystem) {
hlint = pkgs.callPackage pkgs.hlintCheck {
inherit (pkgs.cardanoNodeProject.projectModule) src;
};
Expand All @@ -95,14 +97,14 @@
// (prefixNamesWith "static/"
(mapAttrs pkgs.rewriteStatic (lazyCollectExe
(if system == "x86_64-darwin" then flake else muslFlake).packages)))
# Linux only packages:
// optionalAttrs (system == "x86_64-linux") (
prefixNamesWith "windows/" (lazyCollectExe windowsFlake.packages)
// {
"dockerImage/node" = pkgs.dockerImage;
"dockerImage/submit-api" = pkgs.submitApiDockerImage;
}
)
# Linux only packages: Temporarily disabled until Plutus can be cross compiled
# // optionalAttrs (system == "x86_64-linux") (
# prefixNamesWith "windows/" (lazyCollectExe windowsFlake.packages)
# // {
# "dockerImage/node" = pkgs.dockerImage;
# "dockerImage/submit-api" = pkgs.submitApiDockerImage;
# }
# )
# Add checks to be able to build them individually
// (prefixNamesWith "checks/" checks);

Expand Down
75 changes: 40 additions & 35 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
, linuxBuild ? builtins.elem "x86_64-linux" supportedSystems

# Build for macos
, macosBuild ? builtins.elem "x86_64-darwin" supportedSystems
# , macosBuild ? builtins.elem "x86_64-darwin" supportedSystems

# Cross compilation to Windows is currently only supported on linux.
, windowsBuild ? builtins.elem "x86_64-linux" supportedCrossSystems
#, windowsBuild ? builtins.elem "x86_64-linux" supportedCrossSystems

# A Hydra option
, scrubJobs ? true
Expand All @@ -49,15 +49,15 @@ let
linuxRelease = (import pkgs.iohkNix.release-lib) {
inherit pkgs;
supportedSystems = [ "x86_64-linux" ];
supportedCrossSystems = filter (s: s == "x86_64-linux" && windowsBuild) supportedCrossSystems;
supportedCrossSystems = filter (s: s == "x86_64-linux") supportedCrossSystems;
inherit scrubJobs projectArgs;
packageSet = import cardano-node;
gitrev = cardano-node.rev;
};
macosRelease = (import pkgs.iohkNix.release-lib) {
inherit pkgs;
supportedSystems = [ "x86_64-darwin" ];
supportedCrossSystems = filter (s: s == "x86_64-darwin" && windowsBuild) supportedCrossSystems;
supportedCrossSystems = filter (s: s == "x86_64-darwin") supportedCrossSystems;
inherit scrubJobs projectArgs;
packageSet = import cardano-node;
gitrev = cardano-node.rev;
Expand All @@ -70,9 +70,11 @@ let
makeScripts = cluster: let
getScript = name: optionalAttrs linuxBuild {
x86_64-linux = archs.x86_64-linux.scripts.${cluster}.${name};
} // (optionalAttrs macosBuild {
x86_64-darwin = archs.x86_64-darwin.scripts.${cluster}.${name};
});
}
#// (optionalAttrs macosBuild {
# x86_64-darwin = archs.x86_64-darwin.scripts.${cluster}.${name};
#})
;
in {
node = getScript "node";
};
Expand Down Expand Up @@ -140,7 +142,8 @@ let
else value
) project;

inherit (systems.examples) mingwW64 musl64;
#inherit (systems.examples) mingwW64 musl64; Temporarily disabled until plutus can be cross compiled
inherit (systems.examples) musl64;

inherit (pkgs.commonLib) sources nixpkgs;

Expand All @@ -166,24 +169,26 @@ let
platform = "linux";
exes = collectJobs jobs.linux.musl64.exes;
};
})) // (optionalAttrs macosBuild (with macosRelease; {
macos =
let filteredBuilds = mapAttrsRecursiveCond (a: !(isList a)) (path: value:
if (any (p: take (length p) path == p) onlyBuildOnDefaultSystem) then filter (s: !(elem s nonDefaultBuildSystems)) value else value)
(packagePlatforms project);
in (mapTestOn (__trace (__toJSON filteredBuilds) filteredBuilds));
cardano-node-macos = import ./nix/binary-release.nix {
inherit pkgs project;
platform = "macos";
exes = collectJobs jobs.macos.exes;
};
})) // (optionalAttrs windowsBuild (with windowsRelease; {
windows = mapTestOnCross mingwW64 (packagePlatformsCross (filterProject noCrossBuild project));
cardano-node-win64 = import ./nix/binary-release.nix {
inherit pkgs project;
platform = "win64";
exes = collectJobs jobs.windows.exes;
};
}))
#// (optionalAttrs macosBuild (with macosRelease; {
# macos =
# let filteredBuilds = mapAttrsRecursiveCond (a: !(isList a)) (path: value:
# if (any (p: take (length p) path == p) onlyBuildOnDefaultSystem) then filter (s: !(elem s nonDefaultBuildSystems)) value else value)
# (packagePlatforms project);
# in (mapTestOn (__trace (__toJSON filteredBuilds) filteredBuilds));
# cardano-node-macos = import ./nix/binary-release.nix {
# inherit pkgs project;
# platform = "macos";
# exes = collectJobs jobs.macos.exes;
# }; # Temporarily disabled until Plutus can be cross compiled
#}))
#// (optionalAttrs windowsBuild (with windowsRelease; {
# windows = mapTestOnCross mingwW64 (packagePlatformsCross (filterProject noCrossBuild project));
# cardano-node-win64 = import ./nix/binary-release.nix {
# inherit pkgs project;
# platform = "win64";
# exes = collectJobs jobs.windows.exes;
# };
})) // extraBuilds // (linuxRelease.mkRequiredJob (concatLists [
# Linux builds:
(optionals linuxBuild (concatLists [
Expand All @@ -194,16 +199,16 @@ let
[ jobs.cardano-node-linux ]
]))
# macOS builds:
(optionals macosBuild (concatLists [
(collectJobs jobs.macos.checks)
(collectJobs jobs.macos.nixosTests)
(collectJobs jobs.macos.benchmarks)
(collectJobs jobs.macos.exes)
[ jobs.cardano-node-macos ]
]))
# (optionals macosBuild (concatLists [
# (collectJobs jobs.macos.checks)
# (collectJobs jobs.macos.nixosTests)
# (collectJobs jobs.macos.benchmarks)
# (collectJobs jobs.macos.exes)
# [ jobs.cardano-node-macos ]
# ]))
# Windows builds:
(optional windowsBuild jobs.cardano-node-win64)
(optionals windowsBuild (collectJobs jobs.windows.checks))
#(optional windowsBuild jobs.cardano-node-win64)
#(optionals windowsBuild (collectJobs jobs.windows.checks))
# Default system builds (linux on hydra):
(map (cluster: collectJobs jobs.${cluster}.scripts.node.${head supportedSystems}) environments)
[ jobs.dockerImages ]
Expand Down

0 comments on commit 3fc290c

Please sign in to comment.