rustPlatform.fetchCargoVendor: Don't recompute internal data (#503609)

This commit is contained in:
adisbladis
2026-04-29 11:09:02 +00:00
committed by GitHub
+16 -15
View File
@@ -22,6 +22,21 @@ let
];
} (builtins.readFile ./replace-workspace-values.py);
nix-prefetch-git' = nix-prefetch-git.override {
git = gitMinimal;
# break loop of nix-prefetch-git -> git-lfs -> asciidoctor -> ruby (yjit) -> fetchCargoVendor -> nix-prefetch-git
# Cargo does not currently handle git-lfs: https://github.com/rust-lang/cargo/issues/9692
git-lfs = null;
};
removedArgs = [
"name"
"pname"
"version"
"nativeBuildInputs"
"hash"
];
mkFetchCargoVendorUtil =
name: src:
writers.writePython3Bin name {
@@ -57,14 +72,6 @@ in
# TODO: add asserts about pname version and name
let
removedArgs = [
"name"
"pname"
"version"
"nativeBuildInputs"
"hash"
];
vendorStaging = stdenvNoCC.mkDerivation (
{
name = "${name}-vendor-staging";
@@ -74,12 +81,7 @@ let
nativeBuildInputs = [
fetchCargoVendorUtilV2
cacert
(nix-prefetch-git.override {
git = gitMinimal;
# break loop of nix-prefetch-git -> git-lfs -> asciidoctor -> ruby (yjit) -> fetchCargoVendor -> nix-prefetch-git
# Cargo does not currently handle git-lfs: https://github.com/rust-lang/cargo/issues/9692
git-lfs = null;
})
nix-prefetch-git'
]
++ nativeBuildInputs;
@@ -108,7 +110,6 @@ let
// removeAttrs args removedArgs
);
in
runCommand "${name}-vendor"
{
inherit vendorStaging;