Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builder/lib/build-sets.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
nixpkgs,
rust-overlay,
torchVersions,
}:

let
Expand All @@ -16,7 +15,7 @@ let

# All build configurations supported by Torch.
buildConfigs =
system:
torchVersions: system:
let
filterMap = f: xs: builtins.filter (x: x != null) (builtins.map f xs);
systemBuildConfigs = filterMap (version: if version.system == system then version else null) (
Expand All @@ -30,7 +29,8 @@ let
in
rec {
mkBuildSets =
systems: lib.concatMap (system: builtins.map mkBuildSet (buildConfigs system)) systems;
torchVersions: systems:
lib.concatMap (system: builtins.map mkBuildSet (buildConfigs torchVersions system)) systems;

# Partition into an attrset { <system> = [ <buildset> ...]; ... }.
partitionBuildSetsBySystem = lib.foldl (
Expand Down
9 changes: 4 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
inherit
(import ./builder/lib/build-sets.nix {
inherit nixpkgs rust-overlay;
torchVersions = torchVersions';
})
mkBuildSets
partitionBuildSetsBySystem
Expand All @@ -39,7 +38,7 @@

torchVersions' = import ./builder/versions.nix;

defaultBuildSets = mkBuildSets systems;
defaultBuildSets = mkBuildSets torchVersions' systems;
defaultBuildSetsPerSystem = partitionBuildSetsBySystem defaultBuildSets;

mkBuildPerSystem =
Expand Down Expand Up @@ -90,7 +89,7 @@
(builtins.isFunction torchVersions)
|| abort "`torchVersions` must be a function taking one argument (the default version set)";
let
buildSets = mkBuildSets systems;
buildSets = mkBuildSets (torchVersions torchVersions') systems;
buildSetPerSystem = partitionBuildSetsBySystem buildSets;
buildPerSystem = mkBuildPerSystem buildSetPerSystem;
in
Expand All @@ -110,8 +109,8 @@
buildSets = buildSetPerSystem.${system};
}
);
}
// defaultBuildPerSystem;
};
#// defaultBuildPerSystem;
in
flake-utils.lib.eachSystem systems (
system:
Expand Down
Loading