2023-01-26 11:20:12 +00:00
|
|
|
{ system ? builtins.currentSystem, git_version ? null, }:
|
2021-10-04 16:27:57 +00:00
|
|
|
|
|
|
|
with import ./nix/common.nix;
|
|
|
|
|
2022-10-13 12:35:39 +00:00
|
|
|
let
|
2022-07-25 16:10:34 +00:00
|
|
|
pkgs = import pkgsSrc { };
|
2022-07-25 12:58:47 +00:00
|
|
|
compile = import ./nix/compile.nix;
|
2022-10-13 12:35:39 +00:00
|
|
|
|
2022-07-25 12:58:47 +00:00
|
|
|
build_debug_and_release = (target: {
|
2022-10-13 12:35:39 +00:00
|
|
|
debug = (compile {
|
2022-11-16 21:21:24 +00:00
|
|
|
inherit system target git_version pkgsSrc cargo2nixOverlay;
|
2022-10-13 12:35:39 +00:00
|
|
|
release = false;
|
2023-01-26 11:20:12 +00:00
|
|
|
}).workspace.garage { compileMode = "build"; };
|
2022-10-13 12:35:39 +00:00
|
|
|
|
|
|
|
release = (compile {
|
2022-11-16 21:21:24 +00:00
|
|
|
inherit system target git_version pkgsSrc cargo2nixOverlay;
|
2022-10-13 12:35:39 +00:00
|
|
|
release = true;
|
2023-01-26 11:20:12 +00:00
|
|
|
}).workspace.garage { compileMode = "build"; };
|
2022-07-25 12:58:47 +00:00
|
|
|
});
|
2022-10-13 12:35:39 +00:00
|
|
|
|
2023-01-26 11:20:12 +00:00
|
|
|
test = (rustPkgs:
|
|
|
|
pkgs.symlinkJoin {
|
|
|
|
name = "garage-tests";
|
|
|
|
paths =
|
|
|
|
builtins.map (key: rustPkgs.workspace.${key} { compileMode = "test"; })
|
|
|
|
(builtins.attrNames rustPkgs.workspace);
|
|
|
|
});
|
2022-07-25 12:58:47 +00:00
|
|
|
|
|
|
|
in {
|
|
|
|
pkgs = {
|
|
|
|
amd64 = build_debug_and_release "x86_64-unknown-linux-musl";
|
|
|
|
i386 = build_debug_and_release "i686-unknown-linux-musl";
|
|
|
|
arm64 = build_debug_and_release "aarch64-unknown-linux-musl";
|
|
|
|
arm = build_debug_and_release "armv6l-unknown-linux-musleabihf";
|
2022-02-03 17:04:43 +00:00
|
|
|
};
|
2022-07-25 12:58:47 +00:00
|
|
|
test = {
|
2022-10-13 12:35:39 +00:00
|
|
|
amd64 = test (compile {
|
2022-11-16 21:21:24 +00:00
|
|
|
inherit system git_version pkgsSrc cargo2nixOverlay;
|
2022-10-13 12:35:39 +00:00
|
|
|
target = "x86_64-unknown-linux-musl";
|
|
|
|
features = [
|
|
|
|
"garage/bundled-libs"
|
|
|
|
"garage/k2v"
|
2022-10-14 13:45:37 +00:00
|
|
|
"garage/sled"
|
2022-10-13 12:35:39 +00:00
|
|
|
"garage/lmdb"
|
|
|
|
"garage/sqlite"
|
|
|
|
];
|
|
|
|
});
|
2022-07-25 16:10:34 +00:00
|
|
|
};
|
|
|
|
clippy = {
|
2022-10-13 12:35:39 +00:00
|
|
|
amd64 = (compile {
|
2022-11-16 21:21:24 +00:00
|
|
|
inherit system git_version pkgsSrc cargo2nixOverlay;
|
2022-10-13 12:35:39 +00:00
|
|
|
target = "x86_64-unknown-linux-musl";
|
|
|
|
compiler = "clippy";
|
2023-01-26 11:20:12 +00:00
|
|
|
}).workspace.garage { compileMode = "build"; };
|
2022-02-23 10:38:52 +00:00
|
|
|
};
|
2022-07-25 12:58:47 +00:00
|
|
|
}
|