[HACK] Minimize input closure for builds
This commit is contained in:
parent
511787c870
commit
85eeaf7343
26
crane.nix
26
crane.nix
|
@ -91,17 +91,27 @@ let
|
|||
|
||||
cargoExtraArgs = "--target ${crossPlatform.rustTargetSpec}";
|
||||
|
||||
cargoVendorDir = craneLib.vendorMultipleCargoDeps {
|
||||
inherit (craneLib.findCargoFiles src) cargoConfigs;
|
||||
cargoLockList = [
|
||||
./Cargo.lock
|
||||
"${rustNightly.passthru.availableComponents.rust-src}/lib/rustlib/src/rust/Cargo.lock"
|
||||
];
|
||||
};
|
||||
cargoVendorDir = let
|
||||
orig = craneLib.vendorMultipleCargoDeps {
|
||||
inherit (craneLib.findCargoFiles src) cargoConfigs;
|
||||
cargoLockList = [
|
||||
./Cargo.lock
|
||||
"${rustNightly.passthru.availableComponents.rust-src}/lib/rustlib/src/rust/Cargo.lock"
|
||||
];
|
||||
};
|
||||
in pkgs.runCommandLocal "${orig.name}-deref" {} ''
|
||||
cp -rL ${orig} $out
|
||||
chmod u+w $out
|
||||
sed -i "s|${orig.outPath}|$out|g" "$out/config.toml"
|
||||
'';
|
||||
} // crossPlatform.env;
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // {
|
||||
installCargoArtifactsMode = "use-zstd";
|
||||
});
|
||||
|
||||
crate = craneLib.buildPackage (commonArgs // {
|
||||
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
|
||||
inherit cargoArtifacts;
|
||||
|
||||
# The resulting executable must be standalone
|
||||
allowedRequisites = [ ];
|
||||
|
|
11
flake.lock
11
flake.lock
|
@ -12,15 +12,16 @@
|
|||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1687310026,
|
||||
"narHash": "sha256-20RHFbrnC+hsG4Hyeg/58LvQAK7JWfFItTPFAFamu8E=",
|
||||
"owner": "ipetkov",
|
||||
"lastModified": 1687893602,
|
||||
"narHash": "sha256-+Pi3GJ2ZwCHJ6z1HAKzZ3T4jbn8wdpj8sx/MZK6CmVI=",
|
||||
"owner": "zhaofengli",
|
||||
"repo": "crane",
|
||||
"rev": "116b32c30b5ff28e49f4fcbeeb1bbe3544593204",
|
||||
"rev": "54046f5897cef86d9e8f0e536a4b94177eecb495",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "ipetkov",
|
||||
"owner": "zhaofengli",
|
||||
"ref": "mangled-artifacts",
|
||||
"repo": "crane",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue