Skip to content

Commit 00dcdf6

Browse files
committed
Add --locked to cargo build args in nix
1 parent 53fa14b commit 00dcdf6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

nix/cross-helpers.nix

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ in rec {
3232
supportedSystems = if hostInfo.kernel.name == "linux" then [
3333
"aarch64-linux"
3434
"x86_64-linux"
35-
] else if host == "x86_64-darwin" then [
36-
# "aarch64-darwin" # Temporarily broken. TODO: fix
37-
"x86_64-darwin"
38-
] else if host == "aarch64-darwin" then
35+
] else if host == "x86_64-darwin" then
36+
[
37+
# "aarch64-darwin" # Temporarily broken. TODO: fix
38+
"x86_64-darwin"
39+
]
40+
else if host == "aarch64-darwin" then
3941
[ "aarch64-darwin" ]
4042
else
4143
throw "unsupported host system ${host}";
@@ -85,8 +87,9 @@ in rec {
8587

8688
crossParams = if host == target then {
8789
cc = pkgs.stdenv.cc;
88-
extraBuildEnv = {
89-
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
90+
extraBuildEnv = {
91+
RUST_SRC_PATH =
92+
"${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
9093
};
9194
} else rec {
9295
cc = pkgsCross.stdenv.cc;
@@ -107,6 +110,7 @@ in rec {
107110
doCheck = host == target;
108111
propagatedBuildInputs = [ crossParams.cc ];
109112
inherit buildInputs;
113+
cargoBuildOptions = args: args ++ [ "--locked" ];
110114
CARGO_BUILD_TARGET = buildCfg.rustTarget;
111115
} // crossParams.extraBuildEnv);
112116

0 commit comments

Comments
 (0)